Re: [eclipse-clp-users] Question on search/6

From: Joachim Schimpf <jschimpf_at_users.sf.net>
Date: Wed, 02 Sep 2009 18:01:36 +1000
Daniel Riera wrote:
> Hello,
> 
> An eay-fast question:
> 
> Is there any possibility to use "search/6" with the "backtrack(-N)"
> option in order to get the number of backtracks
> performed during the search not only when it is successful but also
> when the search fails? (When it fails, the variable
> N stays nonground).
> 
> I know I can do it by programming my own labelling, but don't know if
> it is possible with the search/6 predicate.

No, there is currently no provision for this, but there is a hack:
Call getval(backtrack,B)@ic_search (or @fd_search if you use fd)
after search/6 has failed.

As a cleaner solution, I'm thinking of adding an option to search/6
that makes it always succeed, and instead returns a true/false
result flag.  Then you can look at the statistics before failing.


-- Joachim
Received on Wed Sep 02 2009 - 09:02:09 CEST

This archive was generated by hypermail 2.2.0 : Thu Feb 02 2012 - 02:31:58 CET