summaryrefslogtreecommitdiff
path: root/src/theory
diff options
context:
space:
mode:
authorTianyi Liang <tianyi-liang@uiowa.edu>2014-05-07 15:49:09 -0500
committerTianyi Liang <tianyi-liang@uiowa.edu>2014-05-07 15:49:09 -0500
commite8bafcf829335a011c551b29f1700c485087bf56 (patch)
treeb00d3096e41602948d13a28e7f2486fe4c46669b /src/theory
parente563712558035d22bec712a978a6940f91d65148 (diff)
fix a bug in contain
Diffstat (limited to 'src/theory')
-rw-r--r--src/theory/strings/theory_strings.cpp4
-rw-r--r--src/theory/strings/theory_strings_preprocess.cpp9
2 files changed, 11 insertions, 2 deletions
diff --git a/src/theory/strings/theory_strings.cpp b/src/theory/strings/theory_strings.cpp
index e60e67ac1..e73cf5e9d 100644
--- a/src/theory/strings/theory_strings.cpp
+++ b/src/theory/strings/theory_strings.cpp
@@ -2846,12 +2846,16 @@ bool TheoryStrings::checkNegContains() {
}
} else if(!areDisequal(lenx, lens)) {
if(d_neg_ctn_ulen.find(atom) == d_neg_ctn_ulen.end()) {
+ lenx = NodeManager::currentNM()->mkNode(kind::STRING_LENGTH, x);
+ lens = NodeManager::currentNM()->mkNode(kind::STRING_LENGTH, s);
d_neg_ctn_ulen.insert( atom );
sendSplit(lenx, lens, "NEG-CTN-SP");
addedLemma = true;
}
} else {
if(d_neg_ctn_cached.find(atom) == d_neg_ctn_cached.end()) {
+ lenx = NodeManager::currentNM()->mkNode(kind::STRING_LENGTH, x);
+ lens = NodeManager::currentNM()->mkNode(kind::STRING_LENGTH, s);
Node b1 = NodeManager::currentNM()->mkBoundVar(NodeManager::currentNM()->integerType());
Node b1v = NodeManager::currentNM()->mkNode(kind::BOUND_VAR_LIST, b1);
Node g1 = Rewriter::rewrite( NodeManager::currentNM()->mkNode( kind::AND, NodeManager::currentNM()->mkNode( kind::GEQ, b1, d_zero ),
diff --git a/src/theory/strings/theory_strings_preprocess.cpp b/src/theory/strings/theory_strings_preprocess.cpp
index 0cccdf0ef..be419a36a 100644
--- a/src/theory/strings/theory_strings_preprocess.cpp
+++ b/src/theory/strings/theory_strings_preprocess.cpp
@@ -482,9 +482,14 @@ Node StringsPreprocess::simplify( Node t, std::vector< Node > &new_nodes ) {
Node cond = NodeManager::currentNM()->mkNode( kind::STRING_STRCTN, x, y );
Node c1 = x.eqNode( NodeManager::currentNM()->mkNode( kind::STRING_CONCAT, sk1, y, sk2 ) );
Node c2 = skw.eqNode( NodeManager::currentNM()->mkNode( kind::STRING_CONCAT, sk1, z, sk2 ) );
- //Node c3 = NodeManager::currentNM()->mkNode( kind::STRING_STRCTN, sk1, y ).negate();
+ Node c3 = NodeManager::currentNM()->mkNode(kind::STRING_STRCTN,
+ NodeManager::currentNM()->mkNode(kind::STRING_CONCAT, sk1,
+ NodeManager::currentNM()->mkNode(kind::STRING_SUBSTR_TOTAL, y, d_zero,
+ NodeManager::currentNM()->mkNode(kind::MINUS,
+ NodeManager::currentNM()->mkNode(kind::STRING_LENGTH, y),
+ NodeManager::currentNM()->mkConst(::CVC4::Rational(1))))), y).negate();
Node rr = Rewriter::rewrite( NodeManager::currentNM()->mkNode( kind::ITE, cond,
- NodeManager::currentNM()->mkNode( kind::AND, c1, c2), // c3
+ NodeManager::currentNM()->mkNode( kind::AND, c1, c2, c3),
skw.eqNode(x) ) );
new_nodes.push_back( rr );
rr = Rewriter::rewrite( NodeManager::currentNM()->mkNode(kind::GT, NodeManager::currentNM()->mkNode(kind::STRING_LENGTH, y), d_zero) );
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback