5e422f34928ca272922bb054768ea49bc09fb249
1 /********************* -*- C++ -*- */
3 ** This file is part of the CVC4 prototype.
4 ** Copyright (c) 2009 The Analysis of Computer Systems Group (ACSys)
5 ** Courant Institute of Mathematical Sciences
7 ** See the file COPYING in the top-level source directory for licensing
10 ** Reference-counted encapsulation of a pointer to an expression.
13 #include "cvc4_expr.h"
14 #include "core/expr_value.h"
15 #include "core/expr_builder.h"
21 Expr::Expr(ExprValue
* ev
)
23 // FIXME: thread-safety
27 Expr::Expr(const Expr
& e
) {
28 // FIXME: thread-safety
34 // FIXME: thread-safety
38 Expr
& Expr::operator=(const Expr
& e
) {
39 // FIXME: thread-safety
47 ExprValue
* Expr::operator->() {
51 const ExprValue
* Expr::operator->() const {
55 uint64_t Expr::hash() const {
59 Expr
Expr::eqExpr(const Expr
& right
) const {
60 return ExprBuilder(*this).eqExpr(right
);
63 Expr
Expr::notExpr() const {
64 return ExprBuilder(*this).notExpr();
67 Expr
Expr::negate() const { // avoid double-negatives
68 return ExprBuilder(*this).negate();
71 Expr
Expr::andExpr(const Expr
& right
) const {
72 return ExprBuilder(*this).andExpr(right
);
75 Expr
Expr::orExpr(const Expr
& right
) const {
76 return ExprBuilder(*this).orExpr(right
);
79 Expr
Expr::iteExpr(const Expr
& thenpart
, const Expr
& elsepart
) const {
80 return ExprBuilder(*this).iteExpr(thenpart
, elsepart
);
83 Expr
Expr::iffExpr(const Expr
& right
) const {
84 return ExprBuilder(*this).iffExpr(right
);
87 Expr
Expr::impExpr(const Expr
& right
) const {
88 return ExprBuilder(*this).impExpr(right
);
91 Expr
Expr::xorExpr(const Expr
& right
) const {
92 return ExprBuilder(*this).xorExpr(right
);
95 Expr
Expr::skolemExpr(int i
) const {
96 return ExprBuilder(*this).skolemExpr(i
);
99 Expr
Expr::substExpr(const std::vector
<Expr
>& oldTerms
,
100 const std::vector
<Expr
>& newTerms
) const {
101 return ExprBuilder(*this).substExpr(oldTerms
, newTerms
);
104 } /* CVC4 namespace */