How to generate multiple models for bit vector formula using z3 solver in smt2 format?
While implementing IDEA Code for Bit Vector it is generating one model.
Ho
The usual approach is to add a new constraint that excludes the first model. In this example, this would look like so:
(check-sat)
(assert (and (not (= k16 #x2c7d)) (not (= ... ))
(check-sat)
There is no SMT2 command to get all solutions or the number of solutions. If something depends on the fact that some property holds for all solutions, we can encode that using quantifiers, e.g.
(assert (forall ((x (_ BitVec 16))) (... property depending on x ...)))
However, those types of problems are of course harder to solve and Z3 will use different decision procedures under the hood.