Re: [eclipse-clp-users] negate constraints

From: Marco Gavanelli <marco.gavanelli_at_...17...>
Date: Wed, 31 Mar 2010 14:44:02 +0200
Hi,

Oliver Shycle wrote:
> Hello,
> 
> well I think the negation axample was not really good to express what i
> want. Let me formulate the problem like this:
> We stick to the variables and their domains as before. I need constraints
> that express the following: "if any variable has a value greater than eight,
> there must be at least one variable with a value smaller than eight."

What about:

> -------------------------------
> example :-
>     OutputModel = [A, B, C, D],
>     A #:: 1..100,
>     B #:: 1..100,
>     C #:: 1..100,
>     D #:: 1..100,
> 
> % constraints

	maxlist(OutputModel,Max),
	minlist(OutputModel,Min),
	Max #>8 => Min #<8,

>     labeling(OutputModel),
>     writeln(OutputModel).

Best,
Marco

-- 
Marco Gavanelli, Ph.D. in Computer Science
Dept of Engineering
University of Ferrara
Tel/Fax  +39-0532-97-4833
http://www.ing.unife.it/docenti/MarcoGavanelli/
Received on Wed Mar 31 2010 - 12:44:20 CEST

This archive was generated by hypermail 2.3.0 : Wed Sep 25 2024 - 15:13:20 CEST