Some examples
Son(John,Bill)
Is John Bill's son?
Son(X,Bill)
List all … sons of Bill
Son(John,X)
… persons of which John is a son
Son(X,Y)
… son relationships
Rule Syntax
- A rule is a leaf or a compound term.
- A leaf term (op) is a word.
- A compound term is a word followed by an argument list.
- A word has one letter or more.
- One-letter words are variables.
- Whitespace is ignored.
- Case-sensitive (a and A are different).
Grammar
Rule ::= Op | Compound
Op ::= Letter+
Compound ::= Op "(" Rule ( "," Rule )* ")"
Letter ::= [A-Za-z]