-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can i have two Prolog instances simultaneously? #74
Comments
+1 also it seems like multiple instances of Prolog share the same prolog state, and I cannot find a way to even reset the state, like cancel all consult calls for example |
This is a limitation of SWI prolog. The C interface supported multiple execution threads, but only a single (global) database. You will not need to start/stop prolog process though (they only run while executing a query). |
@stuz5000 thank you! I cannot find a way to change the database either. Do you happen to know if there is any possibility to do revert or replace for |
Yes. You can place all of your rules and facts into a single module that is
independent of the rest of the database. You can them query for and abolish
the contents of the module. Modules themselves cannot be cleaned up.
There was a recent question about this in the SWI Discourse message group
…On Tue, May 5, 2020 at 3:24 AM Pavlo Skliar ***@***.***> wrote:
@stuz5000 <https://github.com/stuz5000> thank you! I cannot find a way to
change the database either. Do you happen to know if there is any
possibility to do revert or replace for consult(...) the same way as it
can be done with retract_all(...) for single facts.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#74 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB3QJLCU5PCXQ3W6LYGCTY3RP7SNNANCNFSM4JMW77WQ>
.
|
As this Issue is still not closed. For a solution to this problem I am using pywip_notebook as it creates an instance of Prolog in different modules. I think this may resolve your issues. |
From looking at the code it seems like Prolog is started when the library is imported.
Is that necessary? For me this library would only be useful if I could start/stop Prolog processes at will.
The text was updated successfully, but these errors were encountered: