This implements solution number 2 for issue #2613.
d_options->d_beforeSearchListeners.notify();
} catch (ModalException&){
std::stringstream ss;
- ss << "cannot change option `" << option
- << "' after final initialization (i.e., after logic has been set)";
+ ss << "cannot change option `" << option << "' after final initialization";
throw ModalException(ss.str());
}
}
d_proofManager = new ProofManager(d_userContext);
#endif
+ d_definedFunctions = new (true) DefinedFunctionMap(d_userContext);
+ d_fmfRecFunctionsDefined = new (true) NodeList(d_userContext);
+ d_modelCommands = new (true) smt::CommandList(d_userContext);
+}
+
+void SmtEngine::finishInit()
+{
+ Trace("smt-debug") << "SmtEngine::finishInit" << std::endl;
// We have mutual dependency here, so we add the prop engine to the theory
// engine later (it is non-essential there)
d_theoryEngine = new TheoryEngine(d_context,
d_userContext->push();
d_context->push();
- d_definedFunctions = new(true) DefinedFunctionMap(d_userContext);
- d_fmfRecFunctionsDefined = new(true) NodeList(d_userContext);
- d_modelCommands = new(true) smt::CommandList(d_userContext);
-}
-
-void SmtEngine::finishInit() {
- Trace("smt-debug") << "SmtEngine::finishInit" << std::endl;
// ensure that our heuristics are properly set up
setDefaults();
void SmtEngine::printInstantiations( std::ostream& out ) {
SmtScope smts(this);
+ finalOptionsAreSet();
if( options::instFormatMode()==INST_FORMAT_MODE_SZS ){
out << "% SZS output start Proof for " << d_filename.c_str() << std::endl;
}
void SmtEngine::printSynthSolution( std::ostream& out ) {
SmtScope smts(this);
+ finalOptionsAreSet();
if( d_theoryEngine ){
d_theoryEngine->printSynthSolution( out );
}else{
void SmtEngine::getSynthSolutions(std::map<Expr, Expr>& sol_map)
{
SmtScope smts(this);
+ finalOptionsAreSet();
map<Node, Node> sol_mapn;
Assert(d_theoryEngine != nullptr);
d_theoryEngine->getSynthSolutions(sol_mapn);
Expr SmtEngine::doQuantifierElimination(const Expr& e, bool doFull, bool strict)
{
SmtScope smts(this);
+ finalOptionsAreSet();
if(!d_logic.isPure(THEORY_ARITH) && strict){
Warning() << "Unexpected logic for quantifier elimination " << d_logic << endl;
}
const std::string& str_value)
{
SmtScope smts(this);
+ finalOptionsAreSet();
std::vector<Node> node_values;
for( unsigned i=0; i<expr_values.size(); i++ ){
node_values.push_back( expr_values[i].getNode() );
d_nodeManager = NodeManager::fromExprManager(d_exprManager);
d_scope = new SmtScope(d_smt);
+ // Notice that this unit test uses the theory engine of a created SMT
+ // engine d_smt. We must ensure that d_smt is properly initialized via
+ // the following call, which constructs its underlying theory engine.
+ d_smt->finalOptionsAreSet();
d_theoryEngine = d_smt->d_theoryEngine;
d_satSolver = new FakeSatSolver();
d_outputChannel.clear();
d_logicInfo.lock();
+ // Notice that this unit test uses the theory engine of a created SMT
+ // engine d_smt. We must ensure that d_smt is properly initialized via
+ // the following call, which constructs its underlying theory engine.
+ d_smt->finalOptionsAreSet();
+
// guard against duplicate statistics assertion errors
delete d_smt->d_theoryEngine->d_theoryTable[THEORY_ARITH];
delete d_smt->d_theoryEngine->d_theoryOut[THEORY_ARITH];
void testBitblasterCore() {
d_smt->setOption("bitblast", SExpr("eager"));
d_smt->setOption("incremental", SExpr("false"));
+ // Notice that this unit test uses the theory engine of a created SMT
+ // engine d_smt. We must ensure that d_smt is properly initialized via
+ // the following call, which constructs its underlying theory engine.
+ d_smt->finalOptionsAreSet();
EagerBitblaster* bb = new EagerBitblaster(
dynamic_cast<TheoryBV*>(
d_smt->d_theoryEngine->d_theoryTable[THEORY_BV]),
d_nullChannel = new FakeOutputChannel();
+ // Notice that this unit test uses the theory engine of a created SMT
+ // engine d_smt. We must ensure that d_smt is properly initialized via
+ // the following call, which constructs its underlying theory engine.
+ d_smt->finalOptionsAreSet();
d_theoryEngine = d_smt->d_theoryEngine;
for(TheoryId id = THEORY_FIRST; id != THEORY_LAST; ++id) {
delete d_theoryEngine->d_theoryOut[id];
d_logicInfo = new LogicInfo();
d_logicInfo->lock();
+ // Notice that this unit test uses the theory engine of a created SMT
+ // engine d_smt. We must ensure that d_smt is properly initialized via
+ // the following call, which constructs its underlying theory engine.
+ d_smt->finalOptionsAreSet();
// guard against duplicate statistics assertion errors
delete d_smt->d_theoryEngine->d_theoryTable[THEORY_BUILTIN];
delete d_smt->d_theoryEngine->d_theoryOut[THEORY_BUILTIN];