Re: Division in FD solver

Xiao-Hua Kong <[email protected]>
Newsgroups gmane.comp.gnu.prolog.general
Message-ID <Pine.GSO.4.05.10409091117190.3735-100000@darmok>
Yes, I can do it. 
The problem is:
1. I am trying to generate constraints (with certain automation) from an
existing model. 
2. I do not know what is the cost of computation by doing that (I have
large L and divider in real problem.

Thanks
Xiaohua

On Thu, 9 Sep 2004, Jorge Marques Pelizzoni wrote:

> I don't do FD in Prolog, but can't you just replace the probalematic expression
> with something like:
> 
>     2*B #>= 116 + L3*(31-6*(L1-1))
> 
> ???
> 
> Cheers,
> 
> Jorge.
> 
> Citando Xiao-Hua Kong <[email protected]>:
> 
> > Hi,
> > 
> > I have a question when I use FD solver.
> > 
> > In following script:
> > 
> > =============================================
> > req1(LD1,LD2):-
> > LD1 = [A, B],
> > LD2 = [L1, L2, L3],
> > fd_domain(LD1,0,120),
> > fd_domain(LD2,1,10),
> > L2 - L1 #= 1,
> > A #=< L2*6,
> > B #>= 58 + L3*(31-6*(L1-1))//2, %Implicitly L1 < 7
> > B #=< A,	
> > fd_labeling(LD2).
> > =============================================
> > 
> > L1 > 6 will not be considered because (31-6*(L1-1)) will be a negative
> > integer when L1 is larger than 6. 
> > There won't be such a problem if I do not use integer division "//". For
> > some reason, I have to use division in my project. 
> > 
> > Does any one know how to avoid this problem? Is there any switch, or other
> > expression I can use?
> > 
> > Thanks
> > Xiaohua
> > 
> > 
> > *************************************************************************
> > Xiaohua Kong                    __ O_     Off. : (514)398-3937
> > Ph.D. Candidate                   // \         
> > Microelectronics And             //                 
> > Computer System Laboratory     O /        Fax  : (514)636-8029
> > Dept. of ECE                   ------     Email: [email protected]    
> > McGill University, Montreal    ----                  
> > *************************************************************************
> > 
> > 
> > 
> > _______________________________________________
> > Users-prolog mailing list
> > [email protected]
> > http://lists.gnu.org/mailman/listinfo/users-prolog
> > 
> 
> 
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.