diff options
author | Tim King <taking@cs.nyu.edu> | 2013-05-01 14:59:39 -0400 |
---|---|---|
committer | Tim King <taking@cs.nyu.edu> | 2013-05-01 14:59:39 -0400 |
commit | 94decb8503be1fcc894094a0f2656e25d8aef251 (patch) | |
tree | da7c9cffe109cc3249e45d44f6db1599d496b2b7 /src/theory/arith/constraint.cpp | |
parent | 88ce3a56088e4f3f509b565944ef8c6d36545423 (diff) |
Working on the new explanation system.
Diffstat (limited to 'src/theory/arith/constraint.cpp')
-rw-r--r-- | src/theory/arith/constraint.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/theory/arith/constraint.cpp b/src/theory/arith/constraint.cpp index e26687bf1..78b9d3494 100644 --- a/src/theory/arith/constraint.cpp +++ b/src/theory/arith/constraint.cpp @@ -922,6 +922,28 @@ bool ConstraintValue::proofIsEmpty() const{ return result; } +Node ConstraintValue::makeImplication(const std::vector<Constraint>& b) const{ + Node antecedent = makeConjunction(b); + Node implied = getLiteral(); + return antecedent.impNode(implied); +} + + +Node ConstraintValue::makeConjunction(const std::vector<Constraint>& b){ + NodeBuilder<> nb(kind::AND); + for(vector<Constraint>::const_iterator i = b.begin(), end = b.end(); i != end; ++i){ + Constraint b_i = *i; + b_i->explainBefore(nb, AssertionOrderSentinel); + } + if(nb.getNumChildren() >= 2){ + return nb; + }else if(nb.getNumChildren() == 1){ + return nb[0]; + }else{ + return mkBoolNode(true); + } +} + void ConstraintValue::explainBefore(NodeBuilder<>& nb, AssertionOrder order) const{ Assert(hasProof()); Assert(!isSelfExplaining() || assertedToTheTheory()); |