[gecode-users] posting constraints for assigned variable

Debdeep Banerjee banerjed at rsise.anu.edu.au
Sun Apr 20 07:18:01 CEST 2008


hi,
 I have some questions about reducing domain of a variable. Say I have a 
IntVar x and its domain is IntSet {1,2,5,6,-2}
q1. if I want say x != 2 then I use the following code
       IntView v(x)
       Gecode.me_failed( v.nq( home, 2 ) ) ==> this should return true/1
     Is this correct ?

q2. Say x is already assigned to 5, ie
    IntView v(x) and v.assigned() == true.
      What will happen if I try to do the following
    Gecode.me_failed( v.nq( home, 2 ) ) == > what should this code 
return 0 or 1 ??

q3. Say I want to say x != 9 ( 9 is not in the domain of x)
       IntView v(x)
       Gecode.me_failed( v.nq( home, 9 ) ==> what this will return ???
    Does this depends on whether x is already assigned or not ??

With regards
Debdeep

-- 
Debdeep Banerjee
PhD Candidate
CSL/RSISE/NICTA
Australian National University
Email: debdeep.banerjee at rsise.anu.edu.au
Web:http://rsise.anu.edu.au/~banerjed






More information about the gecode-users mailing list