summaryrefslogtreecommitdiff
path: root/src/theory/strings
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2019-10-06 02:33:25 -0500
committerAndres Noetzli <andres.noetzli@gmail.com>2019-10-06 00:33:25 -0700
commit51f9809788e4d26a423d9812ceab0f6720550c1b (patch)
tree59c233fd8b18afa6ae3f2e6797f405de7417de5b /src/theory/strings
parent472c5a592c78e4757b3201f9e20908a4c645921b (diff)
Fix str to int reduction (#3358)
This fixes a corner case of the str-to-int reduction for the case where the argument is the empty string. This fixes #3357.
Diffstat (limited to 'src/theory/strings')
-rw-r--r--src/theory/strings/theory_strings_preprocess.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/theory/strings/theory_strings_preprocess.cpp b/src/theory/strings/theory_strings_preprocess.cpp
index d1eef656b..8e057a525 100644
--- a/src/theory/strings/theory_strings_preprocess.cpp
+++ b/src/theory/strings/theory_strings_preprocess.cpp
@@ -309,6 +309,9 @@ Node StringsPreprocess::simplify( Node t, std::vector< Node > &new_nodes ) {
lem = s.eqNode(nm->mkNode(APPLY_UF, us, d_zero));
conc2.push_back(lem);
+ lem = nm->mkNode(GT, lens, d_zero);
+ conc2.push_back(lem);
+
Node x = nm->mkBoundVar(nm->integerType());
Node xbv = nm->mkNode(BOUND_VAR_LIST, x);
Node g =
@@ -343,6 +346,7 @@ Node StringsPreprocess::simplify( Node t, std::vector< Node > &new_nodes ) {
// ELSE:
// stoit = U( len( s ) ) ^ U( 0 ) = 0 ^
// "" = Us( len( s ) ) ^ s = Us( 0 ) ^
+ // str.len( s ) > 0 ^
// forall x. (x>=0 ^ x < str.len(s)) =>
// Us( x ) = Ud( x ) ++ Us( x+1 ) ^
// U( x+1 ) = ( str.code( Ud( x ) ) - 48 ) + 10*U( x )
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback