Welcome, Guest! Log In | Create Account

FAQ

Does Pyke support negative logic?

  • Yes, using the notany clause.

Will Pyke run on Python3.x?

  • Yes, there is a second file release in sourceforge whose name starts with "pyke3" for the Python 3 version of Pyke.

How do I distribute my application that uses Pyke?

  • Read this wiki page.

Can Pyke do pattern matching on arbitrary Python objects?

  • Currently Pyke can not directly do pattern matching on arbitrary Python objects. But you may (in spite of what the documentation says) use Python objects as arguments to facts or goals, or within tuples. But the only pattern that you may use on them is a pattern variable to match the whole object. You may then use the check premise to test the object's suitability for use within a particular rule. But note that though Pyke automatically reruns forward-chaining rules when new facts are asserted, it will not rerun rules when the object changes.

Does Pyke support Prolog "cuts"?

How do I access my engine object from within my rules?

  • Both forward-chaining and backward-chaining rules have a variable called engine that you can use directly within Python code fragments within your rules. (Note: But this is not available to the Python code in the with clause of your backward-chaining rules).

How can I assert new facts from a backward-chaining rule?

  • Use the python clause to call the assert_ function on the engine object (available to all rules as an implicit engine variable within rule).

Does Pyke do fact retraction?

  • Not at this time. This may be added in a future release.