Sandbox

Hi,

The following code works under swi-prolog but fails under swish. What is the reason? Is there a way to circumvent this?

et(X,Y) :- X, Y.
ou(X,_) :- X,!.
ou(_,Y) :- Y.
non(X) :- \+ X.
implique(X,Y) :- ou(non(X),Y).
equivalent(X,Y) :- implique(X,Y),implique(Y,X).

booleen(true).
booleen(fail).

evalue(X,true) :- X.
evalue(X,fail) :- \+ X.

table(X,Y,Z,R) :- booleen(X),booleen(Y),evalue(Z,R).

?- table(X,Y,et(X,ou(X,Y)),R).
Sandbox restriction!
Could not derive which predicate may be called from
	  call(C)
	  et(A,ou(A,B))
	  call(et(D,ou(D,E)))
	  evalue(et(A,ou(A,B)),C)
	  table(A,B,et(A,ou(A,B)),C)

Too much meta calling. In theory I guess that abstract interpretation could figure out that this only calls true and false, but it is not clever enough. Works on a local copy or the new in-browser version at #wasm_demo.

I did not know about the port of prolog in wasm. It is interesting. Thank you.