summaryrefslogtreecommitdiff
path: root/src/theory/arith
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2021-06-24 06:37:20 -0500
committerGitHub <noreply@github.com>2021-06-24 11:37:20 +0000
commit4eaef5e472121396ee77023d49b23556ac69b747 (patch)
treeb103e2171e75fe6fa7157206f9d6588f16999207 /src/theory/arith
parent3f0fd456553223a59001a6bcdc714c3b56192787 (diff)
Fix linear arithmetic for duplicate lemmas in incremental (#6784)
The linear arithmetic solver was not robust to cases where a duplicate lemma is emitted. This leads to non-linear arithmetic not being called to check at full effort, leading to potential model soundness issues. Fixes #6773.
Diffstat (limited to 'src/theory/arith')
-rw-r--r--src/theory/arith/theory_arith_private.cpp20
-rw-r--r--src/theory/arith/theory_arith_private.h4
2 files changed, 14 insertions, 10 deletions
diff --git a/src/theory/arith/theory_arith_private.cpp b/src/theory/arith/theory_arith_private.cpp
index 97b29b6b3..98de1eeee 100644
--- a/src/theory/arith/theory_arith_private.cpp
+++ b/src/theory/arith/theory_arith_private.cpp
@@ -1830,15 +1830,15 @@ void TheoryArithPrivate::outputConflicts(){
}
}
-void TheoryArithPrivate::outputTrustedLemma(TrustNode lemma, InferenceId id)
+bool TheoryArithPrivate::outputTrustedLemma(TrustNode lemma, InferenceId id)
{
Debug("arith::channel") << "Arith trusted lemma: " << lemma << std::endl;
- d_containing.d_im.trustedLemma(lemma, id);
+ return d_containing.d_im.trustedLemma(lemma, id);
}
-void TheoryArithPrivate::outputLemma(TNode lem, InferenceId id) {
+bool TheoryArithPrivate::outputLemma(TNode lem, InferenceId id) {
Debug("arith::channel") << "Arith lemma: " << lem << std::endl;
- d_containing.d_im.lemma(lem, id);
+ return d_containing.d_im.lemma(lem, id);
}
void TheoryArithPrivate::outputTrustedConflict(TrustNode conf, InferenceId id)
@@ -3391,11 +3391,13 @@ bool TheoryArithPrivate::postCheck(Theory::Effort effortLevel)
if(getDioCuttingResource()){
TrustNode possibleLemma = dioCutting();
if(!possibleLemma.isNull()){
- emmittedConflictOrSplit = true;
d_hasDoneWorkSinceCut = false;
d_cutCount = d_cutCount + 1;
Debug("arith::lemma") << "dio cut " << possibleLemma << endl;
- outputTrustedLemma(possibleLemma, InferenceId::ARITH_DIO_CUT);
+ if (outputTrustedLemma(possibleLemma, InferenceId::ARITH_DIO_CUT))
+ {
+ emmittedConflictOrSplit = true;
+ }
}
}
}
@@ -3406,10 +3408,12 @@ bool TheoryArithPrivate::postCheck(Theory::Effort effortLevel)
{
++(d_statistics.d_externalBranchAndBounds);
d_cutCount = d_cutCount + 1;
- emmittedConflictOrSplit = true;
Debug("arith::lemma") << "rrbranch lemma"
<< possibleLemma << endl;
- outputTrustedLemma(possibleLemma, InferenceId::ARITH_BB_LEMMA);
+ if (outputTrustedLemma(possibleLemma, InferenceId::ARITH_BB_LEMMA))
+ {
+ emmittedConflictOrSplit = true;
+ }
}
}
diff --git a/src/theory/arith/theory_arith_private.h b/src/theory/arith/theory_arith_private.h
index b25fa4f69..dc3c8bbb8 100644
--- a/src/theory/arith/theory_arith_private.h
+++ b/src/theory/arith/theory_arith_private.h
@@ -695,8 +695,8 @@ private:
inline TheoryId theoryOf(TNode x) const { return d_containing.theoryOf(x); }
inline void debugPrintFacts() const { d_containing.debugPrintFacts(); }
inline context::Context* getSatContext() const { return d_containing.getSatContext(); }
- void outputTrustedLemma(TrustNode lem, InferenceId id);
- void outputLemma(TNode lem, InferenceId id);
+ bool outputTrustedLemma(TrustNode lem, InferenceId id);
+ bool outputLemma(TNode lem, InferenceId id);
void outputTrustedConflict(TrustNode conf, InferenceId id);
void outputConflict(TNode lit, InferenceId id);
void outputPropagate(TNode lit);
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback