summaryrefslogtreecommitdiff
path: root/src/theory/theory_model.cpp
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2020-08-26 23:17:57 -0500
committerGitHub <noreply@github.com>2020-08-26 23:17:57 -0500
commit63905da0f55f99dfc1f4ab40a1ce61d3e7d58ce1 (patch)
tree75138b0c38fb43c2b86ffbcf034f2e192b15d1ab /src/theory/theory_model.cpp
parent34953e8f4d9928cd8a92177f104b87e56479b437 (diff)
Add irrelevant kinds infrastructure to TheoryModel (#4945)
Currently, Theory is responsible for implementing a computeRelevantTerms method collects the union of: (1) The terms appearing in its assertions and its shared terms, (2) The set of additional terms the theory believes are relevant. Currently, (1) is computed by an internal Theory method computeRelevantTermsInternal, and the overall computeRelevantTerms is overridden by the theory (for datatypes and arrays only) for also including (2). The new plan is that Theory will only need to compute (2). Computing (1) will be the job of ModelManager::collectAssertedTerms and the model manager will call Theory::computeRelevantTerms as an additional step prior to its calls to collect model info. This will make certain optimizations possible in theory combination (e.g. tracking asserted terms incrementally). This PR adds the ModelManager::collectAssertedTerms method and also adds infrastructure for irrelevant kinds in the model object (which have an analogous interface as when "unevaluated" kinds are marked during initialization). It does not connect the implementation yet. FYI @barrettcw
Diffstat (limited to 'src/theory/theory_model.cpp')
-rw-r--r--src/theory/theory_model.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/theory/theory_model.cpp b/src/theory/theory_model.cpp
index 31b44aa70..869e9100e 100644
--- a/src/theory/theory_model.cpp
+++ b/src/theory/theory_model.cpp
@@ -72,6 +72,12 @@ void TheoryModel::finishInit()
{
setSemiEvaluatedKind(kind::APPLY_UF);
}
+ // Equal and not terms are not relevant terms. In other words, asserted
+ // equalities and negations of predicates (as terms) do not need to be sent
+ // to the model. Regardless, theories should send information to the model
+ // that ensures that all assertions are satisfied.
+ setIrrelevantKind(EQUAL);
+ setIrrelevantKind(NOT);
}
void TheoryModel::reset(){
@@ -627,6 +633,13 @@ void TheoryModel::setSemiEvaluatedKind(Kind k)
d_semi_evaluated_kinds.insert(k);
}
+void TheoryModel::setIrrelevantKind(Kind k) { d_irrKinds.insert(k); }
+
+const std::set<Kind>& TheoryModel::getIrrelevantKinds() const
+{
+ return d_irrKinds;
+}
+
bool TheoryModel::isLegalElimination(TNode x, TNode val)
{
return !expr::hasSubtermKinds(d_unevaluated_kinds, val);
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback