better handling for conflicting options with nonlinear arith (bug 646)
authorKshitij Bansal <kshitij@cs.nyu.edu>
Fri, 21 Aug 2015 07:26:30 +0000 (03:26 -0400)
committerKshitij Bansal <kshitij@cs.nyu.edu>
Fri, 21 Aug 2015 07:26:30 +0000 (03:26 -0400)
src/smt/smt_engine.cpp

index 192485dccc16b96388f29c000b76c0e3fa7f748e..66487e4a48513d4e1204a6216405063c1f501cc6 100644 (file)
@@ -1544,14 +1544,23 @@ void SmtEngine::setDefaults() {
   if (d_logic.isTheoryEnabled(THEORY_ARITH) &&
       !d_logic.isLinear()) {
     if (options::produceModels()) {
+      if(options::produceModels.wasSetByUser()) {
+        throw OptionException("produce-model not supported with nonlinear arith");
+      }
       Warning() << "SmtEngine: turning off produce-models because unsupported for nonlinear arith" << endl;
       setOption("produce-models", SExpr("false"));
     }
     if (options::produceAssignments()) {
+      if(options::produceAssignments.wasSetByUser()) {
+        throw OptionException("produce-assignments not supported with nonlinear arith");
+      }
       Warning() << "SmtEngine: turning off produce-assignments because unsupported for nonlinear arith" << endl;
       setOption("produce-assignments", SExpr("false"));
     }
     if (options::checkModels()) {
+      if(options::checkModels.wasSetByUser()) {
+        throw OptionException("check-models not supported with nonlinear arith");
+      }
       Warning() << "SmtEngine: turning off check-models because unsupported for nonlinear arith" << endl;
       setOption("check-models", SExpr("false"));
     }