I am interested in testing the “practical” impact of the decision/instantiation procedure (its implementation inclusive) discussed in [1].
I need:
1) A “tool” that take an SMT benchmark and returns a (possibly complete) instantiated version of it, applying the strategy. If this is not possible,
2) The Z3 version implementing this strategy and an option for switching it on and off.
Can you help me on that?
[1] Complete Instantiation for Quantified Formulas in Satisfiabiliby Modulo Theories
As far as I know, there is no tool that will return the instantiated version of an SMT benchmark.
Z3 instantiates the quantifiers on-demand using Model-Based Quantifier Instantiation (MBQI) described on Section 6 of [1]. The actual loop in the latest Z3 is more complicated that the one described on this section.
Here are some notes on how to enable/disable the MBQI module.
With these options you can check the effect of MBQI and E-Matching in different problems. Note that, if we use only E-matching, then Z3 will return
unknownfor any satisfiable problem that contains quantifiers.The MBQI module is implemented in the files
src/smt/smt_model_finder.cppandsrc/smt/smt_model_checker.cpp. The filesrc/smt/smt_model_finder.cppis essentially converting a model produced for the quantifier-free formulas in a model that may potentially satisfy the universally quantified formulas. Note that the classauf_solveris the one that actually “solves” the set constraints and “builds” the projection functions described in [1].If we want to trace the actual instances generated by the MBQI module, we can modify the method
void model_checker::assert_new_instances()atsrc/smt/smt_model_checker.cpp. Note that these method already has some tracing commands sending data totout(trace output). We can replacetoutwithstd::coutto get the information on the standard output.For example, if we add the following piece of code, then whenever a universal quantifier
qis instantiated (by the MBQI module) with some bindings, Z3 will display the information in the standard output: