I got the following promblem:
the following facts and predicates are defined:
father(avr, yit).
male(avr).
married(avr, sara).
father(yit, yaak).
married(rivka, yit).
father(yaak, yosef).
mother(rachel, yosef).
father(yaak, levi).
mother(leaa, levi).
mother(zilpa, gad).
father(yaak, dan).
mother(bilhaa, dan).
father(yosef, menashe).
father(yosef, ephraim).
are_married(X,Y) :- married(X,Y).
are_married(X,Y) :- married(Y,X).
I defined the following predicates:
married(X,Y) :- mother(X,Z) , father(Y,Z).
mother(X) :- are_married(X,Y) , father(Y,_).
now, the promblem is that mother is defined by marriage, and marriage is defined by being a mother - the result is an infinite loop, and the program crashes.
how can I prevent the infinite loop? is there a way to tell a predicate not to use a different predicate?