0

When I want to get the values of all variables in an SMT2 instance, I use the command (set-option :auto-config false). In Z3py, setting this option doesn't work - the model doesn't display variables that I define but do not use in any constraints. If I ask for the values of these variables, I get None. I have tried these options but none of them produce the result that I want:

set_option('model_evaluator.completion', True)
set_option('smt.auto-config', False)
set_option('auto-config', False)

What should I do to get concrete values for these variables?

mtrberzi
  • 215
  • 2
  • 10
z3_test
  • 19
  • 6

1 Answers1

0

The auto-config option does not tell Z3 to print or omit parts of models; it just enables or disables automatic configuration of the solver (based on static formula features).

When a variable is not assigned a value in a model, it is simply irrelevant, i.e., you can make up any value for it, and it will still be a correct model. Depending on which solvers/tactics you use, the option model_evaluator.completion may solve that problem, but the safest way is to enable model completion at the time of model evaluation, i.e., use the eval(..) function with model_completion=True

Christoph Wintersteiger
  • 8,234
  • 1
  • 16
  • 30