// this is essentially a traits structure
class Type_attr {
public:
- enum { hash_value = 11 }; // could use typeid but then different on different machines/compiles
+
+ // could use typeid but then different on different machines/compiles
+ enum { hash_value = 11 };
+
typedef Type value_type;//Node?
static const Type_attr marker;
};
}
bool Expr::operator==(const Expr& e) const {
- if(d_em != e.d_em)
- return false;Assert(d_node != NULL, "Unexpected NULL expression pointer!");Assert(e.d_node != NULL, "Unexpected NULL expression pointer!");
+ if(d_em != e.d_em){
+ return false;
+ }
+ Assert(d_node != NULL, "Unexpected NULL expression pointer!");
+ Assert(e.d_node != NULL, "Unexpected NULL expression pointer!");
return *d_node == *e.d_node;
}
}
bool Expr::operator<(const Expr& e) const {
- Assert(d_node != NULL, "Unexpected NULL expression pointer!");Assert(e.d_node != NULL, "Unexpected NULL expression pointer!");
- if(d_em != e.d_em)
+ Assert(d_node != NULL, "Unexpected NULL expression pointer!");
+ Assert(e.d_node != NULL, "Unexpected NULL expression pointer!");
+ if(d_em != e.d_em){
return false;
+ }
return *d_node < *e.d_node;
}
/**
* Returns the string representation of the expression.
+ * @return a string representation of the expression
*/
std::string toString() const;
public:
/**
- * Creates an expressio manager.
+ * Creates an expression manager.
*/
ExprManager();
Expr mkExpr(Kind kind, const Expr& child1);
/**
- * Make a ternary expression of a given kind (AND, PLUS, ...).
+ * Make a binary expression of a given kind (AND, PLUS, ...).
* @param kind the kind of expression
+ * @param child1 the first child of the new expression
+ * @param child2 the second child of the new expression
* @return the expression
*/
Expr mkExpr(Kind kind, const Expr& child1, const Expr& child2);
Node& Node::operator=(const Node& e) {
Assert(d_ev != NULL, "Expecting a non-NULL expression value!");
- if(this != &e && d_ev != e.d_ev) {
+ if((this != &e) && (d_ev != e.d_ev)) {
d_ev->dec();
d_ev = e.d_ev;
d_ev->inc();
NodeValue const* operator->() const;
/**
- * Assigns the expression value and does reference counting. No assumptions are
- * made on the expression, and should only be used if we know what we are
+ * Assigns the expression value and does reference counting. No assumptions
+ * are made on the expression, and should only be used if we know what we are
* doing.
*
* @param ev the expression value to assign
/********************* -*- C++ -*- */
-/** expr_manager.h
+/** node_manager.h
** This file is part of the CVC4 prototype.
** Copyright (c) 2009 The Analysis of Computer Systems Group (ACSys)
** Courant Institute of Mathematical Sciences