junk at geekabytes.net
Sat Jun 7 22:38:40 CEST 2003
Robert Oschler wrote:
>Has anybody seen a Python module that adds Prolog-style unification (pattern
>matching) to Python? I know about PyLog and SnoPy, but that's not quite
>what I'm looking for.
>Android Technologies, Inc.
>- The home of Off-Book! (tm)
>The scene memorization tool for Actors and Actresses!
I am working on a Master's Thesis currently where this issue is of
concern. I would also like to know if there is such a module.
In the mean time, I have written my own module which does a pretty good
job of simulating Prolog style calls. Here is what my syntax looks like
Father = logic.Fact()
X = logic.LogicalVariable()
Y = logic.LgocialVariable()
print X, Y
Grandfather = logic.Fact()
Grandfather(Grandfather.Grandfather, Grandfather.Grandson) (
The output of this is:
I'm still tracking down bugs all the time, but it's getting pretty good.
Would you PLEASE let me know what you think?
-- Seth James Nielson
More information about the Python-list