I’m using the latest version of swi-prolog stable, and installing the sCASP library.
If in Python I use thread.query('scasp(mortal(X))')
, I get the bindings only. The model and the justification that the scasp()
predicate would provide inside the REPL are not there.
I suspect that the way the MQI is implemented it does not process any output from queries other than bindings. How can I access the output of the scasp() predicate through swiplserver?
from swiplserver import PrologMQI, PrologThread
with PrologMQI() as swipl:
with swipl.create_thread() as swipl_thread:
swipl_thread.query("use_module(library(scasp)).")
swipl_thread.query("assert(mortal(X) :- man(X)).")
swipl_thread.query("assert(man(socrates)).")
answer = swipl_thread.query("scasp(mortal(X)).")
print(answer)
returns
[{'X': 'socrates'}]
Right now there is an error being thrown in the scasp justification result if I use swipl in the REPL, but that’s a different problem, I suspect.