Re: strange behaviour
- From: russell kym horsell <kym@xxxxxxxxxxxxxxxxxxx>
- Date: Tue, 21 Mar 2006 03:27:55 +0000 (UTC)
Erik Braun <qs206710n5sqn8r56s6pr3s980940ss3@xxxxxxxxxxxxxxxxx> wrote:
} I do not understand the following behaviour. The first call of "prove" fails
} until the command to be proven is called for itself. Then "prove" is
} successful.
} I have no idea if this is intended behaviour and if is so, why the results
} happen. I use the SWI-Prolog, which is shipped with SuSE Linux 10.0.
} $ cat meta.pl
} prove(true).
} prove((A,B)) :- prove(A), prove(B).
} prove(A) :- clause(A,B), prove(B).
} $ pl -s meta.pl
} % meta.pl compiled 0.00 sec, 672 bytes
} Welcome to SWI-Prolog (Multi-threaded, Version 5.5.27)
} [...]
} ?- trace,prove(append([],[],[])).
} Call: (8) prove(append([], [], [])) ? creep
} ^ Call: (9) clause(append([], [], []), _L198) ? creep
} ^ Fail: (9) clause(append([], [], []), _L198) ? creep
[...]
Right. Append has no clauses -- it's normally a builtin. You'll have
to provide for builtins in your meta-interp or define an appropriate
append with clause(s:).
.
- Follow-Ups:
- Re: strange behaviour
- From: Bart Demoen
- Re: strange behaviour
- Prev by Date: Re: strange behaviour
- Next by Date: Count the atoms
- Previous by thread: Re: strange behaviour
- Next by thread: Re: strange behaviour
- Index(es):
Relevant Pages
|
|