[gecode-users] BoolExpr example

Christian Schulte cschulte at kth.se
Fri Nov 21 17:36:07 CET 2008


Well, Denys, remember this is C++... The reasoning that something should be
not necessary does not mean that you should do it. Constructing C++ programs
by reasoning leads to programs that will not compile (if you are lucky that
is, it might also miscompile).

But in this case this is a real deliberate decision to make reification
explicit. Without that the composition of reified linear expressions over
Boolean variables and Boolean expressions becomes slightly non-intuitive.
Then, the decision was: make reification explicit and overload post. 

I still like it!

Cheers
Christian

-----Original Message-----
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Denys Duchier
Sent: Friday, November 21, 2008 4:19 PM
To: users at gecode.org
Subject: Re: [gecode-users] BoolExpr example

"Christian Schulte" <cschulte at kth.se> writes:

>> 2) Could you explain in more detail what ~ does?
>
> The ~-operator takes a linear relation and reifies it (makes it a
BoolExpr).
>
>> 3) Likewise, what does tt() do?
>
> It enforces that a Boolean expression should be true. There is an
> corresponding function ff for enforcing it to be false.
>
>> 4) Under exactly what conditions does post() create a BoolVar?
>
> When the expression posted is a BoolExpr and not a BoolRel.

I have the nagging feeling that using "post" both for expressions and
for relations maybe a source of unnecessary complexity.  Explicit
reification of a linear relation should typically not be required (it
can be deduced from the context of use).

Am I wrong in thinking that if we had "post" for relations and "epost"
for expressions, some of the current complexity could be made to go
away?

Cheers,

--Denys

_______________________________________________
Gecode users mailing list
users at gecode.org
https://www.gecode.org/mailman/listinfo/gecode-users





More information about the gecode-users mailing list