Re: Re:search/6 inside bagof/3?

From: Marco Gavanelli <>
Date: Mon 04 Nov 2002 12:03:28 PM GMT
Message-Id: <>
At 12.17 04/11/02, wrote:
>Dear Mark,
>Thank you for the help.
> > To get what you want you have to write:
> > 
> bagof([X,B],search(X,0,input_order,indomain_min,complete,[backtrack(B)]),Bag)
>I tried this, but somehow B is not instantiated to any value, so I cannot see
>the number of failures when I have "write(B)" after bagof?

In the solution by Mark, the number of backtracks is not in B, but in Bag.
Bag is a list of two-element lists. The second of the two-element list is a 
number, which represents the number of backtracks necessary to get to that 
solution. If you want the total number, just consider the last one.



Marco Gavanelli, Ph.D.
Computer Science Division
DIF - Dipartimento di Ingegneria
University of Ferrara
Via Saragat 1 - 44100 Ferrara (Italy)
Fax  +39-0532-768602
Cell +39-329-4280354
Received on Mon Nov 04 12:03:11 2002

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