Having a set of formulas and using z3py to create two model old_model = solver.model()
and new_model
. How can a list of variable names be obtain that have different assignments in the two models?
A general solution is needed that consider all free variables in the set of formulas. If possible there are case where a variable is defined by var = Int('varname')
m and used only in a formula ForAll(var, ...)
, that variable var
need not be considered when the models are begin compared.
The idea is to use the comparison during debugging and to see if there exist any unexpected variables that define differences between the models, or the variable should not appear in the model.