Next: Function calls, Previous: Variables, Up: Syntax [Contents][Index]
A simple compound term is composed of an atom of the first two forms (an alphanumeric or graphic atom), called the functor, immediately followed (no spaces) by a sequence of zero or more expressions separated by commas, enclosed in a pair of "("..")" parenthesis. For example:
data(jack, 35) tr(emp(),X/9,tr(L,7,R)) $$(5)
Simple compound terms must be instances of a structured data type declared in the program where the functor is a constructor for the type.
A compound term is a simple compound term, or a compound term immediately followed by a sequence of zero or more expressions separated by commas, enclosed in a pair of "("..")" parenthesis. For example:
curry(*)(4) curryR(child_of)(mary)(P)
Compound terms that are not simple determine the functor of the compound term by a function call which is itself a compound term.
Note that, in QuLog, a()
is a zero arity compound term that is different from the atom a
.