<< >> Up Title Contents

1.2.1. 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 response:

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.


<< >> Up Title Contents