Deleting the intermediate command singleton.
authorTim King <taking@google.com>
Mon, 26 Sep 2016 01:10:23 +0000 (18:10 -0700)
committerTim King <taking@google.com>
Mon, 26 Sep 2016 01:17:03 +0000 (18:17 -0700)
src/main/command_executor.cpp

index 320be701de4d3f8d18f830b7ae079d3fa87bcca3..f9055f56cd131733578be1aa86620568ae656089 100644 (file)
@@ -129,47 +129,43 @@ bool CommandExecutor::doCommandSingleton(Command* cmd)
   }
 
   // dump the model/proof/unsat core if option is set
-  if(status) {
+  if (status) {
     Command* g = NULL;
-    if( d_options.getProduceModels() &&
-        d_options.getDumpModels() &&
-        ( res.asSatisfiabilityResult() == Result::SAT ||
-          (res.isUnknown() && res.whyUnknown() == Result::INCOMPLETE) ) ) {
+    if (d_options.getProduceModels() && d_options.getDumpModels() &&
+        (res.asSatisfiabilityResult() == Result::SAT ||
+         (res.isUnknown() && res.whyUnknown() == Result::INCOMPLETE))) {
       g = new GetModelCommand();
     }
-    if( d_options.getProof() &&
-        d_options.getDumpProofs() &&
-        res.asSatisfiabilityResult() == Result::UNSAT ) {
+    if (d_options.getProof() && d_options.getDumpProofs() &&
+        res.asSatisfiabilityResult() == Result::UNSAT) {
       g = new GetProofCommand();
     }
 
-    if( d_options.getDumpInstantiations() &&
-        ( ( d_options.getInstFormatMode() != INST_FORMAT_MODE_SZS &&
-            ( res.asSatisfiabilityResult() == Result::SAT ||
-              (res.isUnknown() && res.whyUnknown() == Result::INCOMPLETE) ) ) ||
-          res.asSatisfiabilityResult() == Result::UNSAT ) )
-    {
+    if (d_options.getDumpInstantiations() &&
+        ((d_options.getInstFormatMode() != INST_FORMAT_MODE_SZS &&
+          (res.asSatisfiabilityResult() == Result::SAT ||
+           (res.isUnknown() && res.whyUnknown() == Result::INCOMPLETE))) ||
+         res.asSatisfiabilityResult() == Result::UNSAT)) {
       g = new GetInstantiationsCommand();
     }
 
-    if( d_options.getDumpSynth() &&
-        res.asSatisfiabilityResult() == Result::UNSAT )
-    {
+    if (d_options.getDumpSynth() &&
+        res.asSatisfiabilityResult() == Result::UNSAT) {
       g = new GetSynthSolutionCommand();
     }
 
-    if( d_options.getDumpUnsatCores() &&
-        res.asSatisfiabilityResult() == Result::UNSAT )
-    {
+    if (d_options.getDumpUnsatCores() &&
+        res.asSatisfiabilityResult() == Result::UNSAT) {
       g = new GetUnsatCoreCommand();
     }
 
-    if(g != NULL) {
+    if (g != NULL) {
       // set no time limit during dumping if applicable
-      if( d_options.getForceNoLimitCpuWhileDump() ){
+      if (d_options.getForceNoLimitCpuWhileDump()) {
         setNoLimitCPU();
       }
       status = doCommandSingleton(g);
+      delete g;
     }
   }
   return status;