summaryrefslogtreecommitdiff
path: root/src/include/cvc4_expr.h
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@gmail.com>2009-11-17 16:40:19 +0000
committerMorgan Deters <mdeters@gmail.com>2009-11-17 16:40:19 +0000
commit0201aa29bea8467e5cc07f2d0af68a4da3e86ec1 (patch)
tree548f42c4244176fb91956e9571451842fd85e482 /src/include/cvc4_expr.h
parent7293554b109742697d4d928ed7b58acadc6de947 (diff)
fixes/redesign of source layout from meeting
Diffstat (limited to 'src/include/cvc4_expr.h')
-rw-r--r--src/include/cvc4_expr.h80
1 files changed, 80 insertions, 0 deletions
diff --git a/src/include/cvc4_expr.h b/src/include/cvc4_expr.h
new file mode 100644
index 000000000..17e7f4f82
--- /dev/null
+++ b/src/include/cvc4_expr.h
@@ -0,0 +1,80 @@
+/********************* -*- C++ -*- */
+/** expr.h
+ ** This file is part of the CVC4 prototype.
+ ** Copyright (c) 2009 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.
+ **
+ ** Reference-counted encapsulation of a pointer to an expression.
+ **/
+
+#ifndef __CVC4_EXPR_H
+#define __CVC4_EXPR_H
+
+#include <vector>
+#include <stdint.h>
+
+namespace CVC4 {
+
+class ExprValue;
+
+/**
+ * Encapsulation of an ExprValue pointer. The reference count is
+ * maintained in the ExprValue.
+ */
+class Expr {
+ /** A convenient null-valued encapsulated pointer */
+ static Expr s_null;
+
+ /** The referenced ExprValue */
+ ExprValue* d_ev;
+
+ /** This constructor is reserved for use by the Expr package; one
+ * must construct an Expr using one of the build mechanisms of the
+ * Expr package.
+ *
+ * Increments the reference count. */
+ explicit Expr(ExprValue*);
+
+public:
+ Expr(const Expr&);
+
+ /** Destructor. Decrements the reference count and, if zero,
+ * collects the ExprValue. */
+ ~Expr();
+
+ Expr& operator=(const Expr&);
+
+ /** Access to the encapsulated expression.
+ * @return the encapsulated expression. */
+ ExprValue* operator->();
+
+ /** Const access to the encapsulated expression.
+ * @return the encapsulated expression [const]. */
+ const ExprValue* operator->() const;
+
+ uint64_t hash() const;
+
+ Expr eqExpr(const Expr& right) const;
+ Expr notExpr() const;
+ Expr negate() const; // avoid double-negatives
+ Expr andExpr(const Expr& right) const;
+ Expr orExpr(const Expr& right) const;
+ Expr iteExpr(const Expr& thenpart, const Expr& elsepart) const;
+ Expr iffExpr(const Expr& right) const;
+ Expr impExpr(const Expr& right) const;
+ Expr xorExpr(const Expr& right) const;
+ Expr skolemExpr(int i) const;
+ Expr substExpr(const std::vector<Expr>& oldTerms,
+ const std::vector<Expr>& newTerms) const;
+
+ static Expr null() { return s_null; }
+
+ friend class ExprBuilder;
+};/* class Expr */
+
+} /* CVC4 namespace */
+
+#endif /* __CVC4_EXPR_H */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback