Arithmetic expression in swi-prolog
I have the following prolog program:
set_1(2).
p(X) :- set_1(X+1).
I'm using SWI-Prolog version 5.10.4 for i386 to run the query p(1) on this
program.
The answer is 'false'.
I expect the answer to be 'true', because set_1(X+1) should be grounded as
set_1(2) and resolved with the first fact.
Why the answer is false and how get 'true' ?
No comments:
Post a Comment