summaryrefslogtreecommitdiff
path: root/src/theory/arith/arith_static_learner.h
diff options
context:
space:
mode:
authorAndres Noetzli <andres.noetzli@gmail.com>2021-04-06 09:33:52 -0700
committerGitHub <noreply@github.com>2021-04-06 16:33:52 +0000
commitcfe1431aaae7366dea1d3124742ee2b2c2a2511e (patch)
tree7c30457bef5857947102636bddc8cc3a05e9e3c5 /src/theory/arith/arith_static_learner.h
parente92b4504d5930234c852bf0fba8f5663ad4809e7 (diff)
Remove template argument from `NodeBuilder` (#6290)
Currently, NodeBuilder takes a single template argument: An integer that determines the expected number of arguments. This argument is used to determine the size of the d_inlineNvChildSpace array. This array is used to construct nodes inline. The advantage of this is that we don't have to allocate a NodeValue on the heap for the node under construction until we are sure that the node is new. While templating the array size may save some stack space (or avoid a heap allocation if we statically know that we a fixed number of children and that number is greater than 10), it complicates the code and leads to longer compile times. Thus, this commit removes the template argument and moves some of the NodeBuilder code to a source file for faster compilation. CPU build time before change (debug build): 2429.68s CPU build time after change (debug build): 2228.44s Signed-off-by: Andres Noetzli noetzli@amazon.com
Diffstat (limited to 'src/theory/arith/arith_static_learner.h')
-rw-r--r--src/theory/arith/arith_static_learner.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/theory/arith/arith_static_learner.h b/src/theory/arith/arith_static_learner.h
index 73810dedd..b96d7a86a 100644
--- a/src/theory/arith/arith_static_learner.h
+++ b/src/theory/arith/arith_static_learner.h
@@ -45,19 +45,22 @@ private:
public:
ArithStaticLearner(context::Context* userContext);
~ArithStaticLearner();
- void staticLearning(TNode n, NodeBuilder<>& learned);
+ void staticLearning(TNode n, NodeBuilder& learned);
void addBound(TNode n);
-private:
- void process(TNode n, NodeBuilder<>& learned, const TNodeSet& defTrue);
+ private:
+ void process(TNode n, NodeBuilder& learned, const TNodeSet& defTrue);
- void iteMinMax(TNode n, NodeBuilder<>& learned);
- void iteConstant(TNode n, NodeBuilder<>& learned);
+ void iteMinMax(TNode n, NodeBuilder& learned);
+ void iteConstant(TNode n, NodeBuilder& learned);
- /** These fields are designed to be accessible to ArithStaticLearner methods. */
- class Statistics {
- public:
+ /**
+ * These fields are designed to be accessible to ArithStaticLearner methods.
+ */
+ class Statistics
+ {
+ public:
IntStat d_iteMinMaxApplications;
IntStat d_iteConstantApplications;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback