Is it possible to add a way to set the solver logic from within JavaSMT similar to Smtlib's (set-logic <LOGIC>) command?
This is particularly interesting in the context of incremental solving, because no matter how smart the SMT solver is, with the default ALL logic, he has to assume that subsequent queries introduce new logics.
This can easily be demonstrated with Z3 and verbose=5 on smtlib2 QF_BV queries (outside JavaSMT):
- on non-incremental queries, Z3 bit-blasts and uses its SAT solver even with
(set-logic ALL)
- on incremental queries, Z3 runs its general-purpose SMT core with
(set-logic ALL), even if the whole file only uses bit vectors. When changing the logic to (set-logic QF_BV), Z3 bit-blasts again.
In the context for program verification, we often do incremental queries (via JavaSMT) that only make use of QF_BV. We have observed that if we dump the generated queries to smtlib2 and simply change the logic from ALL to QF_BV, the solver performance can increase by 50-100%. Granted, there are also cases where changing the logic makes the solver slower, but it is hard to evaluate the exact impact if we have to dump and modify the encoding and then invoke the solver externally.
Is it possible to add a way to set the solver logic from within JavaSMT similar to Smtlib's
(set-logic <LOGIC>)command?This is particularly interesting in the context of incremental solving, because no matter how smart the SMT solver is, with the default
ALLlogic, he has to assume that subsequent queries introduce new logics.This can easily be demonstrated with Z3 and
verbose=5on smtlib2 QF_BV queries (outside JavaSMT):(set-logic ALL)(set-logic ALL), even if the whole file only uses bit vectors. When changing the logic to(set-logic QF_BV), Z3 bit-blasts again.In the context for program verification, we often do incremental queries (via JavaSMT) that only make use of
QF_BV. We have observed that if we dump the generated queries to smtlib2 and simply change the logic fromALLtoQF_BV, the solver performance can increase by 50-100%. Granted, there are also cases where changing the logic makes the solver slower, but it is hard to evaluate the exact impact if we have to dump and modify the encoding and then invoke the solver externally.