set -ex
cd "$(dirname "$0")"
-libtoolize -cf || glibtoolize -cf
-aclocal -I config --force --install -Wall
+libtoolize -c -f || glibtoolize -c -f
+aclocal -I config --force --install -Wall || aclocal -I config --force
autoheader -I config -f -Wall
touch NEWS README AUTHORS ChangeLog
touch stamp-h
done
eval set x $ac_cvc4_rewritten_args
shift
-echo "args are now:" "${@}"
+dnl echo "args are now:" "${@}"
m4_divert_pop([PARSE_ARGS])dnl
])# CVC4_REWRITE_ARGS_FOR_BUILD_PROFILE
Node& Node::operator=(const Node& e) {
Assert(d_ev != NULL, "Expecting a non-NULL expression value!");
- if((this != &e) && (d_ev != e.d_ev)) {
+ Assert(e.d_ev != NULL, "Expecting a non-NULL expression value on RHS!");
+ if(EXPECT_TRUE( d_ev != e.d_ev )) {
d_ev->dec();
d_ev = e.d_ev;
d_ev->inc();
Node NodeManager::lookup(uint64_t hash, NodeValue* ev) {
Assert(this != NULL, "Whoops, we have a bad expression manager!");
+ Assert(ev != NULL, "lookup() expects a non-NULL NodeValue!");
+
hash_t::iterator i = d_hash.find(hash);
if(i == d_hash.end()) {
// insert
NodeValue* NodeManager::lookupNoInsert(uint64_t hash, NodeValue* ev) {
Assert(this != NULL, "Whoops, we have a bad expression manager!");
+ Assert(ev != NULL, "lookupNoInsert() expects a non-NULL NodeValue!");
+
hash_t::iterator i = d_hash.find(hash);
if(i == d_hash.end()) {
return NULL;
// variables are special, because duplicates are permitted
Node mkVar();
-
- // TODO: these use the current NM (but must be renamed)
- /*
- static Node mkExpr(Kind kind)
- { currentNM()->mkExpr(kind); }
- static Node mkExpr(Kind kind, Node child1);
- { currentNM()->mkExpr(kind, child1); }
- static Node mkExpr(Kind kind, Node child1, Node child2);
- { currentNM()->mkExpr(kind, child1, child2); }
- static Node mkExpr(Kind kind, Node child1, Node child2, Node child3);
- { currentNM()->mkExpr(kind, child1, child2, child3); }
- static Node mkExpr(Kind kind, Node child1, Node child2, Node child3, Node child4);
- { currentNM()->mkExpr(kind, child1, child2, child3, child4); }
- static Node mkExpr(Kind kind, Node child1, Node child2, Node child3, Node child4, Node child5);
- { currentNM()->mkExpr(kind, child1, child2, child3, child4, child5); }
- */
-
- // do we want a varargs one? perhaps not..
};
}/* CVC4 namespace */
return computeHash(d_kind, ev_begin(), ev_end());
}
-NodeValue* NodeValue::inc() {
+void NodeValue::inc() {
// FIXME multithreading
- if(d_rc < MAX_RC)
+ if(EXPECT_TRUE( d_rc < MAX_RC )) {
++d_rc;
- return this;
+ }
}
-NodeValue* NodeValue::dec() {
+void NodeValue::dec() {
// FIXME multithreading
- if(d_rc < MAX_RC) {
- if(--d_rc == 0) {
+ if(EXPECT_TRUE( d_rc < MAX_RC )) {
+ --d_rc;
+ if(EXPECT_FALSE( d_rc == 0 )) {
// FIXME gc
- return 0;
}
}
- return this;
}
NodeValue::iterator NodeValue::begin() {
return node_iterator(d_children + d_nchildren);
}
-NodeValue::iterator NodeValue::rbegin() {
- return node_iterator(d_children + d_nchildren - 1);
-}
-
-NodeValue::iterator NodeValue::rend() {
- return node_iterator(d_children - 1);
-}
-
NodeValue::const_iterator NodeValue::begin() const {
return const_node_iterator(d_children);
}
return const_node_iterator(d_children + d_nchildren);
}
-NodeValue::const_iterator NodeValue::rbegin() const {
- return const_node_iterator(d_children + d_nchildren - 1);
-}
-
-NodeValue::const_iterator NodeValue::rend() const {
- return const_node_iterator(d_children - 1);
-}
-
NodeValue::ev_iterator NodeValue::ev_begin() {
return d_children;
}
return d_children + d_nchildren;
}
-NodeValue::ev_iterator NodeValue::ev_rbegin() {
- return d_children + d_nchildren - 1;
-}
-
-NodeValue::ev_iterator NodeValue::ev_rend() {
- return d_children - 1;
-}
-
NodeValue::const_ev_iterator NodeValue::ev_begin() const {
return d_children;
}
return d_children + d_nchildren;
}
-NodeValue::const_ev_iterator NodeValue::ev_rbegin() const {
- return d_children + d_nchildren - 1;
-}
-
-NodeValue::const_ev_iterator NodeValue::ev_rend() const {
- return d_children - 1;
-}
-
string NodeValue::toString() const {
stringstream ss;
toStream(ss);
template <unsigned> friend class CVC4::NodeBuilder;
friend class CVC4::NodeManager;
- NodeValue* inc();
- NodeValue* dec();
+ void inc();
+ void dec();
static size_t next_id;
ev_iterator ev_begin();
ev_iterator ev_end();
- ev_iterator ev_rbegin();
- ev_iterator ev_rend();
const_ev_iterator ev_begin() const;
const_ev_iterator ev_end() const;
- const_ev_iterator ev_rbegin() const;
- const_ev_iterator ev_rend() const;
class node_iterator {
const_ev_iterator d_i;
iterator begin();
iterator end();
- iterator rbegin();
- iterator rend();
const_iterator begin() const;
const_iterator end() const;
- const_iterator rbegin() const;
- const_iterator rend() const;
unsigned getId() const { return d_id; }
Kind getKind() const { return (Kind) d_kind; }