2

How can I use once in SICStus? In SWI Prolog, the following works:

test(X, Y, abc) :- once(X == 'true' ; Y == 'true').

but in SICStus Prolog, once seems to be unrecognized. What is the equivalent of once in SICStus? Thank you.

false
  • 10,264
  • 13
  • 101
  • 209
Toma Radu-Petrescu
  • 2,152
  • 2
  • 23
  • 57
  • 5
    Note that SWI is wrong here: The standard requires a syntax error in this case. SWI is the only system that accepts this malformed term. – false Feb 28 '17 at 18:54

1 Answers1

4

The answer is:

test(X, Y, abc) :- once((X == 'true' ; Y == 'true')).

The additional parenthesis did the trick.

false
  • 10,264
  • 13
  • 101
  • 209
Toma Radu-Petrescu
  • 2,152
  • 2
  • 23
  • 57