If I use reification like this, do I have to write my search code so that it instantiates all the booleans as well as all the 'normal' variables? Or can I rely on the fact that once all the 'normal' variables are instantiated all the booleans should also be instantiated.
Malcolm On 06/03/2008, at 4:15 PM, Christian Schulte wrote: > Use reification, that's clumsy but works. So, with minimodeling > support it > should be something like (~ reifies a linear relation, && is > conjunction, > imp is implication, and tt means that the statement must be true): > post(home, tt(imp(~(v1 == 2),~(v2 != 1) && ~(v3 != 3))); > or directly: > BoolVar b1(home,0,1), b2(home,0,1), b3(home,0,1), b23(home,0,1); > rel(home, v1, IRT_EQ, 2, b1); > rel(home, v2, IRT_NQ, 1, b2); > rel(home, v3, IRT_NQ, 3, b3); > rel(home, b2, BOT_AND, b3, b23); > rel(home, b1, BOT_IMP, b23, 1); > > Or check whether extensional constraints work for you. > > Christian > > -- > Christian Schulte, www.ict.kth.se/~cschulte/ > > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On > Behalf > Of Debdeep Banerjee > Sent: Thursday, March 06, 2008 3:03 PM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: [gecode-users] If then type constraints > > Hi, > How do I model if-then style constraints ? What I want to do is post > constraints if a variable is assigned a particular value. For example > say I have variable set V { v1, v2, v3} and each of them has the > domain > {1,2,3}. what I want to achieve is > if v1== 2 then > v2 !=1 /\ v3 !=3 > > I know I can do this using a custom propagator, but is there any > other way ? > > With regards > Debdeep > > -- > Debdeep Banerjee > PhD Candidate > CSL/RSISE/NICTA > Australian National University > Email: [EMAIL PROTECTED] > Web:http://rsise.anu.edu.au/~banerjed > > > > _______________________________________________ > Gecode users mailing list > [EMAIL PROTECTED] > https://www.gecode.org/mailman/listinfo/gecode-users > > > _______________________________________________ > Gecode users mailing list > [EMAIL PROTECTED] > https://www.gecode.org/mailman/listinfo/gecode-users _______________________________________________ Gecode users mailing list [EMAIL PROTECTED] https://www.gecode.org/mailman/listinfo/gecode-users