Re: Domain splitting within search/6

From: Joachim Schimpf <j.schimpf_at_icparc.ic.ac.uk>
Date: Fri 06 May 2005 02:26:36 PM GMT
Message-ID: <427B7E9C.2030304@icparc.ic.ac.uk>
BRAND Sebastian wrote:
> Hi,
> 
> I'd like to use the search/6 functionality with my own
> heuristics.  The difficulty is that the user-supplied
> my_choice/1 is apparently expected to instantiate the
> variable, while I'd like to do domain splitting.  A simple
> example would be
> 
> my_choice(X) :-
> 	dom(X, Dom),
> 	lists:halve(Dom, Dom1, Dom2),
> 	(
> 		X :: Dom1
> 	;
> 		X :: Dom2
> 	).
> 
> I might want to branch like this on X and select *another*
> variable to branch on thereafter.

The indomain_split method does domain splitting, but keeps
splitting the same variable until it becomes ground. It
seems to be indeed a design choice of this library that a
variable is expected to be ground after value selection.


> 
> It seems that the built-in "indomain_interval" method does
> do domain splitting ("..branch on the choice of the interval..").

This is similar to indomain_split, expect that it doesn't split in
the middle, but uses subintervals that the domain has anyway (i.e.
it starts splitting at holes in the domain)


> 
> Can I do domain splitting but still use the advanced search
> facilities of search/6 like bbs, lds, etc.?

Note that you have the sources (ic_search.ecl & generic_search.ecl,
if you have unpacked the eclipse_source package, you should have
them in the <eclipsedir>/lib directory).

To modify the library, copy ic_search.ecl and generic_search.ecl
into your working directory, replace the use_module() directives
in ic_search.ecl with lib() directives, make the modification you
want, and load the modified library using use_module(ic_search).


-- 
  Joachim Schimpf              /             phone: +44 20 7594 8187
  IC-Parc                     /      mailto:J.Schimpf@imperial.ac.uk
  Imperial College London    /    http://www.icparc.ic.ac.uk/eclipse
Received on Fri May 06 15:29:29 2005

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