Node pbv_e = its->second.evaluate(bvr, pt_index);
Assert(bv_e != pbv_e);
Trace("sygus-rr-debug") << "; unsound: where they evaluate to "
- << pbv_e << " and " << bv_e << std::endl;
+ << bv_e << " and " << pbv_e << std::endl;
}
else
{
unsigned prev_new_nodes = new_nodes.size();
Trace("strings-preprocess-debug") << "StringsPreprocess::simplify: " << t << std::endl;
Node retNode = t;
+ NodeManager *nm = NodeManager::currentNM();
if( t.getKind() == kind::STRING_SUBSTR ) {
Node skt;
Node lemma = NodeManager::currentNM()->mkNode( kind::ITE, cond, b1, b2 );
new_nodes.push_back( lemma );
retNode = skt;
- } else if( t.getKind() == kind::STRING_STRIDOF ) {
- Node sk2 = NodeManager::currentNM()->mkSkolem( "io2", NodeManager::currentNM()->stringType(), "created for indexof" );
- Node sk3 = NodeManager::currentNM()->mkSkolem( "io3", NodeManager::currentNM()->stringType(), "created for indexof" );
- Node sk4 = NodeManager::currentNM()->mkSkolem( "io4", NodeManager::currentNM()->stringType(), "created for indexof" );
+ }
+ else if (t.getKind() == kind::STRING_STRIDOF)
+ {
+ // processing term: indexof( x, y, n )
+
Node skk;
if( options::stringUfReduct() ){
skk = getUfAppForNode( kind::STRING_STRIDOF, t );
}else{
- skk = NodeManager::currentNM()->mkSkolem( "iok", NodeManager::currentNM()->integerType(), "created for indexof" );
+ skk = nm->mkSkolem("iok", nm->integerType(), "created for indexof");
}
- Node st = NodeManager::currentNM()->mkNode( kind::STRING_SUBSTR, t[0], t[2], NodeManager::currentNM()->mkNode( kind::MINUS, NodeManager::currentNM()->mkNode( kind::STRING_LENGTH, t[0] ), t[2] ) );
- //TODO: simplify this (only applies when idof != -1)
- Node eq = st.eqNode( NodeManager::currentNM()->mkNode( kind::STRING_CONCAT, sk2, sk3, sk4 ) );
- new_nodes.push_back( eq );
-
- //learn range of idof?
- Node negone = NodeManager::currentNM()->mkConst( ::CVC4::Rational(-1) );
- Node krange = NodeManager::currentNM()->mkNode( kind::GEQ, skk, negone );
+
+ Node negone = nm->mkConst(::CVC4::Rational(-1));
+ Node krange = nm->mkNode(kind::GEQ, skk, negone);
+ // assert: indexof( x, y, n ) >= -1
new_nodes.push_back( krange );
- krange = NodeManager::currentNM()->mkNode( kind::GT, NodeManager::currentNM()->mkNode( kind::STRING_LENGTH, t[0] ), skk);
+ krange = nm->mkNode(kind::GEQ, nm->mkNode(kind::STRING_LENGTH, t[0]), skk);
+ // assert: len( x ) >= indexof( x, y, z )
new_nodes.push_back( krange );
- // s2 = ""
- Node c1 = t[1].eqNode( NodeManager::currentNM()->mkConst( ::CVC4::String("") ) );
- //~contain(t234, s2)
- Node c3 = NodeManager::currentNM()->mkNode( kind::STRING_STRCTN, st, t[1] ).negate();
- //left
- Node left = NodeManager::currentNM()->mkNode( kind::OR, c1, c3 );
- //t3 = s2
- Node c4 = t[1].eqNode( sk3 );
- //~contain(t2, s2)
- Node c5 = NodeManager::currentNM()->mkNode( kind::STRING_STRCTN,
- NodeManager::currentNM()->mkNode(kind::STRING_CONCAT, sk2,
- NodeManager::currentNM()->mkNode(kind::STRING_SUBSTR, t[1], d_zero,
- NodeManager::currentNM()->mkNode(kind::MINUS,
- NodeManager::currentNM()->mkNode(kind::STRING_LENGTH, t[1]),
- NodeManager::currentNM()->mkConst( ::CVC4::Rational(1) )))),
- t[1] ).negate();
- //k=str.len(s2)
- Node c6 = skk.eqNode( NodeManager::currentNM()->mkNode( kind::PLUS, t[2],
- NodeManager::currentNM()->mkNode( kind::STRING_LENGTH, sk2 )) );
- //right
- Node right = NodeManager::currentNM()->mkNode( kind::AND, c4, c5, c6, c1.negate() );
- Node cond = skk.eqNode( negone );
- Node rr = NodeManager::currentNM()->mkNode( kind::ITE, cond, left, right );
+ // substr( x, n, len( x ) - n )
+ Node st = nm->mkNode(
+ kind::STRING_SUBSTR,
+ t[0],
+ t[2],
+ nm->mkNode(kind::MINUS, nm->mkNode(kind::STRING_LENGTH, t[0]), t[2]));
+ Node io2 = nm->mkSkolem("io2", nm->stringType(), "created for indexof");
+ Node io4 = nm->mkSkolem("io4", nm->stringType(), "created for indexof");
+
+ // ~contains( substr( x, n, len( x ) - n ), y )
+ Node c11 = nm->mkNode(kind::STRING_STRCTN, st, t[1]).negate();
+ // n > len( x )
+ Node c12 =
+ nm->mkNode(kind::GT, t[2], nm->mkNode(kind::STRING_LENGTH, t[0]));
+ // 0 > n
+ Node c13 = nm->mkNode(kind::GT, d_zero, t[2]);
+ Node cond1 = nm->mkNode(kind::OR, c11, c12, c13);
+ // skk = -1
+ Node cc1 = skk.eqNode(negone);
+
+ // y = ""
+ Node cond2 = t[1].eqNode(nm->mkConst(CVC4::String("")));
+ // skk = n
+ Node cc2 = skk.eqNode(t[2]);
+
+ // substr( x, n, len( x ) - n ) = str.++( io2, y, io4 )
+ Node c31 = st.eqNode(nm->mkNode(kind::STRING_CONCAT, io2, t[1], io4));
+ // ~contains( str.++( io2, substr( y, 0, len( y ) - 1) ), y )
+ Node c32 =
+ nm->mkNode(
+ kind::STRING_STRCTN,
+ nm->mkNode(
+ kind::STRING_CONCAT,
+ io2,
+ nm->mkNode(kind::STRING_SUBSTR,
+ t[1],
+ d_zero,
+ nm->mkNode(kind::MINUS,
+ nm->mkNode(kind::STRING_LENGTH, t[1]),
+ d_one))),
+ t[1])
+ .negate();
+ // skk = n + len( io2 )
+ Node c33 = skk.eqNode(
+ nm->mkNode(kind::PLUS, t[2], nm->mkNode(kind::STRING_LENGTH, io2)));
+ Node cc3 = nm->mkNode(kind::AND, c31, c32, c33);
+
+ // assert:
+ // IF: ~contains( substr( x, n, len( x ) - n ), y ) OR n > len(x) OR 0 > n
+ // THEN: skk = -1
+ // ELIF: y = ""
+ // THEN: skk = n
+ // ELSE: substr( x, n, len( x ) - n ) = str.++( io2, y, io4 ) ^
+ // ~contains( str.++( io2, substr( y, 0, len( y ) - 1) ), y ) ^
+ // skk = n + len( io2 )
+ // for fresh io2, io4.
+ Node rr = nm->mkNode(
+ kind::ITE, cond1, cc1, nm->mkNode(kind::ITE, cond2, cc2, cc3));
new_nodes.push_back( rr );
+
+ // Thus, indexof( x, y, n ) = skk.
retNode = skk;
} else if( t.getKind() == kind::STRING_ITOS ) {
//Node num = Rewriter::rewrite(NodeManager::currentNM()->mkNode(kind::ITE,
NodeManager::currentNM()->mkNode(kind::OR, cc1, cc2), cc3);
new_nodes.push_back( conc );
retNode = pret;
- } else if( t.getKind() == kind::STRING_STRREPL ) {
+ }
+ else if (t.getKind() == kind::STRING_STRREPL)
+ {
+ // processing term: replace( x, y, z )
Node x = t[0];
Node y = t[1];
Node z = t[2];
- Node sk1 = NodeManager::currentNM()->mkSkolem( "rp1", t[0].getType(), "created for replace" );
- Node sk2 = NodeManager::currentNM()->mkSkolem( "rp2", t[0].getType(), "created for replace" );
- Node skw = NodeManager::currentNM()->mkSkolem( "rpw", t[0].getType(), "created for replace" );
- Node cond = NodeManager::currentNM()->mkNode( kind::STRING_STRCTN, x, y );
- cond = NodeManager::currentNM()->mkNode( kind::AND, cond, NodeManager::currentNM()->mkNode(kind::GT, NodeManager::currentNM()->mkNode(kind::STRING_LENGTH, y), d_zero) );
- 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,
- NodeManager::currentNM()->mkNode(kind::STRING_CONCAT, sk1,
- NodeManager::currentNM()->mkNode(kind::STRING_SUBSTR, 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 = NodeManager::currentNM()->mkNode( kind::ITE, cond,
- NodeManager::currentNM()->mkNode( kind::AND, c1, c2, c3),
- skw.eqNode(x) );
+ TypeNode tn = t[0].getType();
+ Node rp1 = nm->mkSkolem("rp1", tn, "created for replace");
+ Node rp2 = nm->mkSkolem("rp2", tn, "created for replace");
+ Node rpw = nm->mkSkolem("rpw", tn, "created for replace");
+
+ // y = ""
+ Node cond1 = y.eqNode(nm->mkConst(CVC4::String("")));
+ // rpw = str.++( z, x )
+ Node c1 = rpw.eqNode(nm->mkNode(kind::STRING_CONCAT, z, x));
+
+ // contains( x, y )
+ Node cond2 = nm->mkNode(kind::STRING_STRCTN, x, y);
+ // x = str.++( rp1, y, rp2 )
+ Node c21 = x.eqNode(nm->mkNode(kind::STRING_CONCAT, rp1, y, rp2));
+ // rpw = str.++( rp1, z, rp2 )
+ Node c22 = rpw.eqNode(nm->mkNode(kind::STRING_CONCAT, rp1, z, rp2));
+ // ~contains( str.++( rp1, substr( y, 0, len(y)-1 ) ), y )
+ Node c23 =
+ nm->mkNode(kind::STRING_STRCTN,
+ nm->mkNode(
+ kind::STRING_CONCAT,
+ rp1,
+ nm->mkNode(kind::STRING_SUBSTR,
+ y,
+ d_zero,
+ nm->mkNode(kind::MINUS,
+ nm->mkNode(kind::STRING_LENGTH, y),
+ d_one))),
+ y)
+ .negate();
+
+ // assert:
+ // IF y=""
+ // THEN: rpw = str.++( z, x )
+ // ELIF: contains( x, y )
+ // THEN: x = str.++( rp1, y, rp2 ) ^
+ // rpw = str.++( rp1, z, rp2 ) ^
+ // ~contains( str.++( rp1, substr( y, 0, len(y)-1 ) ), y ),
+ // ELSE: rpw = x
+ // for fresh rp1, rp2, rpw
+ Node rr = nm->mkNode(kind::ITE,
+ cond1,
+ c1,
+ nm->mkNode(kind::ITE,
+ cond2,
+ nm->mkNode(kind::AND, c21, c22, c23),
+ rpw.eqNode(x)));
new_nodes.push_back( rr );
- retNode = skw;
+
+ // Thus, replace( x, y, z ) = rpw.
+ retNode = rpw;
} else if( t.getKind() == kind::STRING_STRCTN ){
Node x = t[0];
Node s = t[1];
return returnRewrite(node, negone, "idof-neg");
}
- if (node[1].isConst())
- {
- if (node[1].getConst<String>().size() == 0)
- {
- // str.indexof( x, "", z ) --> -1
- Node negone = nm->mkConst(Rational(-1));
- return returnRewrite(node, negone, "idof-empty");
- }
- }
-
// evaluation and simple cases
std::vector<Node> children0;
getConcat(node[0], children0);
{
fstr = nm->mkNode(kind::STRING_SUBSTR, node[0], node[2], len0);
fstr = Rewriter::rewrite(fstr);
- if (fstr.isConst())
- {
- CVC4::String fs = fstr.getConst<String>();
- if (fs.size() == 0)
- {
- // substr( x, z, len(x) ) --> "" implies str.indexof( x, y, z ) --> -1
- Node negone = nm->mkConst(Rational(-1));
- return returnRewrite(node, negone, "idof-base-len");
- }
- }
}
Node cmp_con = nm->mkNode(kind::STRING_STRCTN, fstr, node[1]);
Node TheoryStringsRewriter::rewriteReplace( Node node ) {
Assert(node.getKind() == kind::STRING_STRREPL);
- if( node[1]==node[2] ){
+ NodeManager* nm = NodeManager::currentNM();
+
+ if (node[1] == node[2])
+ {
return returnRewrite(node, node[0], "rpl-id");
}
- if (node[0].isConst())
+
+ if (node[0] == node[1])
{
- CVC4::String s = node[0].getConst<String>();
- if (s.isEmptyString())
- {
- return returnRewrite(node, node[0], "rpl-empty");
- }
- if (node[0] == node[2] && s.size() == 1)
- {
- // str.replace( "A", x, "A" ) -> "A"
- return returnRewrite(node, node[0], "rpl-char-id");
- }
+ return returnRewrite(node, node[2], "rpl-replace");
}
+
if (node[1].isConst() && node[1].getConst<String>().isEmptyString())
{
- return returnRewrite(node, node[0], "rpl-rpl-empty");
+ Node ret = nm->mkNode(STRING_CONCAT, node[2], node[0]);
+ return returnRewrite(node, ret, "rpl-rpl-empty");
}
std::vector<Node> children0;
{
if (cmp_conr.getConst<bool>())
{
- // currently by the semantics of replace, if the second argument is
- // empty, then we return the first argument.
- // hence, we test whether the second argument must be non-empty here.
- // if it definitely non-empty, we can use rules that successfully replace
- // node[1]->node[2] among those below.
- Node l1 = NodeManager::currentNM()->mkNode(kind::STRING_LENGTH, node[1]);
- Node zero = NodeManager::currentNM()->mkConst(CVC4::Rational(0));
- bool is_non_empty = checkEntailArith(l1, zero, true);
-
- if (node[0] == node[1] && is_non_empty)
- {
- return returnRewrite(node, node[2], "rpl-replace");
- }
// component-wise containment
std::vector<Node> cb;
std::vector<Node> ce;
int cc = componentContains(children0, children1, cb, ce, true, 1);
if (cc != -1)
{
- if (cc == 0 && children0[0] == children1[0] && is_non_empty)
+ if (cc == 0 && children0[0] == children1[0])
{
// definitely a prefix, can do the replace
// for example,
if (cmp_conr != cmp_con)
{
- // pull endpoints that can be stripped
- // for example,
- // str.replace( str.++( "b", x, "b" ), "a", y ) --->
- // str.++( "b", str.replace( x, "a", y ), "b" )
- std::vector<Node> cb;
- std::vector<Node> ce;
- if (stripConstantEndpoints(children0, children1, cb, ce))
+ if (checkEntailNonEmpty(node[1]))
{
- std::vector<Node> cc;
- cc.insert(cc.end(), cb.begin(), cb.end());
- cc.push_back(NodeManager::currentNM()->mkNode(
- kind::STRING_STRREPL,
- mkConcat(kind::STRING_CONCAT, children0),
- node[1],
- node[2]));
- cc.insert(cc.end(), ce.begin(), ce.end());
- Node ret = mkConcat(kind::STRING_CONCAT, cc);
- return returnRewrite(node, ret, "rpl-pull-endpt");
+ // pull endpoints that can be stripped
+ // for example,
+ // str.replace( str.++( "b", x, "b" ), "a", y ) --->
+ // str.++( "b", str.replace( x, "a", y ), "b" )
+ std::vector<Node> cb;
+ std::vector<Node> ce;
+ if (stripConstantEndpoints(children0, children1, cb, ce))
+ {
+ std::vector<Node> cc;
+ cc.insert(cc.end(), cb.begin(), cb.end());
+ cc.push_back(NodeManager::currentNM()->mkNode(
+ kind::STRING_STRREPL,
+ mkConcat(kind::STRING_CONCAT, children0),
+ node[1],
+ node[2]));
+ cc.insert(cc.end(), ce.begin(), ce.end());
+ Node ret = mkConcat(kind::STRING_CONCAT, cc);
+ return returnRewrite(node, ret, "rpl-pull-endpt");
+ }
}
}
NodeManager::currentNM()->mkNode(kind::STRING_LENGTH, n2[0]);
if (dir == 1)
{
- // To be suffix, start + length must be greater than
+ // To be a suffix, start + length must be greater than
// or equal to the length of the string.
success = checkEntailArith(end_pos, len_n2s);
}
else if (dir == -1)
{
- // To be prefix, must literally start at 0, since
+ // To be a prefix, must literally start at 0, since
// if we knew it started at <0, it should be rewritten to "",
// if we knew it started at 0, then n2[1] should be rewritten to
// 0.
{
if (computeRemainder)
{
+ // we can only compute the remainder if start_pos and end_pos
+ // are known to be non-negative.
+ if (!checkEntailArith(start_pos) || !checkEntailArith(end_pos))
+ {
+ return false;
+ }
if (dir != 1)
{
n1rb = NodeManager::currentNM()->mkNode(
return changed;
}
+bool TheoryStringsRewriter::checkEntailNonEmpty(Node a)
+{
+ Node len = NodeManager::currentNM()->mkNode(STRING_LENGTH, a);
+ len = Rewriter::rewrite(len);
+ return checkEntailArith(len, true);
+}
+
bool TheoryStringsRewriter::checkEntailArithEq(Node a, Node b)
{
if (a == b)
* Context-Dependent Rewriting", CAV 2017.
*/
static Node rewriteContains(Node node);
+ /** rewrite indexof
+ * This is the entry point for post-rewriting terms n of the form
+ * str.indexof( s, t, n )
+ * Returns the rewritten form of node.
+ */
static Node rewriteIndexof(Node node);
/** rewrite replace
* This is the entry point for post-rewriting terms n of the form
* str.replace( s, t, r )
- * Returns the rewritten form of n.
+ * Returns the rewritten form of node.
*/
- static Node rewriteReplace(Node n);
+ static Node rewriteReplace(Node node);
/** rewrite prefix/suffix
* This is the entry point for post-rewriting terms n of the form
* str.prefixof( s, t ) / str.suffixof( s, t )
- * Returns the rewritten form of n.
+ * Returns the rewritten form of node.
*/
- static Node rewritePrefixSuffix(Node n);
+ static Node rewritePrefixSuffix(Node node);
/** gets the "vector form" of term n, adds it to c.
* For example:
* componentContainsBase(y, str.substr(y,0,5), n1rb, n1re, -1, true)
* returns true,
* n1re is set to str.substr(y,5,str.len(y)).
+ *
+ *
+ * Notice that this function may return false when it cannot compute a
+ * remainder when it otherwise would have returned true. For example:
+ *
+ * componentContainsBase(y, str.substr(y,x,z), n1rb, n1re, 0, false)
+ * returns true.
+ *
+ * Hence, we know that str.substr(y,x,z) is contained in y. However:
+ *
+ * componentContainsBase(y, str.substr(y,x,z), n1rb, n1re, 0, true)
+ * returns false.
+ *
+ * The reason is since computeRemainder=true, it must be that
+ * y = str.++( n1rb, str.substr(y,x,z), n1re )
+ * for some n1rb, n1re. However, to construct such n1rb, n1re would require
+ * e.g. the terms:
+ * y = str.++( ite( x+z < 0 OR x < 0, "", str.substr(y,0,x) ),
+ * str.substr(y,x,z),
+ * ite( x+z < 0 OR x < 0, y, str.substr(y,x+z,len(y)) ) )
+ *
+ * Since we do not wish to introduce ITE terms in the rewriter, we instead
+ * return false, indicating that we cannot compute the remainder.
*/
static bool componentContainsBase(
Node n1, Node n2, Node& n1rb, Node& n1re, int dir, bool computeRemainder);
std::vector<Node>& nb,
std::vector<Node>& ne,
int dir = 0);
+ /** entail non-empty
+ *
+ * Checks whether string a is entailed to be non-empty. Is equivalent to
+ * the call checkArithEntail( len( a ), true ).
+ */
+ static bool checkEntailNonEmpty(Node a);
/** check arithmetic entailment equal
* Returns true if it is always the case that a = b.
*/
(set-logic SLIA)
(set-option :strings-exp true)
-(set-info :status unsat)
+(set-info :status sat)
(declare-fun x () String)
(assert (not (= (str.indexof x "" 0) (- 1))))
-(check-sat)
\ No newline at end of file
+(check-sat)
(declare-fun x () String)
(declare-fun y () String)
(assert (or
-(not (= (str.replace "" "" "c") ""))
+(not (= (str.replace "" "" "c") "c"))
(not (= (str.replace (str.++ "abc" y) "b" x) (str.++ "a" x "c" y)))
(not (= (str.replace "" "abc" "de") ""))
(not (= (str.replace "ab" "ab" "de") "de"))
-(not (= (str.replace "ab" "" "de") "ab"))
+(not (= (str.replace "ab" "" "de") "deab"))
+(not (= (str.replace "abb" "b" "de") "adeb"))
))
(check-sat)
bug768.smt2 \
bug799-min.smt2 \
chapman150408.smt2 \
- cmu-disagree-0707-dd.smt2 \
cmu-inc-nlpp-071516.smt2 \
cmu-substr-rw.smt2 \
crash-1019.smt2 \
str002.smt2 \
str007.smt2 \
rew-020618.smt2 \
- double-replace.smt2
+ double-replace.smt2 \
+ string-unsound-sem.smt2
EXTRA_DIST = $(TESTS)
+++ /dev/null
-(set-logic ALL_SUPPORTED)
-(set-info :status sat)
-(set-option :strings-exp true)
-
-(declare-fun url () String)
-
-(assert
-(and
-(and
-(and
-(and
-
-(= (str.len (str.substr (str.substr url (str.indexof url "#" 2) (- (str.len url) (str.indexof url "#" 2))) (+ (str.indexof (str.substr url (str.indexof url "#" 2) (- (str.len url) (str.indexof url "#" 2))) "#" 0) 1) (- (str.len (str.substr url (str.indexof url "#" 2) (- (str.len url) (str.indexof url "#" 2)))) (+ (str.indexof (str.substr url (str.indexof url "#" 2) (- (str.len url) (str.indexof url "#" 2))) "#" 0) 1)))) 0)
-
-(not (= (str.substr url 0 (- (str.indexof url ":" 0) 0)) "http")))
-(> (str.indexof url ":" 0) 0))
-(>= (- (str.indexof url "#" 2) 2) 0))
-(>= (str.indexof url ":" 0) 0))
-)
-
-(check-sat)
-
(set-logic SLIA)
+(set-option :strings-fmf true)
(set-option :strings-exp true)
(set-info :status sat)
(declare-fun x () String)
(declare-fun y () String)
(assert (not (= (str.replace (str.replace x y x) x y) x)))
-(check-sat)
\ No newline at end of file
+(check-sat)
; COMMAND-LINE: --strings-exp
-; EXPECT: unsat
+; EXPECT: sat
(set-logic ALL)
-(set-info :status unsat)
+(set-info :status sat)
(declare-fun x () String)
(declare-fun z () String)
(assert (= (str.len z) 0))
; COMMAND-LINE: --strings-exp
-; EXPECT: sat
+; EXPECT: unsat
(set-logic ALL)
-(set-info :status sat)
+(set-info :status unsat)
(declare-fun x () String)
(declare-fun y () String)
(assert (and
(= (str.++ s s) "A")
(not (str.contains s ""))
(str.contains "" (str.++ s "A"))
-(not (= (str.replace "A" s "A") "A"))
+(not (= (str.replace "A" "" "A") "AA"))
(not (= (str.prefixof s "A") (str.suffixof s "A")))
(not (str.prefixof s s))
(not (str.prefixof "" s))
--- /dev/null
+(set-logic ALL)
+(set-option :strings-exp true)
+(set-info :status sat)
+(declare-fun x () String)
+(declare-fun y () String)
+(declare-fun z () Int)
+(assert (and
+(not (= (str.replace "A" (int.to.str z) x) (str.++ "A" (str.replace "" (int.to.str z) x))))
+(not (= (str.replace x (str.at x z) "") (str.++ (str.replace (str.++ (str.substr x 0 z) (str.substr x z 1)) (str.substr x z 1) "") (str.substr x (+ 1 z) (str.len x)))))
+)
+)
+(check-sat)
TESTS = \
cmu-dis-0707-3.smt2 \
cmu-prereg-fmf.smt2 \
- cmu-repl-len-nterm.smt2
+ cmu-repl-len-nterm.smt2 \
+ cmu-disagree-0707-dd.smt2
EXTRA_DIST = $(TESTS) \
--- /dev/null
+(set-logic ALL_SUPPORTED)
+(set-info :status sat)
+(set-option :strings-exp true)
+
+(declare-fun url () String)
+
+(assert
+(and
+(and
+(and
+(and
+
+(= (str.len (str.substr (str.substr url (str.indexof url "#" 2) (- (str.len url) (str.indexof url "#" 2))) (+ (str.indexof (str.substr url (str.indexof url "#" 2) (- (str.len url) (str.indexof url "#" 2))) "#" 0) 1) (- (str.len (str.substr url (str.indexof url "#" 2) (- (str.len url) (str.indexof url "#" 2)))) (+ (str.indexof (str.substr url (str.indexof url "#" 2) (- (str.len url) (str.indexof url "#" 2))) "#" 0) 1)))) 0)
+
+(not (= (str.substr url 0 (- (str.indexof url ":" 0) 0)) "http")))
+(> (str.indexof url ":" 0) 0))
+(>= (- (str.indexof url "#" 2) 2) 0))
+(>= (str.indexof url ":" 0) 0))
+)
+
+(check-sat)
+