I am trying to learn Prolog for an exam.
According to my slides arithmetic expressions do not unify with constants. Is there a reason for?
for example
even(0).
even(X) :- X>0, odd(X-1).
odd(1).
odd(X) :- X>1, even(X-1).
?-even(2).
=> false.
The 0
doesn't unify with (X-1)
.
So my Question is: Would it be a problem in some case if there was unification between constants and arithmetic expressions?