summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTianyi Liang <tianyi-liang@uiowa.edu>2015-02-25 10:49:14 -0600
committerTianyi Liang <tianyi-liang@uiowa.edu>2015-02-25 10:49:14 -0600
commit92e4099d9d2b313a521d2a015e604645e24617f4 (patch)
tree0e68f3f4d9d96f115f871cb5fa52c230023e71e4
parent57166b98acb6e226e385e6dd4aff9e45a0080aaf (diff)
Switch back to eager loop temporarily.
-rw-r--r--src/theory/strings/regexp_operation.cpp6
-rw-r--r--src/theory/strings/theory_strings_rewriter.cpp8
2 files changed, 9 insertions, 5 deletions
diff --git a/src/theory/strings/regexp_operation.cpp b/src/theory/strings/regexp_operation.cpp
index 061b1adb5..8d107d36a 100644
--- a/src/theory/strings/regexp_operation.cpp
+++ b/src/theory/strings/regexp_operation.cpp
@@ -1131,11 +1131,13 @@ void RegExpOpr::simplifyPRegExp( Node s, Node r, std::vector< Node > &new_nodes
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);
}
/*
diff --git a/src/theory/strings/theory_strings_rewriter.cpp b/src/theory/strings/theory_strings_rewriter.cpp
index 3396cc1a9..5bf44dce8 100644
--- a/src/theory/strings/theory_strings_rewriter.cpp
+++ b/src/theory/strings/theory_strings_rewriter.cpp
@@ -1199,6 +1199,7 @@ RewriteResponse TheoryStringsRewriter::preRewrite(TNode node) {
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).");
@@ -1239,8 +1240,9 @@ RewriteResponse TheoryStringsRewriter::preRewrite(TNode node) {
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()) {
@@ -1284,7 +1286,7 @@ RewriteResponse TheoryStringsRewriter::preRewrite(TNode node) {
:NodeManager::currentNM()->mkNode(kind::REGEXP_CONCAT,
NodeManager::currentNM()->mkNode(kind::REGEXP_CONCAT, vec_nodes), rest) );
}
- }*/
+ }
Trace("strings-lp") << "Strings::lp " << node << " => " << retNode << std::endl;
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback