next up previous
Next: Rules Up: Facts and rules Previous: Facts and rules

Facts

Semantically the facts constitute a declaration of a true state of affairs. As far as Prolog is concerned, any fact in its database is treated as true. If a file containing the fact
male(phil).
is consulted, the goal
|?-male(phil)
elicits the Prolog response
yes
This is Prolog reporting that the expression evaluates as true with respect to its database. With respect to the same database, the goals
|?-female(phil).

|?-male(chas).
will produce the responses:
|?-female(phil).

no

|?-male(chas).

no
That is, with respect to this database, these facts are not known to be true. A database consisting only of facts is not very interesting. The action picks up when rules are added.

Steve Harlow 2001-11-26