conc = s.eqNode( r[0] );
if(r[0] != r[1]) {
unsigned char a = r[0].getConst<String>().getFirstChar();
+ unsigned char b = r[1].getConst<String>().getFirstChar();
a += 1;
- Node tmp = NodeManager::currentNM()->mkNode(kind::STRING_IN_REGEXP, s,
+ Node tmp = a!=b? NodeManager::currentNM()->mkNode(kind::STRING_IN_REGEXP, s,
NodeManager::currentNM()->mkNode(kind::REGEXP_RANGE,
NodeManager::currentNM()->mkConst( CVC4::String(a) ),
- r[1]));
+ r[1])) :
+ s.eqNode(r[1]);
conc = NodeManager::currentNM()->mkNode(kind::OR, conc, tmp);
}
/*
if(r.getKind() == kind::REGEXP_STAR) {
retNode = r;
} else {
+ /* //lazy
Node n1 = Rewriter::rewrite( node[1] );
if(!n1.isConst()) {
throw LogicException("re.loop contains non-constant integer (1).");
NodeManager::currentNM()->mkNode(kind::REGEXP_LOOP, node[0], n1, n1),
NodeManager::currentNM()->mkNode(kind::REGEXP_STAR, node[0]));
}
- }
- /*else {
+ }*/ //lazy
+ /*else {*/
+ // eager
TNode n1 = Rewriter::rewrite( node[1] );
//
if(!n1.isConst()) {
:NodeManager::currentNM()->mkNode(kind::REGEXP_CONCAT,
NodeManager::currentNM()->mkNode(kind::REGEXP_CONCAT, vec_nodes), rest) );
}
- }*/
+ }
Trace("strings-lp") << "Strings::lp " << node << " => " << retNode << std::endl;
}