The word relation, in Prolog, has its usual mathematical meaning. See relations and functions if you are not sure about what this is. A unary relation is a set of objects all sharing some property. Example:


A binary relation is a set of pairs all of which are related in the same way. Example:

eats(fido, biscuits).
eats(rex, chocolate).
eats(rover, cheese).
eats(lassie, bone).

Similarly for ternary relations (triples) and so on. In the examples above, is_dog and eats are the functors for the relations. Prolog stores information in the form of relations, or more specifically relational instances, like those above, and also in the form of rules.

It is also possible in Prolog to have nullary relations (a relation with no arguments), though they are perhaps not often used. Example:


This could be used as a goal in a query:

?- program_untested.

Possibly a better way to do this would be to use a unary relation:


However, the point is that nullary relations are there in Prolog, should you find a use for them.

See also the the next entry for more detail.