Re: strange behaviour



Erik Braun wrote:
I do not understand the following behaviour. The first call of "prove" fails
....
>

A smaller example showing the same issue:



?- clause(append(X,Y,Z),B).

No
?- append([],[],[]).

Yes
?- clause(append(X,Y,Z),B).

X = []
Y = _G181
Z = _G181
B = true

What's happening is this: append/3 is in libraray lists. This library is
loaded automatically when append/3 is CALLED, not when it is CLAUSED.
Once it is loaded, clause/2 works on it.
This might seem inconsistent - but it is already a goodie that it is
loaded on calling it.

Cheers

Bart Demoen
.