prolog with python

William Heath wgheath at gmail.com
Wed Dec 2 21:47:17 EST 2009


Hi All,

I have the following prolog program that I would really like to be able to
run in python in some elegant way:

q00(X01, R):-  write('Are you over 80?'), read(INPUT), write(''), q11(INPUT,
R).
q11(X11, R):-  X11=y, write(' You are passed the hardest year'), !.
q00(X01, R):-  write('You are not over 80'),

Most of the implementations I have seen use assert's and don't appear to
handle backtracking or negation.  I somehow need to provide input to the
rules as well as you can see above.  Anyone know how to do this well using a
python library?  I would love a 100% python solution if I could find one.
Anyway, thanks!

-Tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20091202/8b1dd9a0/attachment-0001.html>


More information about the Python-list mailing list