summaryrefslogtreecommitdiff
path: root/src/theory/strings
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2020-02-27 13:48:50 -0600
committerGitHub <noreply@github.com>2020-02-27 11:48:50 -0800
commit0ad0496cd474a167973195d1ddc9322ada7f2b4e (patch)
treeb3c3c211382fbb6046229d3a0021a3a63ed921e2 /src/theory/strings
parent0f75e689f02def2a726887bfd927f534ddc0305a (diff)
Fix large models for strings (#3835)
Fixes #3375. Marking as "major" since in fact we produce incorrect models in production without the fix.
Diffstat (limited to 'src/theory/strings')
-rw-r--r--src/theory/strings/theory_strings.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/theory/strings/theory_strings.cpp b/src/theory/strings/theory_strings.cpp
index c2790fe42..cd1d0cd67 100644
--- a/src/theory/strings/theory_strings.cpp
+++ b/src/theory/strings/theory_strings.cpp
@@ -304,8 +304,13 @@ bool TheoryStrings::collectModelInfo(TheoryModel* m)
}
else
{
- Assert(len_value.getConst<Rational>() <= Rational(String::maxSize()))
- << "Exceeded UINT32_MAX in string model";
+ // must throw logic exception if we cannot construct the string
+ if (len_value.getConst<Rational>() > Rational(String::maxSize()))
+ {
+ std::stringstream ss;
+ ss << "Cannot generate model with string whose length exceeds UINT32_MAX";
+ throw LogicException(ss.str());
+ }
unsigned lvalue =
len_value.getConst<Rational>().getNumerator().toUnsignedInt();
std::map<unsigned, Node>::iterator itvu = values_used.find(lvalue);
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback