diff options
author | Morgan Deters <mdeters@cs.nyu.edu> | 2013-11-06 16:58:16 -0500 |
---|---|---|
committer | Tianyi Liang <tianyi-liang@uiowa.edu> | 2013-11-10 18:47:35 -0600 |
commit | 726603e0e5a5482cf98538079790747e43313276 (patch) | |
tree | 12e41e99a21a16cf9cff7374a84d9a6527f03c8b /src/expr/node.h | |
parent | 6c6f44c32a6bb957c1e82ae75fbf62db2e286595 (diff) |
Flatten libcvc4 build structure; remove some #include interdependences
Diffstat (limited to 'src/expr/node.h')
-rw-r--r-- | src/expr/node.h | 40 |
1 files changed, 2 insertions, 38 deletions
diff --git a/src/expr/node.h b/src/expr/node.h index e6a163a8b..3c058c924 100644 --- a/src/expr/node.h +++ b/src/expr/node.h @@ -443,7 +443,7 @@ public: * Returns true if this node represents a constant * @return true if const */ - inline bool isConst() const; + bool isConst() const; /** * Returns true if this node represents a constant @@ -921,7 +921,7 @@ inline std::ostream& operator<<(std::ostream& out, #include <ext/hash_map> -#include "expr/attribute.h" +//#include "expr/attribute.h" #include "expr/node_manager.h" #include "expr/type_checker.h" @@ -1271,42 +1271,6 @@ TypeNode NodeTemplate<ref_count>::getType(bool check) const return NodeManager::currentNM()->getType(*this, check); } -/** Is this node constant? (and has that been computed yet?) */ -struct IsConstTag { }; -struct IsConstComputedTag { }; -typedef expr::Attribute<IsConstTag, bool> IsConstAttr; -typedef expr::Attribute<IsConstComputedTag, bool> IsConstComputedAttr; - -template <bool ref_count> -inline bool -NodeTemplate<ref_count>::isConst() const { - assertTNodeNotExpired(); - Debug("isConst") << "Node::isConst() for: " << *this << std::endl; - if(isNull()) { - return false; - } - switch(getMetaKind()) { - case kind::metakind::CONSTANT: - Debug("isConst") << "Node::isConst() returning true, it's a CONSTANT" << std::endl; - return true; - case kind::metakind::VARIABLE: - Debug("isConst") << "Node::isConst() returning false, it's a VARIABLE" << std::endl; - return false; - default: - if(getAttribute(IsConstComputedAttr())) { - bool bval = getAttribute(IsConstAttr()); - Debug("isConst") << "Node::isConst() returning cached value " << (bval ? "true" : "false") << " for: " << *this << std::endl; - return bval; - } else { - bool bval = expr::TypeChecker::computeIsConst(NodeManager::currentNM(), *this); - Debug("isConst") << "Node::isConst() computed value " << (bval ? "true" : "false") << " for: " << *this << std::endl; - const_cast< NodeTemplate<ref_count>* >(this)->setAttribute(IsConstAttr(), bval); - const_cast< NodeTemplate<ref_count>* >(this)->setAttribute(IsConstComputedAttr(), true); - return bval; - } - } -} - template <bool ref_count> inline Node NodeTemplate<ref_count>::substitute(TNode node, TNode replacement) const { |