|
<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 -- |
- Key:
- lhs ::= rhs -- lhs can be replaced by rhs, or lhs is rhs,
- [ a ] -- optional a,
- a | b -- either a or else b.
-
- Alternatives:
- ?- for ?
- :- for <=
- , for and
|
|