summaryrefslogtreecommitdiff
path: root/src/theory/strings
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2021-04-09 14:21:11 -0500
committerGitHub <noreply@github.com>2021-04-09 19:21:11 +0000
commit6923f0cb9930332a61e187d3b4d1a7ec7e65b15c (patch)
treedc6712e1b30352c60c9ca2f091b38136e2e92108 /src/theory/strings
parente5358e498db6d934d0b8704cfd023b0f67b6fbc0 (diff)
Add identifiers for extended function reductions (#6314)
This adds identifiers for extended function reductions, which are reasons for why an extended term no longer needs to be processed. The motivation is help understand check-model failures. This PR adds identifiers to the ExtTheory utility. It also cleans up some unused parts of this utility. Some blocks of code changed indentation in this class.
Diffstat (limited to 'src/theory/strings')
-rw-r--r--src/theory/strings/extf_solver.cpp13
-rw-r--r--src/theory/strings/inference_manager.cpp13
-rw-r--r--src/theory/strings/inference_manager.h9
-rw-r--r--src/theory/strings/regexp_solver.cpp12
4 files changed, 16 insertions, 31 deletions
diff --git a/src/theory/strings/extf_solver.cpp b/src/theory/strings/extf_solver.cpp
index fd50e78ee..6051bc4ca 100644
--- a/src/theory/strings/extf_solver.cpp
+++ b/src/theory/strings/extf_solver.cpp
@@ -132,7 +132,7 @@ bool ExtfSolver::doReduction(int effort, Node n)
}
// this depends on the current assertions, so this
// inference is context-dependent
- d_extt.markReduced(n, true);
+ d_extt.markReduced(n, ExtReducedId::STRINGS_NEG_CTN_DEQ, true);
return true;
}
else
@@ -183,7 +183,7 @@ bool ExtfSolver::doReduction(int effort, Node n)
Trace("strings-red-lemma") << "Reduction (positive contains) lemma : " << n
<< " => " << eq << std::endl;
// context-dependent because it depends on the polarity of n itself
- d_extt.markReduced(n, true);
+ d_extt.markReduced(n, ExtReducedId::STRINGS_POS_CTN, true);
}
else if (k != kind::STRING_TO_CODE)
{
@@ -297,7 +297,7 @@ void ExtfSolver::checkExtfEval(int effort)
{
if (effort < 3)
{
- d_extt.markReduced(n);
+ d_extt.markReduced(n, ExtReducedId::STRINGS_SR_CONST);
Trace("strings-extf-debug")
<< " resolvable by evaluation..." << std::endl;
std::vector<Node> exps;
@@ -549,7 +549,7 @@ void ExtfSolver::checkExtfInference(Node n,
else if (d_extt.hasFunctionKind(conc.getKind()))
{
// can mark as reduced, since model for n implies model for conc
- d_extt.markReduced(conc);
+ d_extt.markReduced(conc, ExtReducedId::STRINGS_CTN_DECOMPOSE);
}
}
}
@@ -730,9 +730,10 @@ std::string ExtfSolver::debugPrintModel()
for (const Node& n : extf)
{
ss << "- " << n;
- if (!d_extt.isActive(n))
+ ExtReducedId id;
+ if (!d_extt.isActive(n, id))
{
- ss << " :extt-inactive";
+ ss << " :extt-inactive " << id;
}
if (!d_extfInfoTmp[n].d_modelActive)
{
diff --git a/src/theory/strings/inference_manager.cpp b/src/theory/strings/inference_manager.cpp
index 8a0429fae..6f218e5be 100644
--- a/src/theory/strings/inference_manager.cpp
+++ b/src/theory/strings/inference_manager.cpp
@@ -268,18 +268,9 @@ bool InferenceManager::hasProcessed() const
return d_state.isInConflict() || hasPending();
}
-void InferenceManager::markCongruent(Node a, Node b)
+void InferenceManager::markReduced(Node n, ExtReducedId id, bool contextDepend)
{
- Assert(a.getKind() == b.getKind());
- if (d_extt.hasFunctionKind(a.getKind()))
- {
- d_extt.markCongruent(a, b);
- }
-}
-
-void InferenceManager::markReduced(Node n, bool contextDepend)
-{
- d_extt.markReduced(n, contextDepend);
+ d_extt.markReduced(n, id, contextDepend);
}
void InferenceManager::processConflict(const InferInfo& ii)
diff --git a/src/theory/strings/inference_manager.h b/src/theory/strings/inference_manager.h
index cfb8614ca..abc5c5709 100644
--- a/src/theory/strings/inference_manager.h
+++ b/src/theory/strings/inference_manager.h
@@ -220,18 +220,11 @@ class InferenceManager : public InferenceManagerBuffered
// ------------------------------------------------- extended theory
/**
- * Mark that terms a and b are congruent in the current context.
- * This makes a call to markCongruent in the extended theory object of
- * the parent theory if the kind of a (and b) is owned by the extended
- * theory.
- */
- void markCongruent(Node a, Node b);
- /**
* Mark that extended function is reduced. If contextDepend is true,
* then this mark is SAT-context dependent, otherwise it is user-context
* dependent (see ExtTheory::markReduced).
*/
- void markReduced(Node n, bool contextDepend = true);
+ void markReduced(Node n, ExtReducedId id, bool contextDepend = true);
// ------------------------------------------------- end extended theory
/**
diff --git a/src/theory/strings/regexp_solver.cpp b/src/theory/strings/regexp_solver.cpp
index 85d66cd54..151761329 100644
--- a/src/theory/strings/regexp_solver.cpp
+++ b/src/theory/strings/regexp_solver.cpp
@@ -361,14 +361,14 @@ bool RegExpSolver::checkEqcInclusion(std::vector<Node>& mems)
{
// ~str.in.re(x, R1) includes ~str.in.re(x, R2) --->
// mark ~str.in.re(x, R2) as reduced
- d_im.markReduced(m2Lit);
+ d_im.markReduced(m2Lit, ExtReducedId::STRINGS_REGEXP_INCLUDE_NEG);
remove.insert(m2);
}
else
{
// str.in.re(x, R1) includes str.in.re(x, R2) --->
// mark str.in.re(x, R1) as reduced
- d_im.markReduced(m1Lit);
+ d_im.markReduced(m1Lit, ExtReducedId::STRINGS_REGEXP_INCLUDE);
remove.insert(m1);
// We don't need to process m1 anymore
@@ -489,12 +489,12 @@ bool RegExpSolver::checkEqcIntersect(const std::vector<Node>& mems)
{
// if R1 = intersect( R1, R2 ), then x in R1 ^ x in R2 is equivalent
// to x in R1, hence x in R2 can be marked redundant.
- d_im.markReduced(m);
+ d_im.markReduced(m, ExtReducedId::STRINGS_REGEXP_INTER_SUBSUME);
}
else if (mresr == m)
{
// same as above, opposite direction
- d_im.markReduced(mi);
+ d_im.markReduced(mi, ExtReducedId::STRINGS_REGEXP_INTER_SUBSUME);
}
else
{
@@ -510,8 +510,8 @@ bool RegExpSolver::checkEqcIntersect(const std::vector<Node>& mems)
d_im.sendInference(
vec_nodes, mres, InferenceId::STRINGS_RE_INTER_INFER, false, true);
// both are reduced
- d_im.markReduced(m);
- d_im.markReduced(mi);
+ d_im.markReduced(m, ExtReducedId::STRINGS_REGEXP_INTER);
+ d_im.markReduced(mi, ExtReducedId::STRINGS_REGEXP_INTER);
// do not send more than one lemma for this class
return true;
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback