Yield Prolog
uncle(Person, Uncle) :-
parent(Person, Parent),
brother(Parent, Uncle).
(This says that a person has an uncle if the person has a parent and that parent has a brother.) And here it is in Yield Prolog for Python
def uncle(Person, Uncle):
Parent = Variable()
for l1 in parent(Person, Parent):
for l2 in brother(Parent, Uncle):
yield False
No hay comentarios:
Publicar un comentario