Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SWIPL ad SWISH: "ERROR: Syntax error: Operator expected" using #= #2

Open
svanschalkwyk opened this issue Feb 17, 2024 · 1 comment

Comments

@svanschalkwyk
Copy link

?- use_module(library(clpfd)).
true.

?- 4 #= 2*Y.
ERROR: Syntax error: Operator expected
ERROR: 4
ERROR: ** here **
ERROR:  #= 2*Y . 
?- 

SWI-Prolog (threaded, 64 bits, version 9.0.4)

@lorenzwinkler1
Copy link

I just stumbled across the same issue. Apparently use_module is a directive and thus has to be put into a file.

What worked for me:

# FILE: imports.pl

:- use_module(library(clpfd)).

I don't know if you can import that

Then run swi-prolog.swipl imports.pl. Afterwards running 4 #= 2*Y. yields the expected Y=2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants