From 00ccc01140bcdeaadedf8ae1b9f224ccdc812bc0 Mon Sep 17 00:00:00 2001 From: Ying Sheng Date: Tue, 8 Oct 2019 08:18:21 -0700 Subject: Make ackermannization generally applicable rather than just BV (#3315) The ackermannization process is currently already support general theories rather than specifically for BV. In this pull request, an option has been added to turn on ackermannization independently. --- src/smt/smt_engine.cpp | 51 +++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 44 insertions(+), 7 deletions(-) (limited to 'src/smt/smt_engine.cpp') diff --git a/src/smt/smt_engine.cpp b/src/smt/smt_engine.cpp index 918539f4f..8705bfb9b 100644 --- a/src/smt/smt_engine.cpp +++ b/src/smt/smt_engine.cpp @@ -1185,6 +1185,10 @@ void SmtEngine::setDefaults() { << "generation" << endl; setOption("bitblastMode", SExpr("lazy")); } + else if (!options::incrementalSolving()) + { + options::ackermann.set(true); + } if (options::incrementalSolving() && !d_logic.isPure(THEORY_BV)) { @@ -1208,11 +1212,45 @@ void SmtEngine::setDefaults() { { d_logic = LogicInfo("QF_NIA"); } - else if ((d_logic.getLogicString() == "QF_UFBV" - || d_logic.getLogicString() == "QF_ABV") - && options::bitblastMode() == theory::bv::BITBLAST_MODE_EAGER) + + // set options about ackermannization + if (options::produceModels()) { - d_logic = LogicInfo("QF_BV"); + if (options::ackermann() + && (d_logic.isTheoryEnabled(THEORY_ARRAYS) + || d_logic.isTheoryEnabled(THEORY_UF))) + { + if (options::produceModels.wasSetByUser()) + { + throw OptionException(std::string( + "Ackermannization currently does not support model generation.")); + } + Notice() << "SmtEngine: turn off ackermannization to support model" + << "generation" << endl; + options::ackermann.set(false); + } + } + + if (options::ackermann()) + { + if (options::incrementalSolving()) + { + throw OptionException( + "Incremental Ackermannization is currently not supported."); + } + + if (d_logic.isTheoryEnabled(THEORY_UF)) + { + d_logic = d_logic.getUnlockedCopy(); + d_logic.disableTheory(THEORY_UF); + d_logic.lock(); + } + if (d_logic.isTheoryEnabled(THEORY_ARRAYS)) + { + d_logic = d_logic.getUnlockedCopy(); + d_logic.disableTheory(THEORY_ARRAYS); + d_logic.lock(); + } } // set default options associated with strings-exp @@ -3241,10 +3279,9 @@ void SmtEnginePrivate::processAssertions() { "Try --bv-div-zero-const to interpret division by zero as a constant."); } - if (options::bitblastMode() == theory::bv::BITBLAST_MODE_EAGER - && !options::incrementalSolving()) + if (options::ackermann()) { - d_passes["bv-ackermann"]->apply(&d_assertions); + d_passes["ackermann"]->apply(&d_assertions); } if (options::bvAbstraction() && !options::incrementalSolving()) -- cgit v1.2.3