Re: search/6 inside bagof/3?

From: Mark Wallace <mgw_at_icparc.ic.ac.uk>
Date: Fri 01 Nov 2002 05:49:33 PM GMT
Message-ID: <3DC2BEAD.6AD71584@icparc.ic.ac.uk>
Hi Zeynap,

>when I use search/6 inside bagof/3 
>bagof(X,search(X,0,input_order,indomain_min,complete,[backtrack(B)]),Bag)
>I get only one solution

As 'B' only occurs once in bagof, it cannot take different values when 
collecting solutions in the bag (see the documentation of bagof/3).
To get what you want you have to write:
bagof(X,search([X,B],0,input_order,indomain_min,complete,[backtrack(B)]),Bag)

	Cheers
		Mark
-- 
_______________________________________________________________
Dr. Mark Wallace, IC-Parc,		Phone  +44 (0)20 7594 8434 
William Penney Laboratory, 		Fax    +44 (0)20 7594 8432
Imperial College, London SW7 2AZ, UK.	Email: mgw@icparc.ic.ac.uk
Received on Fri Nov 01 17:49:39 2002

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