void SmtEngine::setOption(const std::string& key, const SExpr& value)
throw(BadOptionException, ModalException) {
Debug("smt") << "SMT setOption(" << key << ", " << value << ")" << endl;
- if(d_logic != "") {
- throw ModalException("logic already set; cannot set options");
- }
+
if(key == ":print-success") {
throw BadOptionException();
} else if(key == ":expand-definitions") {
throw BadOptionException();
} else if(key == ":interactive-mode") {
throw BadOptionException();
- } else if(key == ":produce-proofs") {
- throw BadOptionException();
- } else if(key == ":produce-unsat-cores") {
- throw BadOptionException();
- } else if(key == ":produce-models") {
- throw BadOptionException();
- } else if(key == ":produce-assignments") {
- throw BadOptionException();
} else if(key == ":regular-output-channel") {
throw BadOptionException();
} else if(key == ":diagnostic-output-channel") {
} else if(key == ":verbosity") {
throw BadOptionException();
} else {
- throw BadOptionException();
+ // The following options can only be set at the beginning; we throw
+ // a ModalException if someone tries.
+ if(d_logic != "") {
+ throw ModalException("logic already set; cannot set options");
+ }
+
+ if(key == ":produce-proofs") {
+ throw BadOptionException();
+ } else if(key == ":produce-unsat-cores") {
+ throw BadOptionException();
+ } else if(key == ":produce-models") {
+ throw BadOptionException();
+ } else if(key == ":produce-assignments") {
+ throw BadOptionException();
+ } else {
+ throw BadOptionException();
+ }
}
}
// Automatically track all asserted equalities in the shared term manager
d_engine->getSharedTermManager()->addEq(fact);
}
- if(! fact.getAttribute(RegisteredAttr())) {
+
+ if(d_engine->d_theoryRegistration && !fact.getAttribute(RegisteredAttr())) {
list<TNode> toReg;
toReg.push_back(fact);
d_engine->theoryOf(n)->registerTerm(n);
}
}
- }
+ }/* d_engine->d_theoryRegistration && !fact.getAttribute(RegisteredAttr()) */
}
TheoryEngine::TheoryEngine(context::Context* ctxt, const Options& opts) :
d_propEngine(NULL),
d_theoryOut(this, ctxt),
+ d_theoryRegistration(opts.theoryRegistration),
d_hasShutDown(false),
d_incomplete(ctxt, false),
d_statistics() {
theory::Theory* d_arrays;
theory::Theory* d_bv;
+ /**
+ * Whether or not theory registration is on. May not be safe to
+ * turn off with some theories.
+ */
+ bool d_theoryRegistration;
+
/**
* Debugging flag to ensure that shutdown() is called before the
* destructor.
--eager-type-checking type check expressions immediately on creation\n\
--no-type-checking never type check expressions\n\
--no-checking disable ALL semantic checks, including type checks \n\
+ --no-theory-registration disable theory reg (not safe for some theories)\n\
--strict-parsing fail on non-conformant inputs (SMT2 only)\n\
--verbose | -v increase verbosity (repeatable)\n\
--quiet | -q decrease verbosity (repeatable)\n\
SEGV_NOSPIN,
PARSE_ONLY,
NO_CHECKING,
+ NO_THEORY_REGISTRATION,
USE_MMAP,
SHOW_CONFIG,
STRICT_PARSING,
{ "trace" , required_argument, NULL, 't' },
{ "stats" , no_argument , NULL, STATS },
{ "no-checking", no_argument , NULL, NO_CHECKING },
+ { "no-theory-registration", no_argument, NULL, NO_THEORY_REGISTRATION },
{ "show-config", no_argument , NULL, SHOW_CONFIG },
{ "segv-nospin", no_argument , NULL, SEGV_NOSPIN },
{ "help" , no_argument , NULL, 'h' },
parseOnly = true;
break;
+ case NO_THEORY_REGISTRATION:
+ theoryRegistration = false;
+ break;
+
case NO_CHECKING:
semanticChecks = false;
typeChecking = false;
/** Should the parser do semantic checks? */
bool semanticChecks;
+ /** Should the TheoryEngine do theory registration? */
+ bool theoryRegistration;
+
/** Should the parser memory-map file input? */
bool memoryMap;
uf_implementation(MORGAN),
parseOnly(false),
semanticChecks(DO_SEMANTIC_CHECKS_BY_DEFAULT),
+ theoryRegistration(true),
memoryMap(false),
strictParsing(false),
lazyDefinitionExpansion(false),