const Datatype & d = i->getDatatype();
- out << "(" << d.getName() << " ";
+ out << "(" << maybeQuoteSymbol(d.getName()) << " ";
for(Datatype::const_iterator ctor = d.begin(), ctor_end = d.end();
ctor != ctor_end; ++ctor){
if( ctor!=d.begin() ) out << " ";
- out << "(" << ctor->getName();
+ out << "(" << maybeQuoteSymbol(ctor->getName());
for(DatatypeConstructor::const_iterator arg = ctor->begin(), arg_end = ctor->end();
arg != arg_end; ++arg){
unsigned d_realAssertionsEnd;
/** The converter for Boolean terms -> BITVECTOR(1). */
- BooleanTermConverter d_booleanTermConverter;
+ BooleanTermConverter* d_booleanTermConverter;
/** A circuit propagator for non-clausal propositional deduction */
booleans::CircuitPropagator d_propagator;
d_assertionsToPreprocess(),
d_nonClausalLearnedLiterals(),
d_realAssertionsEnd(0),
- d_booleanTermConverter(d_smt),
+ d_booleanTermConverter(NULL),
d_propagator(d_nonClausalLearnedLiterals, true, true),
d_propagatorNeedsFinish(false),
d_assertionsToCheck(),
d_propagator.finish();
d_propagatorNeedsFinish = false;
}
+ if(d_booleanTermConverter != NULL) {
+ delete d_booleanTermConverter;
+ d_booleanTermConverter = NULL;
+ }
d_smt.d_nodeManager->unsubscribeEvents(this);
}
stringstream ss;
ss << Expr::setlanguage(Expr::setlanguage::getLanguage(Dump.getStream()))
<< func;
- Dump("declarations") << DefineFunctionCommand(ss.str(), func, formals, formula);
+ DefineFunctionCommand c(ss.str(), func, formals, formula);
+ addToModelCommandAndDump(c, false, true, "declarations");
}
SmtScope smts(this);
{
Chat() << "rewriting Boolean terms..." << endl;
TimerStat::CodeTimer codeTimer(d_smt.d_stats->d_rewriteBooleanTermsTime);
+ if(d_booleanTermConverter == NULL) {
+ // This needs to be initialized _after_ the whole SMT framework is in place, subscribed
+ // to ExprManager notifications, etc. Otherwise we might miss the "BooleanTerm" datatype
+ // definition, and not dump it properly.
+ d_booleanTermConverter = new BooleanTermConverter(d_smt);
+ }
for(unsigned i = 0, i_end = d_assertionsToPreprocess.size(); i != i_end; ++i) {
- Node n = d_booleanTermConverter.rewriteBooleanTerms(d_assertionsToPreprocess[i]);
+ Node n = d_booleanTermConverter->rewriteBooleanTerms(d_assertionsToPreprocess[i]);
if(n != d_assertionsToPreprocess[i]) {
switch(booleans::BooleanTermConversionMode mode = options::booleanTermConversionMode()) {
case booleans::BOOLEAN_TERM_CONVERT_TO_BITVECTORS: