Skip to content

Problem in bitwise operation #6706

Discussion options

You must be logged in to vote

The constraint "at_most_one_bw(l2,'DDD')" simplifies to

And(Not(rDDD0), Not(rDDD1))

The constraint

simplify(at_most_one_bw(l1,'CCC'))

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

  • You can simplify formulas and print the result of simplification
  • You can print the solver state and inspect it
  • You can get models from satisfiable formulas

Example:


print(simplify(at_most_one_bw(l2,'DDD')))
print(simplify(at_most_one_bw(l1,'CCC')))
print(c.sexpr())

print(a.check())
print(b.check())

set_param(verbose=10)
print(c.check())
print(c.model())

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jacopodabramo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants