Clocksin & Mellish

BAP Online Manuals : Compiler Reference Manual : Language Description: : Clocksin & Mellish
Previous: Prolog in General
Next: Brain Aid Prolog Syntax :

3.5.2. Clocksin & Mellish Prolog

For those of you, who are not familiar with the Clocksin & Mellish PROLOG, we discuss differences of that to other popular PROLOG implementations.

Evaluation of numerical expressions is done by the 'is()' ' predicate. The ' =() ' predicate is only used for unification and does NOT perform any evaluation. For example:

A is 7+5 --> Result A matches 12

B = 7+5 --> Result B matches 7+5 or +(7,5)

5 is 25 mod 10 succeeds

25 = 5 * 5 fails

Conjunctions and disjunctions of goals are possible with the ',' and ';' operators.

These operators may be nested. To avoid confusion, it is advisable to use extra brackets.

The ' cut ' ) built-in predicate affects backtracking. If it is encountered, the system commits to all actions done since entering the parent predicate. Thus, if backtracking occurs and is trying to re-satisfy the '!', the parent predicate fails.


BAP Online Manuals : Compiler Reference Manual : Language Description: : Clocksin & Mellish
Previous: Prolog in General
Next: Brain Aid Prolog Syntax :