Re: Backtracking through JPL

Kilián Imre <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Organization Gyűrűfű
Message-ID <[email protected]>
Brother! Thanks for your comments: it looks like the next code...

jplPredicate(ARG....ARGN):- .... and somewhere very deep  clause(HEAD,true) ...

as a result it should generate alternative facts for the same dynamic predicate in a backtracking way

by calling it directly (by hand) it works!

earlier instead of clause/2 I called HEAD directly, and it still worked

at the moment I guess, there might be some tricky bug in the clause/2 implementation, but I have circumvented it by an nth_clause(HEAD,_,REF), clause(HEAD,true,REF) sequence, and now it works again...

thanx once more!

imre

On Fri, 26 Jul 2013 10:53:09 +0200
Kilian Evang <[email protected]> wrote:

> Hi Kilián,
> 
> On 25-07-13 17:02, Kilián Imre wrote:
> > Namely: in a deep calling stack I want to withdraw only facts by
> > clause/2, but not all other inferred facts (not by call/1). If I call
> > it from the toplevel, it works, but if I call it from JPL,
> > hasMoreSolutions succeeds only for the first result...
> 
> can you give a code example of what exactly you're trying to do? E.g.
> paste a minimal example program, your successful toplevel session and
> your unsuccessful Java code...
> 
> Best,
> Kilian
> _______________________________________________
> SWI-Prolog mailing list
> [email protected]
> https://lists.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog


-- 
Kilián Imre <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.