diff options
author | Dejan Jovanović <dejan.jovanovic@gmail.com> | 2010-04-14 19:06:53 +0000 |
---|---|---|
committer | Dejan Jovanović <dejan.jovanovic@gmail.com> | 2010-04-14 19:06:53 +0000 |
commit | f8ca588548491146fffbf22b2e9082986504211c (patch) | |
tree | 980553ffdb2b275a1e203c6e87743a01d1d5e5bc /src/expr/node.h | |
parent | 7c83d004874a46efe36d58717f7a4d72553b3693 (diff) |
Marging from types 404:415, changes: Massive
* Types are now represented as nodes in the attribute table and are managed, i.e. you can say
Type booleanType = d_nodeManager->booleanType();
Type t = d_nodeManager->mkFunctionType(booleanType, booleanType);
FunctionType ft = (FunctionType)t;
Assert(ft.getArgTypes()[0], booleanType);
* The attributes now have a table for Nodes and a table for TNodes (both should be used with caution)
* Changes the way nodes are extracted from NodeBuilder, added several methods to
extract a Node, NodeValue, or Node*, with corresponding methods for extraction
* Used the above in the construction of Expr and Type objects
* The NodeManager now destroys the attributes in the destructor by pausing the
garbage collection
* To achive destruction a flag d_inDesctruction has been added to loosen the assertion
in NodeValue::dec() (there might be -refcount TNodes leftover)
* Beginnings of the Bitvector constants using GMP
Not yet in tiptop phase, needs more documentation, and Types should be pulled out to TypeNodes eventually. Also, the types are currently defined in the builting_kinds, and I need to add these to the theory specific definitions with special 'type' constructs.
I hate branching and merging.
Diffstat (limited to 'src/expr/node.h')
-rw-r--r-- | src/expr/node.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/expr/node.h b/src/expr/node.h index 3a2aca571..27756da5b 100644 --- a/src/expr/node.h +++ b/src/expr/node.h @@ -28,7 +28,6 @@ #include "expr/kind.h" #include "expr/metakind.h" -#include "expr/type.h" #include "util/Assert.h" #include "util/output.h" @@ -248,7 +247,7 @@ public: * Returns the type of this node. * @return the type */ - Type* getType() const; + Type getType() const; /** * Returns the kind of this node. @@ -640,7 +639,7 @@ NodeTemplate<ref_count>::~NodeTemplate() throw(AssertionException) { if(ref_count) { d_nv->dec(); } else { - Assert(d_nv->d_rc > 0 || d_nv->isBeingDeleted(), + Assert(d_nv->d_rc > 0 || d_nv->isBeingDeleted() || NodeManager::currentNM()->inDestruction(), "TNode pointing to an expired NodeValue at destruction time"); } } @@ -815,7 +814,7 @@ inline bool NodeTemplate<ref_count>::hasOperator() const { } template <bool ref_count> -Type* NodeTemplate<ref_count>::getType() const { +Type NodeTemplate<ref_count>::getType() const { Assert( NodeManager::currentNM() != NULL, "There is no current CVC4::NodeManager associated to this thread.\n" "Perhaps a public-facing function is missing a NodeManagerScope ?" ); |