# Sandbox

**URL:** <https://swi-prolog.discourse.group/t/sandbox/5788>\
**Category:** General\
**Tags:** swish\
**Created:** [September 20, 2022, 5:37am UTC](https://swi-prolog.discourse.group/t/sandbox/5788 "2022-09-20T05:37:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![albangabillon](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/albangabillon/32/3689_2.png) [@albangabillon](https://swi-prolog.discourse.group/u/albangabillon)\
**Post date:** [September 20, 2022, 5:37am UTC](https://swi-prolog.discourse.group/t/sandbox/5788/1 "2022-09-20T05:37:26Z")

</div>

Hi,

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

```prolog
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)

```

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [September 20, 2022, 6:31am UTC](https://swi-prolog.discourse.group/t/sandbox/5788/2 "2022-09-20T06:31:45Z")

</div>

> [@albangabillon](#):
>
> What is the reason? Is there a way to circumvent this?

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.

---

<div class="post-metadata">

**Author:** ![albangabillon](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/albangabillon/32/3689_2.png) [@albangabillon](https://swi-prolog.discourse.group/u/albangabillon)\
**Post date:** [September 24, 2022, 6:11am UTC](https://swi-prolog.discourse.group/t/sandbox/5788/3 "2022-09-24T06:11:52Z")

</div>

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