sCASP on SWISH gives different result to a local install of swi-pl

Out of frustration I turned to SWISH to test Event Calculus prototype sCASP code that was giving surprise results on the latest swi-pl (development) version.

SWISH Version information

URL: https://swish.swi-prolog.org/example/scasp.swinb (with same codebase being tested)
SWISH version V1.7.0-114-g7777667-DIRTY
Running on SWI-Prolog version 9.1.6

Locally installed swi-pl (Ubuntu 20.04) version information

$ /usr/bin/swipl
Welcome to SWI-Prolog (threaded, 64 bits, version 9.1.7)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.

For online help and background, visit https://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).

?- pack_install(scasp).
% Contacting server at https://www.swi-prolog.org/pack/query ... ok
% Pack `scasp' is already installed @0.9.0
true.

Results comparision

With the same code loaded in both systems I get.

SWISH (provides expected results)

?-

? holdsAt(connection_allowed(S,D,P,Srv), T).

D = '75.2.43.14',
P = 443,
S = '192.168.1.20',
Srv = https,
{_107966>0,_107978=16-_107966+_107986,_108002=<16,_108014 = -16+_108002-_107986,_108038=<16,_108050 = -16+_108038-_107986,_108074 = -16+_108088-_107986,_108098=16-_108088+_107986,_58468=<16,_58514=_58526+_58468+_58478,_58526<0,_58550>16,_58562 = -_58550+_58468+_58478,_58590>0,_58602 = -_58590+_58468+_58478,_58630=<16,_58642=_58630-_58468-_58478,_58666=<16,_58678=_58666-_58468-_58478,_58702=_58714-_58468-_58478,_58726 = -_58714+_58468+_58478,_58714=<16,_58766=_58778+_58468+_58478,_58778<0,_58802 = -_58820+_58468+_58478,_58820=<0,_58842>0,_58854=16-_58842,_58872=<10,_58884 = -16+_58872,_58902=<10,_58914 = -16+_58902,_58932 = -16+_58940,_58950=16-_58940,_58940=<10,_58980=16+_58988,_58988 > -6,_58988<0,_59022=16-_59030,_59030=<0,_59052>0,_59064=16-_59052,_59082=<10,_59094 = -16+_59082,_59112=<10,_59124 = -16+_59112,_59142 = -16+_59150,_59160=16-_59150,_59150=<10,_59190=16+_59198,_59198 > -6,_59198<0,_59232=16-_59240,_59240=<0,_59262>0,_59274=16-_59262,_59292=<10,_59304 = -16+_59292,_59322=<10,_59334 = -16+_59322,_59352 = -16+_59360,_59370=16-_59360,_59360=<10,_59400=16+_59408,_59408 > -6,_59408<0,_59442=16-_59450,_59450=<0,_59472>0,_59484=16-_59472,_59502=<10,_59514 = -16+_59502,_59532=<10,_59544 = -16+_59532,_59562 = -16+_59570,_59580=16-_59570,_59570=<10,_59610=16+_59618,_59618 > -6,_59618<0,_59652=16-_59660,_59660=<0,T=16+_58366,_58366>0}
s(CASP) model
s(CASP) justification
3.388 seconds cpu time
D = '200.200.200.24',
P = 443,
S = '192.168.1.20',
Srv = https,
{_108194>0,_108206=15-_108194+_108214,_108230=<15,_108242 = -15+_108230-_108214,_108266=<15,_108278 = -15+_108266-_108214,_108302 = -15+_108316-_108214,_108326=15-_108316+_108214,_58582=<15,_58628=_58640+_58582+_58592,_58640<0,_58664>15,_58676 = -_58664+_58582+_58592,_58704>0,_58716 = -_58704+_58582+_58592,_58744=<15,_58756=_58744-_58582-_58592,_58780=<15,_58792=_58780-_58582-_58592,_58816=_58828-_58582-_58592,_58840 = -_58828+_58582+_58592,_58828=<15,_58880=_58892+_58582+_58592,_58892<0,_58916 = -_58934+_58582+_58592,_58934=<0,_58956>0,_58968=15-_58956,_58986=<10,_58998 = -15+_58986,_59016=<10,_59028 = -15+_59016,_59046 = -15+_59054,_59064=15-_59054,_59054=<10,_59094=15+_59102,_59102 > -5,_59102<0,_59136=15-_59144,_59144=<0,_59166>0,_59178=15-_59166,_59196=<10,_59208 = -15+_59196,_59226=<10,_59238 = -15+_59226,_59256 = -15+_59264,_59274=15-_59264,_59264=<10,_59304=15+_59312,_59312 > -5,_59312<0,_59346=15-_59354,_59354=<0,_59376>0,_59388=15-_59376,_59406=<10,_59418 = -15+_59406,_59436=<10,_59448 = -15+_59436,_59466 = -15+_59474,_59484=15-_59474,_59474=<10,_59514=15+_59522,_59522 > -5,_59522<0,_59556=15-_59564,_59564=<0,_59586>0,_59598=15-_59586,_59616=<10,_59628 = -15+_59616,_59646=<10,_59658 = -15+_59646,_59676 = -15+_59684,_59694=15-_59684,_59684=<10,_59724=15+_59732,_59732 > -5,_59732<0,_59766=15-_59774,_59774=<0,T=15+_58480,_58480>0}
s(CASP) model
s(CASP) justification
1.515 seconds cpu time

Local SWI-Prolog (threaded, 64 bits, version 9.1.7) (unexpectedly provides no results).

?- ? holdsAt(connection_allowed(S,D,P,Srv), T).
false.

?-

For other queries, both provide the same results.

SWISH

? holdsAt(firewall(Active), Time).
Active = active,
{_37596>0,_37608=10-_37596+_37616,_37632=<10,_37644 = -10+_37632-_37616,_37668=<10,_37680 = -10+_37668-_37616,_37704 = -10+_37718-_37616,_37728=10-_37718+_37616,_37718=<10,_37764=_37776+_37718+_37728,_37776<0,_37800>10,_37812 = -_37800+_37718+_37728,_37840>0,_37852 = -_37840+_37718+_37728,_37880=<10,_21148=_21136-_20974-_20984,_21172=<10,_21184=_21172-_20974-_20984,_21208=_21220-_20974-_20984,_21232 = -_21220+_20974+_20984,_21220=<10,_21272=_21284+_20974+_20984,_21284<0,_21308 = -_21326+_20974+_20984,_21326=<0,Time=10+_20872,_20872>0}
s(CASP) model
s(CASP) justification

Local SWI-Prolog (threaded, 64 bits, version 9.1.7)

?- ? holdsAt(firewall(Active), Time).
Active = active,
% s(CASP) model
{ happens(onboarding,10),                     not ¬ holdsAt(_,_B),                        initiates(onboarding,firewall(active),10),
 not ¬ holdsAt(_,_A),                        holdsAt(firewall(active),Time),             not stoppedIn(10,firewall(active),Time)
},
{_C>0, _=_D+_E-_C, _F=<10, _= -_D-_E+_F, _G=<10, _= ... - ... + _G, _= ... + ..., ... = ..., ..., ...},
{_P>0, _=_A-_P, _Q>0, _=_A-_Q, _R>0, _=_A-_R, _S>=0, ... = ..., ... =< ...},
{_T>0, _=_B-_T, _U>0, _=_B-_U, _V>0, _=_B-_V, _W>=0, ... = ..., ... > ...} [write]
Active = active,
scasp_show_model([happens(onboarding, 10), not-holdsAt('$VAR'('_'), '$VAR'('_A')), not-holdsAt('$VAR'('_'), '$VAR'('_B')), holdsAt(firewall(active), '$VAR'('Time')), initiates(onboarding, firewall(active), 10), not stoppedIn(10, firewall(active), '$VAR'('Time'))], [unicode(true)]),
{'$VAR'('_C')>0, '$VAR'('_')='$VAR'('_D')+'$VAR'('_E')-'$VAR'('_C'), '$VAR'('_F')=<10, '$VAR'('_')= -'$VAR'('_D')-'$VAR'('_E')+'$VAR'('_F'), '$VAR'('_G')=<10, '$VAR'('_')= -'$VAR'('_D')-'$VAR'('_E')+'$VAR'('_G'), '$VAR'('_')= -'$VAR'('_D')-'$VAR'('_E')+'$VAR'('_H'), '$VAR'('_')='$VAR'('_D')+'$VAR'('_E')-'$VAR'('_H'), '$VAR'('_H')=<10, '$VAR'('_')='$VAR'('_D')+'$VAR'('_E')+'$VAR'('_I'), '$VAR'('_D')+'$VAR'('_E')+'$VAR'('_I')>10, '$VAR'('_I')<0, '$VAR'('_D')>10, '$VAR'('_E')=<0, '$VAR'('_J')>0, '$VAR'('_')= -'$VAR'('_J')+'$VAR'('_D')+'$VAR'('_E'), '$VAR'('_K')=<10, '$VAR'('_')='$VAR'('_K')-'$VAR'('_D')-'$VAR'('_E'), '$VAR'('_L')=<10, '$VAR'('_')='$VAR'('_L')-'$VAR'('_D')-'$VAR'('_E'), '$VAR'('_')='$VAR'('_M')-'$VAR'('_D')-'$VAR'('_E'), '$VAR'('_')= -'$VAR'('_M')+'$VAR'('_D')+'$VAR'('_E'), '$VAR'('_M')=<10, '$VAR'('_')='$VAR'('_N')+'$VAR'('_D')+'$VAR'('_E'), '$VAR'('_N')+'$VAR'('_D')+'$VAR'('_E')>10, '$VAR'('_N')<0, '$VAR'('_')= -'$VAR'('_O')+'$VAR'('_D')+'$VAR'('_E'), '$VAR'('_O')=<0, '$VAR'('Time')='$VAR'('_D')+'$VAR'('_E'), '$VAR'('_')= -10+'$VAR'('_D')+'$VAR'('_E')},
{'$VAR'('_P')>0, '$VAR'('_')='$VAR'('_A')-'$VAR'('_P'), '$VAR'('_Q')>0, '$VAR'('_')='$VAR'('_A')-'$VAR'('_Q'), '$VAR'('_R')>0, '$VAR'('_')='$VAR'('_A')-'$VAR'('_R'), '$VAR'('_S')>=0, '$VAR'('_')='$VAR'('_A')+'$VAR'('_S'), '$VAR'('_A')=<0},
{'$VAR'('_T')>0, '$VAR'('_')='$VAR'('_B')-'$VAR'('_T'), '$VAR'('_U')>0, '$VAR'('_')='$VAR'('_B')-'$VAR'('_U'), '$VAR'('_V')>0, '$VAR'('_')='$VAR'('_B')-'$VAR'('_V'), '$VAR'('_W')>=0, '$VAR'('_')='$VAR'('_B')+'$VAR'('_W'), '$VAR'('_B')>0} .

?- 

Are there some magic autoloaded libraries that are causing issues?

I am happy to share the Event Calculus code directly to those who have expertise.
The code starts with the standard bec_theory.incl from git (sCASP/bec_theory.incl at 72028b02d57e51fe24c4be54234ab75767cd469f · JanWielemaker/sCASP · GitHub)

Any help appreciated.

– Steve

I see the pack still points at the old repo, so it is a pretty old version of sCASP. To install the most recent:

git clone https://github.com/SWI-Prolog/sCASP
cd sCASP
swipl
?- pack_install(.).

(probably first needs ?- pack_remove(scasp).)

Thanks Jan. That was it.

I am using the current git version which is working for me.

(Now to get the hair off the floor and insert it back into my scalp).

Cheers,

Steve

Updated the location of the pack, so ?- pack_install(scasp). should work again.