Relational/Logic Programming in Python?


Question

I'm a longtime python developer and recently have been introduced to Prolog. I love the concept of using relationship rules for certain kinds of tasks, and would like to add this to my repertoire.

Are there any good libraries for logic programming in Python? I've done some searching on Google but only found the following:

jtauber's blog series on relational_python

Would love to compare to some others...thanks!

-aj

1
34
3/29/2012 1:33:16 PM

Accepted Answer

Perhaps you should google "Logic Programming in Python". Pyke looks promising:

Pyke introduces a form of Logic Programming (inspired by Prolog) to the Python community by providing a knowledge-based inference engine (expert system) written in 100% Python.

Unlike Prolog, Pyke integrates with Python allowing you to invoke Pyke from Python and intermingle Python statements and expressions within your expert system rules.

11
5/5/2013 11:14:12 AM

You may want to use pyDatalog, a logic programming library that I developed for Python implementing Datalog. It also works with SQLAlchemy to query relational databases using logic clauses.


Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon