summaryrefslogtreecommitdiff
path: root/src/theory/strings/regexp_operation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/theory/strings/regexp_operation.cpp')
-rw-r--r--src/theory/strings/regexp_operation.cpp6
1 files changed, 4 insertions, 2 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);
}
/*
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback