summaryrefslogtreecommitdiff
path: root/src/theory/strings/extf_solver.cpp
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2021-04-01 17:02:33 -0500
committerGitHub <noreply@github.com>2021-04-01 22:02:33 +0000
commitef2f19f8ba2a72d43586d1f4f364822dbe389aec (patch)
tree24bab218bc3930f360010f537a0be6cbefe0433d /src/theory/strings/extf_solver.cpp
parent7fa534c85cbb6eb2863f10840b39501a21acc0b9 (diff)
Simplify caching of regular expression unfolding (#6262)
This ensures that we always cache regular expressions in a user-dependent manner. Previously, we were erroneously caching in a SAT-dependent way for very rare cases when non-constant regular expressions were used. Since we never dependent on current assertions for the unfolding, there is no need to cache in the SAT context. This fixes the second benchmark from #6203. This PR also improves our traces for checking models in strings.
Diffstat (limited to 'src/theory/strings/extf_solver.cpp')
-rw-r--r--src/theory/strings/extf_solver.cpp31
1 files changed, 28 insertions, 3 deletions
diff --git a/src/theory/strings/extf_solver.cpp b/src/theory/strings/extf_solver.cpp
index 39bcb8f53..fd50e78ee 100644
--- a/src/theory/strings/extf_solver.cpp
+++ b/src/theory/strings/extf_solver.cpp
@@ -85,7 +85,7 @@ bool ExtfSolver::doReduction(int effort, Node n)
if (d_reduced.find(n)!=d_reduced.end())
{
// already sent a reduction lemma
- Trace("strings-extf-debug") << "...skip due to reduced" << std::endl;
+ Trace("strings-extf-debug") << "...skip due to reduced" << std::endl;
return false;
}
// determine the effort level to process the extf at
@@ -157,8 +157,7 @@ bool ExtfSolver::doReduction(int effort, Node n)
}
if (effort != r_effort)
{
-
- Trace("strings-extf-debug") << "...skip due to effort" << std::endl;
+ Trace("strings-extf-debug") << "...skip due to effort" << std::endl;
// not the right effort level to reduce
return false;
}
@@ -722,6 +721,32 @@ bool StringsExtfCallback::getCurrentSubstitution(
return true;
}
+std::string ExtfSolver::debugPrintModel()
+{
+ std::stringstream ss;
+ std::vector<Node> extf;
+ d_extt.getTerms(extf);
+ // each extended function should have at least one annotation below
+ for (const Node& n : extf)
+ {
+ ss << "- " << n;
+ if (!d_extt.isActive(n))
+ {
+ ss << " :extt-inactive";
+ }
+ if (!d_extfInfoTmp[n].d_modelActive)
+ {
+ ss << " :model-inactive";
+ }
+ if (d_reduced.find(n) != d_reduced.end())
+ {
+ ss << " :reduced";
+ }
+ ss << std::endl;
+ }
+ return ss.str();
+}
+
} // namespace strings
} // namespace theory
} // namespace cvc5
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback