[Prev][Next][Index][Thread]
Re: Implementing constraints (CLP)
>From: "Gabor Greif" <gabor@mac.com>
>You might put limited types and singletons to a good use in your project.
I need some help understanding your suggestion ... Along which lines where
you thinking? Something like:
{ 7 <= X <= 10 }, minimize(X)
=>
let X :: limited(<integer>, min: 7, max: 10) = 7;
but then what? Also, I need (eventually) to implement CLP(R) and CLP(FD)
(over types other than numbers, as well) as well as CLP(Q).
Were you suggesting, instead:
let X :: limited(<range>, type: <real>, from: 7, to: 10) = 7;
But I think this runs into trouble with:
{ 7 <= X <= 10, 0 <= Y <= 10, X - 2 * Y = 7.3 }, minimize(X)
=>
let X :: limited(<range>, type: <real>, from: 7, to: 10) = 7;
let Y :: limited(<range>, type: <real>, from: 0, to: 10) = 0;
// ... minimization algorithm
as I think limited(<range>, ...) assumes step = 1 (so the above would not
have a solution as written.
Where you thinking something else? What were your thoughts?
Where do singletons come into the picture?
Sincerely,
Doug Auclair
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp