2017-07-15 2 views

Répondre

1

Parce que == checks term equality, tandis que =\= checks arithmetical inequality. Être comme p est pas un nombre, Prolog traite comme une expression arithmétique, en essayant de trouver sa valeur arithmétique:

1 ?- p == 'p'.
true.

2 ?- p =/= 'p'.
ERROR: Syntax error: Operator expected
ERROR: p
ERROR: ** here **
ERROR: =/= 'p' .

2 ?- p =\= 'p'.
ERROR: =\=/2: Arithmetic: `p/0' is not a function

3 ?-