Re: [eclipse-users] Changes on indomain/1 ?

From: Joachim Schimpf <js10_at_...2...>
Date: Wed, 14 Mar 2007 18:36:01 +0000
Besnik Seljimi wrote:
> Hi,
> 
> Can somebody explain me why the call to ic:indomain(?X) fails on large 
> intervals !
> 
> [eclipse 10]: lib(ic), X #:: -2147483648..2147483647, ic:indomain(X).
> out of range in indomain(X{-2147483648 .. 2147483647})
> Abort
> 
> While the following succeeds !
> 
> [eclipse 11]: lib(ic), X #:: -2147483648..2147483647, ic:indomain(X,min).
> X = -2147483648
> Yes (0.00s cpu, solution 1, maybe more) ?
> 
> In the documentation of indomain(?Var, ++Method) it is stated:
> min : This behaves like the built-in indomain/1, except that it removes 
> previously tested values on backtracking.
> 
> Actually, it succeeded on ECLiPSe 5.8 and it fails on ECLiPSe 5.10!


I can't find any difference in behaviour between 5.8 and 5.10,
in both versions indomain/1 makes an error and indomain/2 works.

The reason is that indomain/1 is implemented in C and only
supports the (32/64 bit) integer range, while indomain/2 is
written in Eclipse and essentially implemented as

indomain_min(X) :-
	get_min(X, Min),
	(
		X = Min
	;
		X #> Min,
		indomain_min(X)
	).

We could make indomain/1 work as well, but in any case, enumerating
such large domains value-by-value isn't going to make too much
sense anyway...


-- Joachim
Received on Wed Mar 14 2007 - 18:36:45 CET

This archive was generated by hypermail 2.3.0 : Tue Apr 16 2024 - 09:13:19 CEST