Buscar en Mind w/o Soul

jueves, diciembre 13, 2007

Prolog en Python y C#

Una librería para crear programas funcionales PROLOG entrelazados con código imperativo.

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: