Problem in bitwise operation #6706
-
I developed a function called 'at_most_one_bw' which execute the bitwise operation to check whether a list of Bool() variables has at most one variable True.
But when using twise the same function in the same model, it triggers. For example, in the following code the first model is unsat, the second is sat, and the third should be unsat due to the fact the first is unsat and the second sat.
The output is
I can't understand what's the problem. I tried not to use a function to execute the 'at most one bitwise operation' and different experiments such as defining the r-variables outside the function but it doesn't work. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The constraint "at_most_one_bw(l2,'DDD')" simplifies to
The constraint
Simplifies to False. The equivalence between False and And(Not(rDDD0), Not(rDDD1)) Z3 provides a number of facilities that help you debug formulas sent to z3
Example:
|
Beta Was this translation helpful? Give feedback.
The constraint "at_most_one_bw(l2,'DDD')" simplifies to
The constraint
Simplifies to False.
The equivalence between False and And(Not(rDDD0), Not(rDDD1))
is satisfiable by setting rDDDD0 to True
Z3 provides a number of facilities that help you debug formulas sent to z3
Example: