9 AssumablesTop7 Ask-the-user8 Built-in predicates

8 Built-in predicates

There are a few built-in predicates. These cannot be redefined. The following arithmetic predicates are predefined: Arithmetic expressions can either be numbers or of the form (E1+E2), (E1-E2), (E1*E2), (E1/E2), sin(E), log(E), etc.

Example. The following shows a simple use of is and >. It shows how we can use variables in the expressions, as long as they are bound before (to the left) they are used.

cilog: ask X is 3+4*5 & X*2 > 11*3.
Answer: 23 is 3+4*5 & 23*2>11*3.

The restriction that the arithmetic expressions must be ground when called is severe, and probably won't be fixed in future implementations.

There is one non-arithmetic comparison:

X and Y must be bound enough to determine whether they can be unified. (Delaying is not implemented). This may be fixed in future versions.
©David Poole, 1998

9 AssumablesTop7 Ask-the-user8 Built-in predicates