Once again, I am coming to you asking for help getting attributed variables out of Prolog and into Python </bernie sanders meme>
I’m running a pengines server that has some s(CASP) code in it that returns attributed variables (numerical and disequality constraints). When I run it in the top level, there are no issues. When I access the same code through pengines, I get a 500 error from the pengines server. If I turn on debugging for the server I see this error message:
% [Thread 9] [1] 500 ERROR: numbervars/4: Type error: `[swish_default_template{A:bobult,Attributes:[_918 ∉
[jason],put_attr(_918,scasp_output,name(A))],Model:[not(-can_wfh(_794{_794 ∉ [jason],
scasp_output = ...})),can_wfh(bobult),-can_wfh(jason)],Tree:query-[can_wfh(bobult)-
[],o_nmr_check-[not(o_chk_1)-[not(-can_wfh(_794{_794 ∉ [jason], scasp_output = ...}))-[],-
can_wfh(jason)-[],not(can_wfh(jason))-[]]]]}]' contains attributed variables
% [Thread 9] Wiping posted data
My understanding of what numbervars is doing is taking things like _794
and replacing them with things like A
. If there’s a short-term workaround that would see me lose that benefit, that would not be the end of the world. But ultimately, I just want to get out of pengines everything I could get out of the top level.
If you would need a package that you could download to replicate the issue, let me know, but any minimal pengines server that exposes a predicate that returns an attributed variable would probably recreate the problem, I think. The s(CASP) code that is generating the issue for me is something like this:
:- use_module(library(scasp)).
person(bobult).
person(jane).
person(jason).
can_wfh(bobult).
-can_wfh(jason).
The query calls scasp(can_wfh(A),…)
Whatever you can suggest that would get me moving again would be very appreciated, because at the moment I’m stuck.
Thanks!