summaryrefslogtreecommitdiff
path: root/src/theory/strings/theory_strings.cpp
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2018-03-21 08:03:48 -0500
committerGitHub <noreply@github.com>2018-03-21 08:03:48 -0500
commit8f0aae827e16f4dfcebb8dad2cc528649d40b16a (patch)
tree5fe4cfd49013cb0f46ea4641099b66083bb1e9a4 /src/theory/strings/theory_strings.cpp
parent614670f98a9ab2d3cfcb9f364a1b06d78f63ebb0 (diff)
Fix for string disequality processing (#1679)
Diffstat (limited to 'src/theory/strings/theory_strings.cpp')
-rw-r--r--src/theory/strings/theory_strings.cpp26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/theory/strings/theory_strings.cpp b/src/theory/strings/theory_strings.cpp
index 81b0118c5..b5a4370d4 100644
--- a/src/theory/strings/theory_strings.cpp
+++ b/src/theory/strings/theory_strings.cpp
@@ -3142,13 +3142,25 @@ int TheoryStrings::processReverseDeq( std::vector< Node >& nfi, std::vector< Nod
}
int TheoryStrings::processSimpleDeq( std::vector< Node >& nfi, std::vector< Node >& nfj, Node ni, Node nj, unsigned& index, bool isRev ){
- //see if one side is constant, if so, we can approximate as containment
- for( unsigned i=0; i<2; i++ ){
- Node c = getConstantEqc( i==0 ? ni : nj );
- if( !c.isNull() ){
- int findex, lindex;
- if( !TheoryStringsRewriter::canConstantContainList( c, i==0 ? nfj : nfi, findex, lindex ) ){
- return 1;
+ // See if one side is constant, if so, the disequality ni != nj is satisfied
+ // since ni does not contain nj or vice versa.
+ // This is only valid when isRev is false, since when isRev=true, the contents
+ // of normal form vectors nfi and nfj are reversed.
+ if (!isRev)
+ {
+ for (unsigned i = 0; i < 2; i++)
+ {
+ Node c = getConstantEqc(i == 0 ? ni : nj);
+ if (!c.isNull())
+ {
+ int findex, lindex;
+ if (!TheoryStringsRewriter::canConstantContainList(
+ c, i == 0 ? nfj : nfi, findex, lindex))
+ {
+ Trace("strings-solve-debug")
+ << "Disequality: constant cannot contain list" << std::endl;
+ return 1;
+ }
}
}
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback