An expression is any grammatically correct string of symbols of a knowledge
representation (KR) language. For example, an expression can be a constant
a, term
1+2, or formula or statement
on(a,b), clear(table).
The KR Interface has been designed to make minimal assumptions about the
language elements that are present in a KR language and does not make
assumptions about the syntax of expressions. The examples provided in the
previous paragraph have only been provided for purposes of clarification.
The assumptions about expressions in the KR language that have been made are
the following:
- each expression has a 'main operator': this may either be the expression
itself (e.g., in case of a constant or simple literal) or a functor (e.g.,
'+' or the logical operator 'not').
- the language contains variables (though strictly speaking this is not
actually enforced; the methods
#isClosed,
#isVar,
#getFreeVar,
#applySubst, and
#mgu, however, only
make sense if variables are present in the language.
Important:
Expression and other language elements such as
Var may be used in
Sets and should implement
java.lang.Object#hashCode and
java.lang.Object#equals.