14 Prolog+CG (Ad)


Most of what we have said in this part has been generally applicable to most Prolog systems. We haven't said much that was specific to Prolog+CG. Exceptions have been, e.g.:

  • Strings are enclosed in "double quotes".
  • Lists are enclosed in (parentheses).
  • Variables can consist of upper-case and lower-case letters, digits, and underscores. They must start with a letter or and underscore, and the first two characters must not both be letters (in which case it would be an identifier).
  • The eq/2 primitive goal is the goal that is used for matching two terms.

In most other Prolog systems, strings are enclosed in 'single quotes', lists are enclosed in [square brackets], and variables must start with an upper-case letter, and the two first characters of a variable can both be letters.

In this chapter, we will be looking at some more things that are specific to Prolog+CG. In particular, we will be looking at built-in primitive goals.

A list of primitive goals can be found by clicking the menu-item Windows -> Primitives in Prolog+CG. They are described in the Prolog+CG manual. If you need more help, you can read this.

We start by looking at some relational goals.

Prev: 13.5 Quiz: Recursivity and lists (Ad)
Up: Part III: Programming
Next: 14.1 Relational goals (Ad)