Hello Marco,
First, thank you very much for you detailed reponse.
> it is usually possible to add disjunctions of constraints in CP
> languages; the syntax may vary from one language to another.
>
> What do you mean by "v1 (> OR <) v2"?
> Do you mean
>
> (v1 > v2) OR (v1 < v2)?
Yes, it is a logical OR. However, my constraints are not arithmetic (>,
<, =, ...). Indeed, I consider spatial relations between objects as
constraints. For example the constraint anteriorTo(x,y) means that the
object x is anterior to the object y.
>
> If this is the case, the best is posting a "not equal" constraint.
> In ECLiPSe syntax,
>
> V1 #\= V2.
For the moment I am using JCL tool. I will look at ECLiPSe, may be it
offers more functionalities.
>
> In general, the simplest way to post disjunctive constraint is by using
> reified constraints. E.g., if you want to state that two activities do
> not overlap, the first starts at time S1, the second at S2, and the
> durations are resp. D1 and D2, you can state
>
> S1+D1 #< S2 #<=> B1,
> S2+D2 #< S1 #<=> B2,
> B1 +B2 #> 1.
>
> The first constraint says that whenever activity 1 precedes activity 2,
> boolean B1 gets value 1. The second says that when activity 2 precedes
> activity 1, B2 is true. The third says that at least one of the two
> booleans should be true.
>
> Usually CP languages have some syntactic sugar for the above
> constraints, like:
>
> S1+D1 #< S2 #\/ S2+D2 #< S1.
>
> that is often implemented with the conjunction of the three constraints
> above (or with some simplification, like S1+D1 #< S2 #<=> B, S2+D2 #<
S1
> #<=> not(B)).
>
> Notice that you typically cannot reify _all_ constraints, but only the
> simplest ones (<, >, =, \=, >=, ...). Check in your manual "reifiable
> constraints".
>
> This solution is not always the fastest one. There is wide literature
> about this topic. See, e.g., constructive disjunction, Propia, ...
It will be very good if I can do what you said above, with symbolic
constraints (spatial constraints). May be, I have to implement this type
of constraints, and it will work.
Thanks again Marc.
Cheers.
Ammar.


|