Disabled arith-rewrite-equalities by default unless in a pure arithmetic theory
authorClark Barrett <barrett@cs.nyu.edu>
Fri, 11 May 2012 15:20:05 +0000 (15:20 +0000)
committerClark Barrett <barrett@cs.nyu.edu>
Fri, 11 May 2012 15:20:05 +0000 (15:20 +0000)
src/smt/smt_engine.cpp
src/util/options.cpp
src/util/options.h

index 75b332314ebe9160ad0e0dc790ef300459a55e18..73ad5bd405b75acc91863f164327069df83d1c2f 100644 (file)
@@ -430,6 +430,12 @@ void SmtEngine::setLogicInternal(const LogicInfo& logic) throw() {
     Trace("smt") << "setting ite simplification to " << iteSimp << std::endl;
     NodeManager::currentNM()->getOptions()->doITESimp = iteSimp;
   }
+  // Turn on ite simplification only for pure arithmetic
+  if(! Options::current()->arithRewriteEqSetByUser) {
+    bool arithRewriteEq = logic.isPure(theory::THEORY_ARITH) && !logic.isQuantified();
+    Trace("smt") << "setting arith rewrite equalities " << arithRewriteEq << std::endl;
+    NodeManager::currentNM()->getOptions()->arithRewriteEq = arithRewriteEq;
+  }
 
 }
 
index 7c8a0748906bfb3f11fb138576a254b0e7dec2ab..46997a04d3bb698aa40bae76fd081e25b88885c5 100644 (file)
@@ -114,7 +114,8 @@ Options::Options() :
   ufSymmetryBreaker(false),
   ufSymmetryBreakerSetByUser(false),
   dioSolver(true),
-  arithRewriteEq(true),
+  arithRewriteEq(false),
+  arithRewriteEqSetByUser(false),
   lemmaOutputChannel(NULL),
   lemmaInputChannel(NULL),
   threads(2),// default should be 1 probably, but say 2 for now
@@ -386,7 +387,8 @@ enum OptionValue {
   ARITHMETIC_PIVOT_THRESHOLD,
   ARITHMETIC_PROP_MAX_LENGTH,
   ARITHMETIC_DIO_SOLVER,
-  ARITHMETIC_REWRITE_EQUALITIES,
+  ENABLE_ARITHMETIC_REWRITE_EQUALITIES,
+  DISABLE_ARITHMETIC_REWRITE_EQUALITIES,
   ENABLE_SYMMETRY_BREAKER,
   DISABLE_SYMMETRY_BREAKER,
   PARALLEL_THREADS,
@@ -483,7 +485,8 @@ static struct option cmdlineOptions[] = {
   { "print-winner", no_argument     , NULL, PRINT_WINNER  },
   { "disable-arithmetic-propagation", no_argument, NULL, ARITHMETIC_PROPAGATION },
   { "disable-dio-solver", no_argument, NULL, ARITHMETIC_DIO_SOLVER },
-  { "disable-arith-rewrite-equalities", no_argument, NULL, ARITHMETIC_REWRITE_EQUALITIES },
+  { "enable-arith-rewrite-equalities", no_argument, NULL, ENABLE_ARITHMETIC_REWRITE_EQUALITIES },
+  { "disable-arith-rewrite-equalities", no_argument, NULL, DISABLE_ARITHMETIC_REWRITE_EQUALITIES },
   { "enable-symmetry-breaker", no_argument, NULL, ENABLE_SYMMETRY_BREAKER },
   { "disable-symmetry-breaker", no_argument, NULL, DISABLE_SYMMETRY_BREAKER },
   { "threads", required_argument, NULL, PARALLEL_THREADS },
@@ -882,8 +885,14 @@ throw(OptionException) {
       dioSolver = false;
       break;
 
-    case ARITHMETIC_REWRITE_EQUALITIES:
+    case ENABLE_ARITHMETIC_REWRITE_EQUALITIES:
+      arithRewriteEq = true;
+      arithRewriteEqSetByUser = true;
+      break;
+
+    case DISABLE_ARITHMETIC_REWRITE_EQUALITIES:
       arithRewriteEq = false;
+      arithRewriteEqSetByUser = true;
       break;
 
     case ENABLE_SYMMETRY_BREAKER:
index 3b658472797d228794eac90b849d7858802eaaac..fd09d4149c9ff7c6000a5e4819a8e1a88e4ddc21 100644 (file)
@@ -269,6 +269,11 @@ struct CVC4_PUBLIC Options {
    */
   bool arithRewriteEq;
 
+  /**
+   * Whether the flag was set by the user
+   */
+  bool arithRewriteEqSetByUser;
+
   /** The output channel to receive notfication events for new lemmas */
   LemmaOutputChannel* lemmaOutputChannel;
   LemmaInputChannel* lemmaInputChannel;