There are these facts:
man(john). man(carl). woman(mary). woman(rose).
I need to create the predicate people(List), which returns a list wi
Using findall/3:
people(L) :- findall(X, (man(X) ; woman(X)), L).
?- people(X). X = [john, carl, mary, rose].
Here we go:
person(anne). person(nick). add(B, L):- person(P), not(member(P, B)), add([P|B], L),!. add(B, L):- L = B,!. persons(L):- add([], L).