I am just learning prolog and there is a thing I can't get my head over.
Suppose I have the following program
value(v).
a(X) :- not(value(X)).
So a(v).
gives me false, as value(v)
can be proved correct.
a(w)
gives me true, as there is no fact value(w)
, therefore, even when trying, it can't be proved correct.
In my understanding, requesting a(X).
should give me the first possible value that makes value(X)
unproveable. There should be an infinite amount of possibilities, as only value(v)
is correct.
But why does Prolog keep answering false
?
\+
operator works with negation as failure semantics, which was what I tried to describe above. Hope that gives some clues. – Limmen