Terms are sequences of items contained in axioms and templates. All terms share some common characteristics such as having a name and the ablity to store a single value.
Axioms contain terms which are never empty and have constant values. Templates contain terms which are typically empty until the first unification+evaluation step has been completed. Axioms and templates share an underlying implementation, but the role of axioms is to relay facts, while the role of templates is to analyse data and generate new facts in the form of axioms.
Examples of terms from the introduction are:
where "bilene" is a string literal and 1718 is an integer literal.
where name ? altitude > 5000 is a variable with a an expression containing operators "?" and ">" and altitude is an empty variable.
Axiom terms
Axiom terms may be anonymous or named. The names are listed separately in the axiom declaration eg.
Use of named terms is recommended as it facilitates insertion of new terms amongst existing ones.
Template terms
Template terms have a large variety of formats reflecting the diverse operations allowed by eXPL. Terms intended to be included in the template solution must be named so their values can be accessed by consumers. Template terms are typically variables which can be referenced in expressions of other template terms.
There are two distinct roles a term can play in a unification+evaluation step:
- Create a new fact. The term may be simply be set to the value of a unification axiom term or assigned to an expression containing one or more axiom terms.
- Allow current unification step to be abandoned and proceed to the next iteration. This is called a "short circuit" and there are various term types that do this, such as comparison to a value or selection list.
Template terms can be characterised as empty or populated, typed or untyped and whether they evaluate an expression. Opposite are shown examples of the various possibilities.
