This commit merges in the changes from branches/arithmetic/refactor0
authorTim King <taking@cs.nyu.edu>
Fri, 2 Mar 2012 23:37:06 +0000 (23:37 +0000)
committerTim King <taking@cs.nyu.edu>
Fri, 2 Mar 2012 23:37:06 +0000 (23:37 +0000)
- Improved the checks in AssertLower and AssertUpper so that redundant bounds cause less work.
- Because of the above change, d_constantIntegerVariables now cannot have duplicate elements enqueued. This allows removing d_varsInDioSolver.
- Fix to an assertion in CDQueue.
- Implements a CDArithVarSet using a vector of booleans and CDList.
- Refactored ArithVar out of arith_utilities.h. Miscellaneous cleanup of arithmetic.

23 files changed:
src/context/cdqueue.h
src/theory/arith/Makefile.am
src/theory/arith/arith_priority_queue.h
src/theory/arith/arith_prop_manager.cpp
src/theory/arith/arith_prop_manager.h
src/theory/arith/arith_rewriter.cpp
src/theory/arith/arith_rewriter.h
src/theory/arith/arith_static_learner.cpp
src/theory/arith/arith_utilities.h
src/theory/arith/arithvar.h [new file with mode: 0644]
src/theory/arith/arithvar_node_map.h
src/theory/arith/arithvar_set.h
src/theory/arith/atom_database.cpp
src/theory/arith/difference_manager.h
src/theory/arith/dio_solver.h
src/theory/arith/linear_equality.h
src/theory/arith/ordered_set.h
src/theory/arith/partial_model.cpp
src/theory/arith/partial_model.h
src/theory/arith/simplex.h
src/theory/arith/tableau.h
src/theory/arith/theory_arith.cpp
src/theory/arith/theory_arith.h

index f84b66349e2496cb6692a08f7ab6d0322538ec4f..d733e0b1c56c258b80c23ecb58d05e6772d9d6ea 100644 (file)
@@ -122,7 +122,7 @@ public:
       // Some elements have been enqueued and dequeued in the same
       // context and now the queue is empty we can destruct them.
       CDList<T>::truncateList(d_lastsave);
-      Assert(d_size ==  d_lastsave);
+      Assert(CDList<T>::d_size ==  d_lastsave);
       d_iter = d_lastsave;
     }
   }
index 7934140a0b5dec29073fd88d92867a7ac8fc5153..4cff4a7823b6706d29591e6c83ae655e228252cb 100644 (file)
@@ -7,6 +7,7 @@ noinst_LTLIBRARIES = libarith.la
 
 libarith_la_SOURCES = \
        theory_arith_type_rules.h \
+       arithvar.h \
        arith_rewriter.h \
        arith_rewriter.cpp \
        arith_static_learner.h \
index 1e7e3460bd0e545dd0db046883ed2455d0c53a8f..8c70699753eefda114e11f36dd4e723d96e01aa0 100644 (file)
@@ -23,7 +23,7 @@
 #ifndef __CVC4__THEORY__ARITH__ARITH_PRIORITY_QUEUE_H
 #define __CVC4__THEORY__ARITH__ARITH_PRIORITY_QUEUE_H
 
-#include "theory/arith/arith_utilities.h"
+#include "theory/arith/arithvar.h"
 #include "theory/arith/delta_rational.h"
 #include "theory/arith/tableau.h"
 #include "theory/arith/partial_model.h"
index 4b52133da0cad50dab1203d4b91646435e585318..dc9b0ddb98d5ec4f9b9b42f1c35c7011d0a0e747 100644 (file)
 #include "context/cdhashmap.h"
 #include "context/cdo.h"
 
-using namespace CVC4;
-using namespace CVC4::theory;
-using namespace CVC4::theory::arith;
 using namespace CVC4::kind;
 using namespace std;
 
 
+namespace CVC4 {
+namespace theory {
+namespace arith {
+
 bool ArithPropManager::isAsserted(TNode n) const{
   Node satValue = d_valuation.getSatValue(n);
   if(satValue.isNull()){
@@ -166,3 +167,7 @@ ArithPropManager::Statistics::~Statistics()
   StatisticsRegistry::unregisterStat(&d_alreadyPropagatedNode);
   StatisticsRegistry::unregisterStat(&d_addedPropagation);
 }
+
+}; /* namesapce arith */
+}; /* namespace theory */
+}; /* namespace CVC4 */
index 2bac21437e9a9d6978c75e0654754cf7275b4bf3..900a0ed5860a675813faf51aa50a9b587dcbdef2 100644 (file)
@@ -23,7 +23,7 @@
 #define __CVC4__THEORY__ARITH__ARITH_PROP_MANAGER_H
 
 #include "theory/valuation.h"
-#include "theory/arith/arith_utilities.h"
+#include "theory/arith/arithvar.h"
 #include "theory/arith/arithvar_node_map.h"
 #include "theory/arith/atom_database.h"
 #include "theory/arith/delta_rational.h"
index c0ef02ec4fe9e2fc685bd0b3075bae64020745c6..ca0aa4d14b2dbc32863fc3d98db54bafd747596a 100644 (file)
 #include <set>
 #include <stack>
 
-using namespace CVC4;
-using namespace CVC4::theory;
-using namespace CVC4::theory::arith;
+namespace CVC4 {
+namespace theory {
+namespace arith {
 
 bool isVariable(TNode t){
   return t.getMetaKind() == kind::metakind::VARIABLE;
 }
 
+bool ArithRewriter::isAtom(TNode n) {
+  return arith::isRelationOperator(n.getKind());
+}
+
 RewriteResponse ArithRewriter::rewriteConstant(TNode t){
   Assert(t.getMetaKind() == kind::metakind::CONSTANT);
   Node val = coerceToRationalNode(t);
@@ -364,3 +368,7 @@ RewriteResponse ArithRewriter::rewriteDivByConstant(TNode t, bool pre){
     return RewriteResponse(REWRITE_AGAIN, mult);
   }
 }
+
+}/* CVC4::theory::arith namespace */
+}/* CVC4::theory namespace */
+}/* CVC4 namespace */
index 822514f381ec904c2e8be12447d1a6c7b23d0003..07c009b2e7d8c84bb3251d3906de7ff3fa0418cd 100644 (file)
  ** See the file COPYING in the top-level source directory for licensing
  ** information.\endverbatim
  **
- ** \brief [[ Add one-line brief description here ]]
+ ** \brief Rewriter for arithmetic.
  **
- ** [[ Add lengthier description here ]]
- ** \todo document this file
+ ** Rewriter for the theory of arithmetic.  This rewrites to the normal form for
+ ** arithmetic. See theory/arith/normal_form.h for more information.
  **/
 
 #include "cvc4_private.h"
@@ -23,9 +23,6 @@
 #define __CVC4__THEORY__ARITH__ARITH_REWRITER_H
 
 #include "theory/theory.h"
-#include "theory/arith/arith_utilities.h"
-#include "theory/arith/normal_form.h"
-
 #include "theory/rewriter.h"
 
 namespace CVC4 {
@@ -33,6 +30,18 @@ namespace theory {
 namespace arith {
 
 class ArithRewriter {
+public:
+
+  static RewriteResponse preRewrite(TNode n);
+  static RewriteResponse postRewrite(TNode n);
+  static Node rewriteEquality(TNode equality) {
+    // Arithmetic owns the domain, so this is totally ok
+    return Rewriter::rewrite(equality);
+  }
+
+  static void init() { }
+
+  static void shutdown() { }
 
 private:
 
@@ -59,24 +68,7 @@ private:
   static RewriteResponse postRewriteAtom(TNode t);
   static RewriteResponse postRewriteAtomConstantRHS(TNode t);
 
-public:
-
-  static RewriteResponse preRewrite(TNode n);
-  static RewriteResponse postRewrite(TNode n);
-  static Node rewriteEquality(TNode equality) {
-    // Arithmetic owns the domain, so this is totally ok
-    return Rewriter::rewrite(equality);
-  }
-
-  static void init() { }
-
-  static void shutdown() { }
-
-private:
-
-  static inline bool isAtom(TNode n) {
-    return arith::isRelationOperator(n.getKind());
-  }
+  static bool isAtom(TNode n);
 
   static inline bool isTerm(TNode n) {
     return !isAtom(n);
index d4d495486361da8d9bcc16ec3c3d55f3d6f5bb81..2f4f6e32b3826e49a1b4f8fdecdc1d0b3acb782c 100644 (file)
 #include <vector>
 
 using namespace std;
-
-using namespace CVC4;
 using namespace CVC4::kind;
-using namespace CVC4::theory;
-using namespace CVC4::theory::arith;
+
+namespace CVC4 {
+namespace theory {
+namespace arith {
 
 
 ArithStaticLearner::ArithStaticLearner(SubstitutionMap& pbSubstitutions) :
@@ -495,3 +495,7 @@ void ArithStaticLearner::addBound(TNode n) {
     break;
   }
 }
+
+}; /* namesapce arith */
+}; /* namespace theory */
+}; /* namespace CVC4 */
index 44b55440edbab6db872a18d39441f9112300532a..a5d94ec40c90f83260bd397d231a82dc2b67db3b 100644 (file)
  ** See the file COPYING in the top-level source directory for licensing
  ** information.\endverbatim
  **
- ** \brief [[ Add one-line brief description here ]]
+ ** \brief Arith utilities are common inline functions for dealing with nodes.
  **
- ** [[ Add lengthier description here ]]
- ** \todo document this file
+ ** Arith utilities are common functions for dealing with nodes.
  **/
 
 #include "cvc4_private.h"
 #define __CVC4__THEORY__ARITH__ARITH_UTILITIES_H
 
 #include "util/rational.h"
+#include "util/integer.h"
 #include "expr/node.h"
-#include "expr/attribute.h"
 #include "theory/arith/delta_rational.h"
 #include "context/cdhashset.h"
-#include <vector>
-#include <stdint.h>
-#include <limits>
 #include <ext/hash_map>
+#include <vector>
 
 namespace CVC4 {
 namespace theory {
 namespace arith {
 
-
-typedef uint32_t ArithVar;
-//static const ArithVar ARITHVAR_SENTINEL = std::numeric_limits<ArithVar>::max();
-#define ARITHVAR_SENTINEL std::numeric_limits<ArithVar>::max()
-
-//Maps from Nodes -> ArithVars, and vice versa
-typedef __gnu_cxx::hash_map<Node, ArithVar, NodeHashFunction> NodeToArithVarMap;
-typedef __gnu_cxx::hash_map<ArithVar, Node> ArithVarToNodeMap;
-
 //Sets of Nodes
 typedef __gnu_cxx::hash_set<Node, NodeHashFunction> NodeSet;
 typedef context::CDHashSet<Node, NodeHashFunction> CDNodeSet;
 
-typedef context::CDHashSet<ArithVar> CDArithVarSet;
-
-class ArithVarCallBack {
-public:
-  virtual void callback(ArithVar x) = 0;
-};
-
-
-
 inline Node mkRationalNode(const Rational& q){
   return NodeManager::currentNM()->mkConst<Rational>(q);
 }
@@ -126,7 +105,7 @@ inline bool isRelationOperator(Kind k){
  * Given a relational kind, k, return the kind k' s.t.
  * swapping the lefthand and righthand side is equivalent.
  *
- * The following equivalence should hold, 
+ * The following equivalence should hold,
  *   (k l r) <=> (k' r l)
  */
 inline Kind reverseRelationKind(Kind k){
diff --git a/src/theory/arith/arithvar.h b/src/theory/arith/arithvar.h
new file mode 100644 (file)
index 0000000..52dc9fd
--- /dev/null
@@ -0,0 +1,57 @@
+/*********************                                                        */
+/*! \file arithvar.h
+ ** \verbatim
+ ** Original author: taking
+ ** Major contributors: none
+ ** Minor contributors (to current version): dejan, mdeters
+ ** This file is part of the CVC4 prototype.
+ ** Copyright (c) 2009, 2010, 2011  The Analysis of Computer Systems Group (ACSys)
+ ** Courant Institute of Mathematical Sciences
+ ** New York University
+ ** See the file COPYING in the top-level source directory for licensing
+ ** information.\endverbatim
+ **
+ ** \brief Defines ArithVar which is the internal representation of variables in arithmetic
+ **
+ ** This defines ArithVar which is the internal representation of variables in
+ ** arithmetic. This is a typedef from uint32_t to ArithVar.
+ ** This file also provides utilities for ArithVars.
+ **/
+
+
+#include "cvc4_private.h"
+
+#ifndef __CVC4__THEORY__ARITH__ARITHVAR_H
+#define __CVC4__THEORY__ARITH__ARITHVAR_H
+
+#include <limits>
+#include <stdint.h>
+#include <ext/hash_map>
+#include "expr/node.h"
+#include "context/cdhashset.h"
+
+namespace CVC4 {
+namespace theory {
+namespace arith {
+
+typedef uint32_t ArithVar;
+const ArithVar ARITHVAR_SENTINEL = std::numeric_limits<ArithVar>::max();
+
+//Maps from Nodes -> ArithVars, and vice versa
+typedef __gnu_cxx::hash_map<Node, ArithVar, NodeHashFunction> NodeToArithVarMap;
+typedef __gnu_cxx::hash_map<ArithVar, Node> ArithVarToNodeMap;
+
+/**
+ * ArithVarCallBack provides a mechanism for agreeing on callbacks while
+ * breaking mutual recursion inclusion order problems.
+ */
+class ArithVarCallBack {
+public:
+  virtual void callback(ArithVar x) = 0;
+};
+
+}; /* namesapce arith */
+}; /* namespace theory */
+}; /* namespace CVC4 */
+
+#endif /* __CVC4__THEORY__ARITH__ARITHVAR_H */
index 1dc8ddf38fd5c505d0cad7f37d7b657d5e59b4a9..e8428850d66cb9fc86d45b8477cdc8e665cf0011 100644 (file)
@@ -23,7 +23,7 @@
 #define __CVC4__THEORY__ARITH__ARITHVAR_NODE_MAP_H
 
 
-#include "theory/arith/arith_utilities.h"
+#include "theory/arith/arithvar.h"
 #include "context/context.h"
 #include "context/cdlist.h"
 #include "context/cdhashmap.h"
index 68937acc463d79590f3a0f25760b2741b317f9ee..b502849fdedf0084f8e5d79d1f2e44fd0a05ddfe 100644 (file)
 #define __CVC4__THEORY__ARITH__ARTIHVAR_SET_H
 
 #include <vector>
-#include "theory/arith/arith_utilities.h"
+#include "theory/arith/arithvar.h"
+#include "context/context.h"
+#include "context/cdlist.h"
+
 
 namespace CVC4 {
 namespace theory {
@@ -244,15 +247,6 @@ public:
     }
   }
 
-  /** Invalidates iterators */
-  /* void init(ArithVar x, bool val) { */
-  /*   Assert(x >= allocated()); */
-  /*   increaseSize(x); */
-  /*   if(val){ */
-  /*     add(x); */
-  /*   } */
-  /* } */
-
   /**
    * Invalidates iterators.
    */
@@ -325,6 +319,68 @@ public:
   }
 };
 
+class CDArithVarSet {
+private:
+
+  class RemoveIntWrapper{
+  private:
+    ArithVar d_var;
+    ArithVarCallBack& d_onDestruction;
+
+  public:
+    RemoveIntWrapper(ArithVar v, ArithVarCallBack& onDestruction):
+      d_var(v), d_onDestruction(onDestruction)
+    {}
+
+    ~RemoveIntWrapper(){
+      d_onDestruction.callback(d_var);
+    }
+  };
+
+  std::vector<bool> d_set;
+  context::CDList<RemoveIntWrapper> d_list;
+
+  class OnDestruction : public ArithVarCallBack {
+  private:
+    std::vector<bool>& d_set;
+  public:
+    OnDestruction(std::vector<bool>& set):
+      d_set(set)
+    {}
+
+    void callback(ArithVar x){
+      Assert(x < d_set.size());
+      d_set[x] = false;
+    }
+  };
+
+  OnDestruction d_callback;
+
+public:
+  CDArithVarSet(context::Context* c) :
+    d_list(c), d_callback(d_set)
+  { }
+
+  /** This cannot be const as garbage collection is done lazily. */
+  bool contains(ArithVar x) const{
+    if(x < d_set.size()){
+      return d_set[x];
+    }else{
+      return false;
+    }
+  }
+
+  void insert(ArithVar x){
+    Assert(!contains(x));
+    if(x >= d_set.size()){
+      d_set.resize(x+1, false);
+    }
+    d_list.push_back(RemoveIntWrapper(x, d_callback));
+    d_set[x] = true;
+  }
+};
+
+
 }/* CVC4::theory::arith namespace */
 }/* CVC4::theory namespace */
 }/* CVC4 namespace */
index 774d0eb22b986e8852f46d927980db94ff019686..3476eb8f5e5ba2e136a6743b658b3c1bfa661647 100644 (file)
 
 #include <list>
 
-using namespace CVC4;
-using namespace CVC4::theory;
-using namespace CVC4::theory::arith;
-
+using namespace std;
 using namespace CVC4::kind;
 
-using namespace std;
+namespace CVC4 {
+namespace theory {
+namespace arith {
 
 ArithAtomDatabase::ArithAtomDatabase(context::Context* cxt, OutputChannel& out) :
   d_arithOut(out), d_setsMap()
@@ -537,3 +536,7 @@ Node ArithAtomDatabase::getWeakerImpliedLowerBound(TNode lowerBound) const {
   Debug("arith::unate") << lowerBound <<" -> " << result << std::endl;
   return result;
 }
+
+}; /* namesapce arith */
+}; /* namespace theory */
+}; /* namespace CVC4 */
index 46b070651f983c6ecda1d8235d2a2ef628c0d4c3..c6e7f314d063dd930a9d383e5ff75cafbb99576c 100644 (file)
@@ -5,7 +5,7 @@
 #ifndef __CVC4__THEORY__ARITH__DIFFERENCE_MANAGER_H
 #define __CVC4__THEORY__ARITH__DIFFERENCE_MANAGER_H
 
-#include "theory/arith/arith_utilities.h"
+#include "theory/arith/arithvar.h"
 #include "theory/uf/equality_engine.h"
 #include "context/cdo.h"
 #include "context/cdlist.h"
index da41d94cdd620f6fce829ff78339563de08f6525..677040615f38c165be929bd61e71033cc248d9ee 100644 (file)
@@ -25,7 +25,6 @@
 
 #include "theory/arith/tableau.h"
 #include "theory/arith/partial_model.h"
-#include "theory/arith/arith_utilities.h"
 #include "util/rational.h"
 
 #include "util/stats.h"
index aa8a4923847e06fc7c26bc91c57582bd33cacb20..4d1d917b3e4cac8449ef0365ec777f854fccda5e 100644 (file)
@@ -33,7 +33,7 @@
 #define __CVC4__THEORY__ARITH__LINEAR_EQUALITY_H
 
 #include "theory/arith/delta_rational.h"
-#include "theory/arith/arith_utilities.h"
+#include "theory/arith/arithvar.h"
 #include "theory/arith/partial_model.h"
 #include "theory/arith/tableau.h"
 
index e3eebae5c60e8dfd08fb7e1244f8d5bff24c4675..8887daa8d20db5134ba46dc235ac056f80cfbfaf 100644 (file)
@@ -109,13 +109,6 @@ typedef std::map<Rational, BoundValueEntry> BoundValueSet;
 
 typedef std::set<TNode, RightHandRationalLT> EqualValueSet;
 
-// struct SetCleanupStrategy{
-//   static void cleanup(OrderedSet* l){
-//     Debug("arithgc") << "cleaning up  " << l << "\n";
-//     delete l;
-//   }
-// };
-
 }/* CVC4::theory::arith namespace */
 }/* CVC4::theory namespace */
 }/* CVC4 namespace */
index f113c4d34996bcf8ddb37dce84ac975f9259317b..65b0083d9ad5d6cb9b7bc4990f257e281667f111 100644 (file)
 
 using namespace std;
 
-using namespace CVC4;
-using namespace CVC4::theory;
-using namespace CVC4::theory::arith;
+namespace CVC4 {
+namespace theory {
+namespace arith {
+
 
 
 bool ArithPartialModel::boundsAreEqual(ArithVar x){
@@ -395,3 +396,7 @@ void ArithPartialModel::computeDelta(){
   }
   d_deltaIsSafe = true;
 }
+
+}; /* namesapce arith */
+}; /* namespace theory */
+}; /* namespace CVC4 */
index d9fa51d8d921cfb4a1ed08560efb44b4d1cf77b3..7a2a97726502a6aa9653dec6fc160770af8c14c6 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "context/context.h"
 #include "context/cdvector.h"
-#include "theory/arith/arith_utilities.h"
+#include "theory/arith/arithvar.h"
 #include "theory/arith/delta_rational.h"
 #include "expr/attribute.h"
 #include "expr/node.h"
index d69de3756ac12c00f178107a2f2eb7c17fab6517..39c0bc20b7beffb32078c389d5bef2e564758173 100644 (file)
@@ -50,7 +50,7 @@
 #ifndef __CVC4__THEORY__ARITH__SIMPLEX_H
 #define __CVC4__THEORY__ARITH__SIMPLEX_H
 
-#include "theory/arith/arith_utilities.h"
+#include "theory/arith/arithvar.h"
 #include "theory/arith/arith_priority_queue.h"
 #include "theory/arith/arithvar_set.h"
 #include "theory/arith/delta_rational.h"
index 321f66c5fec9b08cc91e4c4d53950260b612d3f5..1fcbdf13d387af7892857904b6643c3f3e903edc 100644 (file)
@@ -22,7 +22,7 @@
 #include "expr/node.h"
 #include "expr/attribute.h"
 
-#include "theory/arith/arith_utilities.h"
+#include "theory/arith/arithvar.h"
 #include "theory/arith/arithvar_set.h"
 #include "theory/arith/normal_form.h"
 
index bea87fdde87ff4a5fbbce6484467c31875b4b127..a1d57af6697d8b79092edefa07c7059b4552d1bc 100644 (file)
 #include <stdint.h>
 
 using namespace std;
-
-using namespace CVC4;
 using namespace CVC4::kind;
 
-using namespace CVC4::theory;
-using namespace CVC4::theory::arith;
+namespace CVC4 {
+namespace theory {
+namespace arith {
 
-static const uint32_t RESET_START = 2;
+const uint32_t RESET_START = 2;
 
 
 TheoryArith::TheoryArith(context::Context* c, context::UserContext* u, OutputChannel& out, Valuation valuation) :
@@ -64,8 +63,6 @@ TheoryArith::TheoryArith(context::Context* c, context::UserContext* u, OutputCha
   d_learner(d_pbSubstitutions),
   d_nextIntegerCheckVar(0),
   d_constantIntegerVariables(c),
-  d_CivIterator(c,0),
-  d_varsInDioSolver(c),
   d_diseq(c),
   d_partialModel(c, d_differenceManager),
   d_tableau(),
@@ -167,7 +164,7 @@ Node TheoryArith::AssertLower(ArithVar x_i, DeltaRational& c_i, TNode original){
   }
 
   //TODO Relax to less than?
-  if(d_partialModel.strictlyLessThanLowerBound(x_i, c_i)){
+  if(d_partialModel.lessThanLowerBound(x_i, c_i)){
     return Node::null();
   }
 
@@ -225,7 +222,7 @@ Node TheoryArith::AssertUpper(ArithVar x_i, DeltaRational& c_i, TNode original){
 
   Debug("arith") << "AssertUpper(" << x_i << " " << c_i << ")"<< std::endl;
 
-  if(d_partialModel.strictlyGreaterThanUpperBound(x_i, c_i) ){ // \upperbound(x_i) <= c_i
+  if(d_partialModel.greaterThanUpperBound(x_i, c_i) ){ // \upperbound(x_i) <= c_i
     return Node::null(); //sat
   }
 
@@ -763,21 +760,15 @@ Node TheoryArith::dioCutting(){
 }
 
 Node TheoryArith::callDioSolver(){
-  while(d_CivIterator < d_constantIntegerVariables.size()){
-    ArithVar v = d_constantIntegerVariables[d_CivIterator];
-    d_CivIterator = d_CivIterator + 1;
+  while(!d_constantIntegerVariables.empty()){
+    ArithVar v = d_constantIntegerVariables.front();
+    d_constantIntegerVariables.pop();
 
     Debug("arith::dio")  << v << endl;
 
     Assert(isInteger(v));
     Assert(d_partialModel.boundsAreEqual(v));
 
-    if(d_varsInDioSolver.find(v) != d_varsInDioSolver.end()){
-      continue;
-    }else{
-      d_varsInDioSolver.insert(v);
-    }
-
     TNode lb = d_partialModel.getLowerConstraint(v);
     TNode ub = d_partialModel.getUpperConstraint(v);
 
@@ -1491,3 +1482,7 @@ void TheoryArith::propagateCandidates(){
     propagateCandidate(candidate);
   }
 }
+
+}; /* namesapce arith */
+}; /* namespace theory */
+}; /* namespace CVC4 */
index e6bdbfba02b1a39f25d022de6131882437cc4015..929ef11739dfcd764304b65bf50132814a32dae4 100644 (file)
 #include "context/context.h"
 #include "context/cdlist.h"
 #include "context/cdhashset.h"
+#include "context/cdqueue.h"
 #include "expr/node.h"
 
-#include "theory/arith/arith_utilities.h"
+#include "theory/arith/arithvar.h"
 #include "theory/arith/arithvar_set.h"
 #include "theory/arith/delta_rational.h"
 #include "theory/arith/tableau.h"
@@ -161,18 +162,13 @@ private:
   /**
    * Queue of Integer variables that are known to be equal to a constant.
    */
-  context::CDList<ArithVar> d_constantIntegerVariables;
-  /** Iterator over d_constantIntegerVariables. */
-  context::CDO<unsigned int> d_CivIterator;
+  context::CDQueue<ArithVar> d_constantIntegerVariables;
 
   Node callDioSolver();
   Node dioCutting();
 
   Comparison mkIntegerEqualityFromAssignment(ArithVar v);
 
-  //TODO Replace with a more efficient check
-  CDArithVarSet d_varsInDioSolver;
-
   /**
    * If ArithVar v maps to the node n in d_removednode,
    * then n = (= asNode(v) rhs) where rhs is a term that