Re: strange behaviour
- From: Bart Demoen <bmd@xxxxxxxxxxxxxx>
- Date: Mon, 20 Mar 2006 20:44:52 +0100
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
.
- Prev by Date: Re: (Interfacing Prolog) pointer issue (SWI)
- Next by Date: Re: strange behaviour
- Previous by thread: Prolog AI for Game of Go
- Next by thread: Re: strange behaviour
- Index(es):