Fix usability issue with tear-down incremental mode.
authorMorgan Deters <mdeters@cs.nyu.edu>
Wed, 4 Jun 2014 19:22:38 +0000 (15:22 -0400)
committerMorgan Deters <mdeters@cs.nyu.edu>
Wed, 4 Jun 2014 19:22:38 +0000 (15:22 -0400)
src/main/driver_unified.cpp

index 8117dbc05347cade47c74b998345e40faac3f10e..60b99132daa182872a5417cdd7eb57245d0a4a75 100644 (file)
@@ -238,8 +238,14 @@ int runCvc4(int argc, char* argv[], Options& opts) {
     Command* cmd;
     bool status = true;
     if(opts[options::interactive] && inputFromStdin) {
-      if( opts[options::tearDownIncremental] ) {
-        throw OptionException("--tear-down-incremental incompatible with --interactive");
+      if(opts[options::tearDownIncremental] && opts[options::incrementalSolving]) {
+        if(opts.wasSetByUser(options::incrementalSolving)) {
+          throw OptionException("--tear-down-incremental incompatible with --interactive");
+        }
+
+        cmd = new SetOptionCommand("incremental", false);
+        pExecutor->doCommand(cmd);
+        delete cmd;
       }
 #ifndef PORTFOLIO_BUILD
       if(!opts.wasSetByUser(options::incrementalSolving)) {
@@ -272,7 +278,13 @@ int runCvc4(int argc, char* argv[], Options& opts) {
       }
     } else if(opts[options::tearDownIncremental]) {
       if(opts[options::incrementalSolving]) {
-        throw OptionException("--tear-down-incremental incompatible with --incremental");
+        if(opts.wasSetByUser(options::incrementalSolving)) {
+          throw OptionException("--tear-down-incremental incompatible with --interactive");
+        }
+
+        cmd = new SetOptionCommand("incremental", false);
+        pExecutor->doCommand(cmd);
+        delete cmd;
       }
 
       ParserBuilder parserBuilder(exprMgr, filename, opts);