I try to find how many children a person have. Created my sample space and in find procedure i should count the numbers of children and print the value.
?- find(joe,Result). false.
i tried to change
find(X,R) like that:
find(X,R) :- R is 0 . R is R+1 , father(X,Y). write(R).
then its input/output became like that
?- find(joe,R). R = 0.
I tried what i know about prolog but i think i have few knowledge to do that task. All suggestions are welcome. Thanks for all your interest.
:- [library(clpr)]. mother(susan, sue). father(joe, eric). father(joe, smith). father(joe, barrack). father(sue, john). father(eric, bill). father(bill, george). find(X,R):- R is 0, R is R+1 , father(X,Y).