mother can be used in several ways. If both X and Y variables are uninitialized, then it looks for all mother relationships. If one of them is initialized, it looks for matching relationships. If both are initialized, it returns true if such a relationship exists.
Depends on how you want to define your domain knowledge.
The thing you need to define for sure is the predicate mother/2
(Which has arity 2, or in other words, two arguments). From then on, multiple options are available:
mother(X, Y)
as an “axiom”, and define mother terms for all elements:mother(abel, eve).
mother(isaac, sarah).
mother(X, Y)
from female(X)
and parent(X, Y)
terms.mother(X, Y) :-
parent(X, Y),
female(Y).
parent/2
terms instead of mother/2
and father/2
.
This is a nice overview: CLPFD and CLPZ: Prolog Integer Arithmetic