diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2021-06-10 16:53:38 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-10 21:53:38 +0000 |
commit | 5fb5d6030aa031d5f63676ec29ffa8e158fa5c6a (patch) | |
tree | 5d03b8923d08bcdf9c84151c7fab1a4ee4e52fba /src/smt/set_defaults.cpp | |
parent | 6394bf6ffa2486587d1726271769117f7dc227a8 (diff) |
Ensure bv2nat and int2bv are not rewritten when using solve-bv-as-int (#6725)
This PR ensures we do not eagerly rewrite bv2nat and int2bv when using solve-bv-as-int. Instead they are rewritten during expandDefinitions (at the end of preprocessing).
It also updates regressions that relied on lazy extended function reductions in the lazy solver to use solve-bv-as-int, and adds a missing case (INT_TO_BITVECTOR) in the solve-int-as-bv preprocessing pass.
A followup PR will remove support for lazy extended function reductions for bv2nat / int2bv altogether.
Diffstat (limited to 'src/smt/set_defaults.cpp')
-rw-r--r-- | src/smt/set_defaults.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/smt/set_defaults.cpp b/src/smt/set_defaults.cpp index b9095c91b..31d14c569 100644 --- a/src/smt/set_defaults.cpp +++ b/src/smt/set_defaults.cpp @@ -163,15 +163,6 @@ void setDefaults(LogicInfo& logic, bool isInternalSubsolver) } } - /* Only BVSolver::LAZY natively supports int2bv and nat2bv, for other solvers - * we need to eagerly eliminate the operators. */ - if (options::bvSolver() == options::BVSolver::SIMPLE - || options::bvSolver() == options::BVSolver::BITBLAST) - { - opts.bv.bvLazyReduceExtf = false; - opts.bv.bvLazyRewriteExtf = false; - } - /* Disable bit-level propagation by default for the BITBLAST solver. */ if (options::bvSolver() == options::BVSolver::BITBLAST) { @@ -198,6 +189,8 @@ void setDefaults(LogicInfo& logic, bool isInternalSubsolver) if (options::solveBVAsInt() != options::SolveBVAsIntMode::OFF) { + // do not rewrite bv2nat eagerly + opts.bv.bvLazyRewriteExtf = true; if (options::boolToBitvector() != options::BoolToBVMode::OFF) { throw OptionException( @@ -222,6 +215,14 @@ void setDefaults(LogicInfo& logic, bool isInternalSubsolver) logic.lock(); } } + else if (options::bvSolver() == options::BVSolver::SIMPLE + || options::bvSolver() == options::BVSolver::BITBLAST) + { + // Only BVSolver::LAZY natively supports int2bv and nat2bv, for other + // solvers we need to eagerly eliminate the operators. Note this is only + // applied if we are not eliminating BV (e.g. with solveBVAsInt). + opts.bv.bvLazyReduceExtf = false; + } // set options about ackermannization if (options::ackermann() && options::produceModels() |