Here is an informal version of the procedural semantics for the example above:

If we can find a value ofThe declarative semantics.Xthat satisfies the goaleven(X)then we have also found a number that satisfies the goaldivisible_by_two(X).

If we can prove thatXis ``even'' then we have proved thatXis ``divisible_by_two''.

Note that there is an implicit universal quantification here. That is,for all objectsthose that are even are also divisible by two.X.(even(X) divisible_by_two(X))Also note that theheadgoal is found on the right of the standard logical implication symbol. It is a common error to reverse the implication.

Two final examples of a single rule. The first:

all scots people are britishcan be turned into:

Note thatbritish(Person):-scottish(Person).

if you go from one country to another they you are a touristturns into:

wheretourist(P):-move(P,Country1,Country2).

There is a problem here.
We really need to specify that ** Country1** and ** Country2** are legitimate
and distinct countries.

Mon May 24 20:14:48 BST 1999