summaryrefslogtreecommitdiff
path: root/src/expr/node_manager.h
diff options
context:
space:
mode:
authorChristopher L. Conway <christopherleeconway@gmail.com>2010-02-25 22:32:03 +0000
committerChristopher L. Conway <christopherleeconway@gmail.com>2010-02-25 22:32:03 +0000
commitbfab2bde219a0cda230fb2f26d89d123918a219f (patch)
treeea051051a3b7821127500926593b310bbf5b744a /src/expr/node_manager.h
parent175741488a4dd986ad69ee644617ff735b855031 (diff)
Adding Node::getOperator()
Removing references to ExprManager from Type, moving Type creation into NodeManager
Diffstat (limited to 'src/expr/node_manager.h')
-rw-r--r--src/expr/node_manager.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/expr/node_manager.h b/src/expr/node_manager.h
index a200a6d77..9d2b0947e 100644
--- a/src/expr/node_manager.h
+++ b/src/expr/node_manager.h
@@ -114,6 +114,28 @@ public:
const AttrKind&,
const typename AttrKind::value_type& value);
+
+ /** Get the type for booleans. */
+ inline const BooleanType* booleanType() const {
+ return BooleanType::getInstance();
+ }
+
+ /** Get the type for sorts. */
+ inline const KindType* kindType() const {
+ return KindType::getInstance();
+ }
+
+ /** Make a function type from domain to range. */
+ inline const FunctionType*
+ mkFunctionType(const Type* domain, const Type* range);
+
+ /** Make a function type with input types from argTypes. */
+ inline const FunctionType*
+ mkFunctionType(const std::vector<const Type*>& argTypes, const Type* range);
+
+ /** Make a new sort with the given name. */
+ inline const Type* mkSort(const std::string& name);
+
inline const Type* getType(TNode n);
};
@@ -159,6 +181,29 @@ inline void NodeManager::setAttribute(TNode n,
d_attrManager.setAttribute(n, AttrKind(), value);
}
+/** Make a function type from domain to range.
+ * TODO: Function types should be unique for this manager. */
+const FunctionType*
+NodeManager::mkFunctionType(const Type* domain,
+ const Type* range) {
+ std::vector<const Type*> argTypes;
+ argTypes.push_back(domain);
+ return new FunctionType(argTypes, range);
+}
+
+/** Make a function type with input types from argTypes.
+ * TODO: Function types should be unique for this manager. */
+const FunctionType*
+NodeManager::mkFunctionType(const std::vector<const Type*>& argTypes,
+ const Type* range) {
+ Assert( argTypes.size() > 0 );
+ return new FunctionType(argTypes, range);
+}
+
+const Type*
+NodeManager::mkSort(const std::string& name) {
+ return new SortType(name);
+}
inline const Type* NodeManager::getType(TNode n) {
return getAttribute(n, CVC4::expr::TypeAttr());
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback