Fixes #8932. Fixes #8926.
}
Node StringsPreprocess::mkCodePointAtIndex(Node x, Node i)
{
- // we use (SEQ_NTH, x, i) instead of
+ // we could use (SEQ_NTH, x, i) instead of
// (STRING_TO_CODE, (STRING_SUBSTR, x, i, 1))
NodeManager* nm = NodeManager::currentNM();
- return nm->mkNode(SEQ_NTH, x, i);
+ return nm->mkNode(
+ STRING_TO_CODE,
+ nm->mkNode(STRING_SUBSTR, x, i, nm->mkConstInt(Rational(1))));
}
Node StringsPreprocess::processAssertion(Node n, std::vector<Node>& asserts)
regress1/strings/issue8915-str-unit-model.smt2
regress1/strings/issue8916-str-unit-pairs.smt2
regress1/strings/issue8918-str-nth-crange-red.smt2
+ regress1/strings/issue8932-cmi-unit.smt2
regress1/strings/kaluza-fl.smt2
regress1/strings/loop002.smt2
regress1/strings/loop003.smt2
regress3/strings-any-term.sy
regress3/strings/extf_d_perf.smt2
regress3/strings/indexof_re_red.smt2
+ regress3/strings/issue8926-sygus-inst.smt2
regress3/strings/norn-dis-0707-3.smt2
regress3/strings/replace_re_all.smt2
regress3/unbdd_inv_gen_ex7.sy
--- /dev/null
+; COMMAND-LINE: -q
+; EXPECT: sat
+(set-logic QF_SLIA)
+(declare-fun v () String)
+(declare-fun X () Int)
+(declare-fun t () Int)
+(assert (and (< t (- 15)) (< (- 38) t)))
+(assert (not (str.< (str.++ (str.++ (str.from_int X) (str.from_int (- t))) v) "3lA")))
+(check-sat)
--- /dev/null
+; COMMAND-LINE: --sygus-inst
+; EXPECT: sat
+(set-logic QF_SLIA)
+(declare-fun tstr () String)
+(assert (ite (str.prefixof "-" (str.substr tstr 0 (- (+ 0 2) 0))) (and (ite (= (- 1) (str.to_int (str.substr (str.substr tstr 0 (- (+ 0 2) 0)) 1 (- (str.len (str.substr tstr 0 (- (+ 0 2) 0))) 1)))) false true) (> (str.len (str.substr tstr 0 (- (+ 0 2) 0))) 1)) (ite (= (- 1) (str.to_int (str.substr tstr 0 (- (+ 0 2) 0)))) false true)))
+(assert (not (< (str.len tstr) (str.to_code (str.rev tstr)))))
+(assert (>= 3 (str.len tstr)))
+(check-sat)