}
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;
+ }
}
}
}
--- /dev/null
+(set-logic QF_S)
+(set-option :strings-exp true)
+(set-info :status sat)
+(declare-const input_0_1000 String)
+(assert (= (str.substr input_0_1000 0 4) "good"))
+(assert (= (str.substr input_0_1000 5 1) "I"))
+(assert (not (= input_0_1000 "goodAI")))
+(check-sat)