Skip to content

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

Open

Description

@svanschalkwyk
?- 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)

Activity

  1. lorenzwinkler1 commented on Feb 29, 2024

    @lorenzwinkler1

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions