Can't call library clpfd (Swish)

I’ve been looking into some classical problems in prolog recently and stumbled upon the 8queens problem in this SWISH notebook: https://swish.swi-prolog.org/example/clpfd_queens.pl.
The problem is that I can’t apparently access the clpfd library from SWISH and, while that seems strange to me since I found the example in a SWISH notebook, i can’t find any way to solve the issue.

EDIT: i hosted locally SWISH and obviously solved the sandbox issue.
I followed these instructions: https://github.com/SWI-Prolog/swish/blob/master/README.md
Works like a dream

1 Like

To keep users from using the Prolog code to hack into the site, the code is run in a sandbox and in the sandbox only certain predicates are allowed thus the error message.

image

No permission to call sandboxed <predicate>

Apparently the problem has occurred before and can be fixed with restarting SWISH but I don’t have that ability.

so there’s no way i’m running that code online, right?. Would Installing SWISH locally solve the issue? I really like the editor and would be a real shame if i had to drop it.

From what I read it should work online once SWISH is restarted and when Jan sees this post he will restart SWISH. Jan usually visits the sites a few times a day but less often on weekends.

If you want to know how the code works, see: Understanding CLP(FD) Prolog code of N-queens problem

Cool! Thank you for your support!

It might be easier to use SWI-Prolog by just installing SWI-Prolog on your machine.

Windows: Install SWI-Prolog development version on Windows 10

Linux: Install SWI-Prolog development version on Ubuntu using PPA

yes i mean of course it’s easier but i really like SWISH’s whole graphical interface, the fact that highlights the text in the knowledge base while executing the trace/0 command etc…
I really wanted to use SWISH that’s why i posted this thread in the first place.

1 Like

One should use what works best. :wink:

Was not sure if you knew there were other options.

Restarted. Unfortunately I only have a little laptop around and no time to dig and see why this sometimes happens.

2 Likes

What it looks like when working.

1 Like