Hello again, I have been experimenting with the questions raised in my previous mail.
I created a small Gecode space to be able to test the problem in a smaller scale, where I did use two variables (variable1, variable2, both IntVars with the domain {0,5}) and three constraints: variable1 equals variable2, and variable2 cannot have the values 2 and 4. In all of my tests the latter two constraints are described like that: post(space, new BExpr(space.variable1, IRT_NQ, 2)); post(space, new BExpr(space.variable1, IRT_NQ, 4)); For the third constraint I had several tries. When I was using the rel() clause to write the constraint, I got the expected result: Variable #1: {0..1,3,5} Variable #2: {0..1,3,5} But when using a similar construct I would like to use in the static verifier, I got no result for the second variable, it can has all values from it's domain. post(space, new BExpr(space.variable1, IRT_EQ, space.variable2)); Reading about different propagators, I have been able to get the expected result with the use of the ICL_DOM propagator, but only if I was posting the constraint directly, like that: post(space, new Expr(space.variable1), IRT_EQ, new Expr(space.variable2),org.gecode.GecodeEnumConstants.ICL_DOM); But if I tried to translate the a BExprs to that form, I did not succeed: Expr expression = new Expr(new Expr(space.variable2).minus(space.variable1)); post(space, new Expr(expression), IRT_EQ, 0, org.gecode.GecodeEnumConstants.ICL_DOM); Can you tell me a way how to enable this strong ICL_DOM propagators meanwhile using the BExpr form, if it is possible? It would help our project a lot, it would simplify it's code. Thank you for your help, Zoltán Ujhelyi On 2008.08.09., at 18:30, Ujhelyi Zoltan wrote: > Hello all, > > we are currently trying to build a static checker system on top of > Gecode/J 2.1.1. (in an Eclipse environment), and we have found an > interesting case. > > In order to allow us greater flexibility we try to use the Expression > API (it allows us to build constraints in a hierarchical manner). > > I was testing the implementation, and found an interesting final > result: there were to IntVars, which were supposed to be the same, did > not have the same final ranges: one of them had {2,4}, but the other > had {2,3,4}. I tried to trace back the code to look whether the > constraints were wrong or not, and found the following expression > building term: > > BExpr expression = new BExpr(new Expr(variable1),relation, new > Expr(variable2)); > > Tracing the variables variable1 was a new variable, it hadn't been > constrained yet, while variable2's domain had been limited to the > values 2 and 4 (and they were the variables mentioned before in this > letter), while the relation had the value IRT_EQ. > > I tried a post of the expression right after it's construction to see > whether it helps or not: > org.gecode.Gecode.post(space, expression); > > It did not solve the problem, but when I replaced the post method to > the following rel call, the constraint handling was working as I > expected it before. > > rel(space, variable1, IntRelType.IRT_EQ, variable2); > > I would like to know, whether this phenomenon is the intentional > (maybe I do not understand something under the hood), or not. And if > you could tell me a way to avoid it, I would be very glad. > > Thank you very much in advance for your help, > Zoltán Ujhelyi > _______________________________________________ > 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