everlonggg
Programmer
The fail predicate seems a bit unpredictable under certain cases to me. Take the following example.
Code:
a(1).
a(2).
b(3).
b(4).
go:- a(X), write(X).
go:- a(X), write(X), b(Y), write(Y).
Query this with ?- go, fail.
The result is 12134234. How does this make sense? Can somebody explain the logic behind that? Thanks.
Code:
a(1).
a(2).
b(3).
b(4).
go:- a(X), write(X).
go:- a(X), write(X), b(Y), write(Y).
Query this with ?- go, fail.
The result is 12134234. How does this make sense? Can somebody explain the logic behind that? Thanks.