bug-prolog
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: failure to post arithmetic constraint


From: Daniel Diaz
Subject: Re: failure to post arithmetic constraint
Date: Tue, 05 Feb 2002 19:28:19 +0100

Hi Bowie,

you have to define the (relative small) domains of your variables before 
settings constraints. In
particular non-linear constraints. In A*X #= Y the max of Y is max(X) * max(A) 
which leads to an
overflow on our integers. Recall that FD are for (small) finite domains... :-))

Bowie Owens wrote:
> 
> Hi,
> 
> I am having difficulty posting some simple arithmetic constraints in
> GNU Prolog 1.2.8 (and 1.2.9) under x86 Linux. The problems come from
> the multiplication of otherwise unconstrained variables. There does seem
> to be some interaction with the vector representation of variables. As
> using full AC equality forces use of the vector representation when I
> would not expect it to do so.
> 
> | ?- A * X  #= Y.
> 
> no
> | ?-  A+X #=< 127, A * X  #= Y.
> 
> A = _#22(0..127)
> X = _#41(0..127)
> Y = _#86(0..16129)
> 
> yes
> | ?- A+X #>= 127, A * X  #= Y.
> 
> no
> | ?- A * X  #=# Y.
> 
> A = _#3(0..268435455)
> X = _#22(0..268435455)
> Y = _#41(0..127@)
> 
> yes
> | ?- A+X #>= 127, A * X  #=# Y.
> 
> A = _#22(0..268435455)
> X = _#41(0..268435455)
> Y = _#86(0..127@)
> 
> yes
> | ?- A+X #=< 127, A * X  #=# Y.
> 
> A = _#22(0..127)
> X = _#41(0..127)
> Y = _#86(0..127)
> 
> yes
> 
> -- Bowie Owens
> 
> CSIRO Mathematical & Information Sciences
> phone : +61 3 9545 8055
> email : address@hidden
> 
> _______________________________________________
> Bug-prolog mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-prolog

-- 
Daniel Diaz   address@hidden
http://pauillac.inria.fr/~diaz
gprolog --version 2>&1 | sed -n -e 's/By //p'



reply via email to

[Prev in Thread] Current Thread [Next in Thread]