From 005066130a774c9e4aa838ca500d5fd3137909be Mon Sep 17 00:00:00 2001 From: Tim King Date: Fri, 18 Feb 2011 23:28:19 +0000 Subject: Changes: - ArithVar is no longer an attribute - RowVector's destructor reduces the row count of its variables upon. - Tableau's destructor now free its rows instead of leaking memory. - Added ability to convert ReducedRowVectors into equivalent Nodes. - getValue() should work again. --- src/theory/arith/arith_utilities.h | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'src/theory/arith/arith_utilities.h') diff --git a/src/theory/arith/arith_utilities.h b/src/theory/arith/arith_utilities.h index 6a9102a19..2053379d9 100644 --- a/src/theory/arith/arith_utilities.h +++ b/src/theory/arith/arith_utilities.h @@ -28,6 +28,7 @@ #include #include #include +#include namespace CVC4 { namespace theory { @@ -38,23 +39,10 @@ typedef uint32_t ArithVar; //static const ArithVar ARITHVAR_SENTINEL = std::numeric_limits::max(); #define ARITHVAR_SENTINEL std::numeric_limits::max() -struct ArithVarAttrID{}; -typedef expr::Attribute ArithVarAttr; +//Maps from Nodes -> ArithVars, and vice versa +typedef __gnu_cxx::hash_map NodeToArithVarMap; +typedef __gnu_cxx::hash_map ArithVarToNodeMap; -inline bool hasArithVar(TNode x){ - return x.hasAttribute(ArithVarAttr()); -} - -inline ArithVar asArithVar(TNode x){ - Assert(hasArithVar(x)); - Assert(x.getAttribute(ArithVarAttr()) <= ARITHVAR_SENTINEL); - return x.getAttribute(ArithVarAttr()); -} - -inline void setArithVar(TNode x, ArithVar a){ - Assert(!hasArithVar(x)); - return x.setAttribute(ArithVarAttr(), (uint64_t)a); -} inline Node mkRationalNode(const Rational& q){ return NodeManager::currentNM()->mkConst(q); -- cgit v1.2.3