Solved it!
Just had to make sure that Person and Person1 where members of one of the familys then use length on child.
Thanks for the family tip that was very helpful to getting me thinking the right way.
Thanks for that.
What I don't understand is if they are both searching for the same thing how does nameing them different make them different.
Does Family act as teh first family in the knowledge base and Family1 the second and so on.
Do I then just use
member(Person,Family)...
aq4(Person,Person1):-
Person = person(Name,Surname,_,_),
Person1 = person(Name,Surname,_,_),
exists(Person),
exists(Person1),
Person \=Person1.
I've managed to create this which returns only persons with the same name. However it duplicates its anwers and I still can't find the number of...
Hello,
I'm new to prolog and are used to programming with java and .net. I can't think the way it wants me to.
I'm working off a family structure tutorial an example of the familys lay out is below.
family(
person(pat,marx,date(10,march,1944),unemployed)...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.