summaryrefslogtreecommitdiff
path: root/src/theory
diff options
context:
space:
mode:
Diffstat (limited to 'src/theory')
-rw-r--r--src/theory/booleans/theory_bool_rewriter.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/theory/booleans/theory_bool_rewriter.cpp b/src/theory/booleans/theory_bool_rewriter.cpp
index 02267cf2c..c53610efa 100644
--- a/src/theory/booleans/theory_bool_rewriter.cpp
+++ b/src/theory/booleans/theory_bool_rewriter.cpp
@@ -18,6 +18,7 @@
#include <algorithm>
#include <unordered_set>
+#include "expr/node_value.h"
#include "theory/booleans/theory_bool_rewriter.h"
namespace CVC4 {
@@ -77,17 +78,22 @@ RewriteResponse flattenNode(TNode n, TNode trivialNode, TNode skipNode)
/* Trickery to stay under number of children possible in a node */
NodeManager* nodeManager = NodeManager::currentNM();
- static const unsigned MAX_CHILDREN = (1u << CVC4__EXPR__NODE_VALUE__NBITS__NCHILDREN ) - 1;
- if (childList.size() < MAX_CHILDREN) {
+ if (childList.size() < expr::NodeValue::MAX_CHILDREN)
+ {
Node retNode = nodeManager->mkNode(k, childList);
return RewriteResponse(REWRITE_DONE, retNode);
- } else {
- Assert(childList.size() < size_t(MAX_CHILDREN) * size_t(MAX_CHILDREN) );
+ }
+ else
+ {
+ Assert(childList.size()
+ < static_cast<size_t>(expr::NodeValue::MAX_CHILDREN)
+ * static_cast<size_t>(expr::NodeValue::MAX_CHILDREN));
NodeBuilder<> nb(k);
ChildList::iterator cur = childList.begin(), next, en = childList.end();
- while( cur != en ) {
- next = min(cur + MAX_CHILDREN, en);
- nb << (nodeManager->mkNode(k, ChildList(cur, next) ));
+ while (cur != en)
+ {
+ next = min(cur + expr::NodeValue::MAX_CHILDREN, en);
+ nb << (nodeManager->mkNode(k, ChildList(cur, next)));
cur = next;
}
return RewriteResponse(REWRITE_DONE, nb.constructNode());
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback