summaryrefslogtreecommitdiff
path: root/src/theory/inference_manager_buffered.cpp
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2020-09-23 22:13:35 -0500
committerGitHub <noreply@github.com>2020-09-23 22:13:35 -0500
commit3075a8e20dba6a784316714543c8a1b262459d9a (patch)
tree1ef809c91de2f1a944331ea0cb93959c35126bcf /src/theory/inference_manager_buffered.cpp
parentaacc90c1234c488f49814fae6dbf0e720e2dfa88 (diff)
Modify lemma vs fact policy for datatype equalities (#5115)
This changes the lemma vs fact policy for datatype equalities. Previously, datatype equalities were sent as lemmas unless they were over datatypes that were composed of datatypes only. This is now changed so that equalities that do not involve direct subterms with finite non-datatype types are kept internal. The primary type of equality that this targets are "Instantiate" equalities, e.g. the conclusion of: (is-cons x) => x = (cons (head x) (tail x)) These equalities have been observed to generate large amounts of new terms for many benchmarks. With this PR, the the challenging Facebook benchmark goes from 2 min 45 sec -> 29 sec. If the instantiate rule is disabled altogether, it still correctly solves, and is faster (~14 seconds), which however is not correct in general. This change triggered two other issues: (1) A relations benchmark involving transitive closure now times out. This has been a common issue for the relations solver and should be revisited. (2) A potential issue with doPendingLemmas in InferenceManagerBuffer was uncovered. In rare cases, we can be re-entrant into this method since OutputChannel::lemma may trigger further preregistration of terms, which can trigger a recursive call to doPendingLemmas in the case of datatypes, which causes a segfault due to corrupting an iterator. This PR adds a simple guard for this method. This PR also fixes some existing issues in computing cardinality for parametric datatypes.
Diffstat (limited to 'src/theory/inference_manager_buffered.cpp')
-rw-r--r--src/theory/inference_manager_buffered.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/theory/inference_manager_buffered.cpp b/src/theory/inference_manager_buffered.cpp
index 1da814116..5699e75ad 100644
--- a/src/theory/inference_manager_buffered.cpp
+++ b/src/theory/inference_manager_buffered.cpp
@@ -25,7 +25,7 @@ namespace theory {
InferenceManagerBuffered::InferenceManagerBuffered(Theory& t,
TheoryState& state,
ProofNodeManager* pnm)
- : TheoryInferenceManager(t, state, pnm)
+ : TheoryInferenceManager(t, state, pnm), d_processingPendingLemmas(false)
{
}
@@ -94,12 +94,19 @@ void InferenceManagerBuffered::doPendingFacts()
void InferenceManagerBuffered::doPendingLemmas()
{
+ if (d_processingPendingLemmas)
+ {
+ // already processing
+ return;
+ }
+ d_processingPendingLemmas = true;
for (const std::unique_ptr<TheoryInference>& plem : d_pendingLem)
{
// process this lemma
plem->process(this, true);
}
d_pendingLem.clear();
+ d_processingPendingLemmas = false;
}
void InferenceManagerBuffered::doPendingPhaseRequirements()
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback