<rule> | ::= | <atom> [ <= <literals> ] . |
<rules> | ::= | <rule> [ <rules> ] |
<query> | ::= | ? <literals> . |
<literal> | ::= | <atom> | not <atom> |
<literals> | ::= | <literal> [ and <literals> ] |
<atom> | ::= | <predicate_ident> [ ( <terms> ) ] |
<term> | ::= | <ident> [ ( <terms> ) ] | <constant> | <Variable> |
<terms> | ::= | <term> [ , <terms> ] |
<Variable> | ::= | X | Child | P | GP | ... |
<constant> | ::= | <ident> | 0 | 1 | ... |
<predicate_ident> | ::= | <ident> |
<ident> | ::= | f | even | successor | charles | ... |
<Program> | ::= | <rules> <query> |
— Small Prolog Syntax — |