SWI-Prolog/swish

Feature request: Allowing call/1 on clpr goals in the sandbox

JeanChristopheRohner opened this issue · 2 comments

I don't know if this is feasible but it would be nice to make call/1 on clpr goals sandbox safe, e.g. {X = 3 + 2}. Right now this code

:-use_module(library(clpr)).
myEq({3 = 2 + 1}).
main:-myEq(EQ), call(EQ), writeln(EQ).

returns the error "Sandbox restriction! Could not derive which predicate may be called from call(C) main".

call/1 plays an important role in meta interpreters (MIs) and it would be cool to be able to get Swish to reason about probabilistic clauses.

I'm afraid that in general meta interpretation is out of scope for the anonymous SWISH. If you run SWISH locally you can disable the sandbox and run any valid Prolog program. Sandboxing using static analysis will never be able to prove the safety of arbitrary meta-interpreted code. A runtime sandbox could do so. One day that may happen, but it is not in any concrete planning.

I understand. Thanks anyway!