Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Asserting rule to specific module using Pythonic interface?

14 views
Skip to first unread message

Henry Schmitt

unread,
Dec 10, 2024, 1:18:08 AM12/10/24
to pyswip
Hello,
I need to be able to put together sets of rules in different modules. I found I can assert facts to specific modules by using the pythonic interface by calling a Functor with the module parameter, but I can't find an example of how to assert rules in a similar way. Is this possible?

Thank you

yuce

unread,
Dec 10, 2024, 2:12:51 PM12/10/24
to pyswip
Hi,

If you want to use the Pythonic interface you can use something like this:
The following is the equivalent, much simpler code that uses the simple `Prolog.assertz` and `Prolog.query` with raw Prolog:

Both examples work with Pyswip v0.3.2

Hope it helps,
Yüce
Reply all
Reply to author
Forward
0 new messages