home
  News
  Discussion forum
  WIKI
  Collaboration
  Downloads
  Language grammar
  Examples
 associated projects
  RuleML
  GoPubMed
  Mandarax
  RBSLA
  Jena

Language definition in EBNF

 

prova ::= {statements}, end of file;
statements ::= {statement}, {statements};
statement ::= (fact | rule | query), end of statement;
fact ::= relation;
rule ::= relation, ":-", atoms;
query ::= ("eval" | "solve"), "(", relation, ")";
atoms ::= {atom, {",", atoms}};
atom ::= relation | arithmetic relation | java call | cut;
relation ::= predicate symbol, "(", terms, {"|", argument tail}, ")";
argument tail ::= variable;
predicate symbol ::= lowercase word | uppercase word;
java call ::= functional java call | predicate java call | constructor java call;
functional java call ::= left term, "=", predicate java call;
predicate java call ::= static java call | instance java call;
static java call ::= qualified java class,".",method name,"(", terms,")";
instance java call ::= variable, ".", method name, "(", terms, ")";
constructor java call ::= left term,"=",qualified java class,"(",terms,")";
terms ::= {term, {",", terms}};
term := left term | (func, "(", terms, ")");
left term ::= variable | constant | prova list;
func ::= variable | constant;
variable ::= uppercase word | typed variable;
constant ::= lowercase word | ('"', string, '"') ;
typed variable ::= qualified java class, uppercase word;
prova list ::= "[]" | ("[", head, {"|", tail}, "]");
arithmetic relation ::= left term, binary operator, term;
binary operator ::= "=" | "<>" | ">" | "<" | ">=" | "<=";
head ::= term;
tail ::= variable;
uppercase word ::= ["A"-"Z","_"], {lowercase word};
lowercase word ::= ["a"-"z"], {word};
word ::= ["a"-"Z",0-9]+;
cut ::= "!";
end of statement ::= "." newline;