ic:search/6

From: Cormac J. Gebruers <cjgebruers_at_4c.ucc.ie>
Date: Thu 08 Jan 2004 03:38:29 PM GMT
Message-ID: <Pine.LNX.4.44.0401081449210.3826-100000@4c.ucc.ie>
Hi,

I'm using ic:search/6 to search for solutions in both satisfiable and
unsatisfiable instances. I'm interested in the number of backtracks
required to find a solution or establish there is no solution, as appropriate.

Here is a snippet of code:

...
search(Vars, 0, most_constrained, indomain, complete, [backtrack(B)]),
write(stdout, B),
...

This works fine when there is a solution. When there is no solution
however, search/6 fails, and hence I cannot access 'B' to determine the
number of backtracks it took to establish there is no solution... problem.

So here is a hack:

...
(search(Vars, 0, most_constrained, indomain, complete, [backtrack(B)])
  ; true),
write(stdout, B),
...

except 'B' isn't instantiated...

Suggestions welcome as to what I might do to determine the number of
backtracks when there is no solution?

I need to use search/6 if at all  possible, as I need the different
variable ordering heuristics for the work I'm doing.

Regards
Cormac




---------------------------------------------------------------------
Reminder from mailing list administrator: To avoid spamming, this list
(eclipse-users) automatically accepts contributions from subscribers only.
If you post from an email address under which you are not subscribed,
then I have to approve your posting manually, which may be slow...
--------------------------------------------------------------------
Received on Thu Jan 08 16:21:20 2004

This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:07:26 PM GMT GMT