users-prolog
[Top][All Lists]

## Re: Division in FD solver

 From: Xiao-Hua Kong Subject: Re: Division in FD solver Date: Thu, 9 Sep 2004 11:21:36 -0400 (EDT)

```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.
>
>
> > 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: address@hidden
> > McGill University, Montreal    ----
> > *************************************************************************
> >
> >
> >
> > _______________________________________________
> > Users-prolog mailing list
> > http://lists.gnu.org/mailman/listinfo/users-prolog
> >
>
>
>

```