summaryrefslogtreecommitdiff
path: root/src/theory/inference_manager_buffered.h
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.h
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.h')
-rw-r--r--src/theory/inference_manager_buffered.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/theory/inference_manager_buffered.h b/src/theory/inference_manager_buffered.h
index 3d249ea80..74bbcc375 100644
--- a/src/theory/inference_manager_buffered.h
+++ b/src/theory/inference_manager_buffered.h
@@ -134,6 +134,12 @@ class InferenceManagerBuffered : public TheoryInferenceManager
std::vector<std::unique_ptr<TheoryInference>> d_pendingFact;
/** A map from literals to their pending phase requirement */
std::map<Node, bool> d_pendingReqPhase;
+ /**
+ * Whether we are currently processing pending lemmas. This flag ensures
+ * that we do not call pending lemmas recursively, which may lead to
+ * segfaults.
+ */
+ bool d_processingPendingLemmas;
};
} // namespace theory
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback