if( s.size() != index_start ) {
std::vector<int> vec_k( r.getNumChildren(), -1 );
int start = 0;
- int left = (int) s.size();
+ int left = (int) s.size() - index_start;
int i=0;
while( i<(int) r.getNumChildren() ) {
bool flag = true;
} else if( i == -1 ) {
return false;
} else {
- for(vec_k[i] = vec_k[i] + 1; vec_k[i] <= left; ++vec_k[i]) {
+ for(vec_k[i] = vec_k[i] + 1; vec_k[i] <= left - start; ++vec_k[i]) {
CVC4::String t = s.substr(index_start + start, vec_k[i]);
if( testConstStringInRegExp( t, 0, r[i] ) ) {
start += vec_k[i]; left -= vec_k[i]; flag = false;
}
default: {
Trace("strings-error") << "Unsupported term: " << r << " in testConstStringInRegExp." << std::endl;
- //Assert( false, "Unsupported Term" );
Unreachable();
return false;
}
--- /dev/null
+(set-logic ASLIA)\r
+(set-info :smt-lib-version 2.0)\r
+(set-option :strings-exp true)\r
+(set-info :status sat)\r
+\r
+; regex = [\*-,\t\*-\|](.{6,}()?)+\r
+(define-fun strinre ((?s String)) Bool (str.in.re ?s (re.union re.nostr (re.++ (str.to.re "") (str.to.re "") (re.union re.nostr (re.range "*" ",") (str.to.re "\t") (re.range "*" "|") ) (re.+ (re.union re.nostr (re.++ (str.to.re "") (str.to.re "") (re.loop re.allchar 6 ) (re.opt (re.union re.nostr (re.++ (str.to.re "") (str.to.re "") ) ) ) ) ) ) ) ) ) )\r
+(assert (not (strinre "6O\1\127\n?")))\r
+\r
+(check-sat)
\ No newline at end of file