Fixes #4915. Previously, `str.substr` did not require `--strings-exp`.
However, when `--strings-exp` is not active, we do not send terms to the
extended solver for registration, which meant that `str.substr` was
never reduced. This commit adds `str.substr` to the operators that
require `--strings-exp`.
if (!options::stringExp())
{
if (k == STRING_STRIDOF || k == STRING_ITOS || k == STRING_STOI
- || k == STRING_STRREPL || k == STRING_STRREPLALL
+ || k == STRING_STRREPL || k == STRING_SUBSTR || k == STRING_STRREPLALL
|| k == STRING_REPLACE_RE || k == STRING_REPLACE_RE_ALL
|| k == STRING_STRCTN || k == STRING_LEQ || k == STRING_TOLOWER
|| k == STRING_TOUPPER || k == STRING_REV || k == STRING_UPDATE)
regress0/strings/issue4662-consume-nterm.smt2
regress0/strings/issue4674-recomp-nf.smt2
regress0/strings/issue4820.smt2
+ regress0/strings/issue4915.smt2
regress0/strings/itos-entail.smt2
regress0/strings/large-model.smt2
regress0/strings/leadingzero001.smt2
+; COMMAND-LINE: --strings-exp
;EXPECT: unsat
(set-logic ALL)
(declare-fun tickleBool (Bool) Bool)
-;COMMAND-LINE: --dt-nested-rec
+;COMMAND-LINE: --dt-nested-rec --strings-exp
;EXPECT: unsat
(set-logic ALL)
(declare-fun tickleBool (Bool) Bool)
+; COMMAND-LINE: --strings-exp
(set-logic QF_SLIA)
(set-info :status unsat)
(declare-fun x () (Seq (Seq Int)))
+; COMMAND-LINE: --strings-exp
(set-logic QF_SLIA)
(set-info :status unsat)
(declare-fun z () (Seq Int))
+; COMMAND-LINE: --strings-exp
(set-logic QF_SLIA)
(set-info :status sat)
(declare-fun z () (Seq Int))
+; COMMAND-LINE: --strings-exp
;EXPECT: unsat
(set-logic ALL)
(declare-fun a () (Seq Int))
(assert (or (= x z) (= y z)))
(assert (not (= (seq.nth a x) (seq.nth a z))))
(assert (not (= (seq.nth b y) (seq.nth b z))))
-(check-sat)
\ No newline at end of file
+(check-sat)
+; COMMAND-LINE: --strings-exp
(set-logic QF_UFSLIA)
(set-info :status unsat)
(declare-fun a () (Seq Int))
+; COMMAND-LINE: --strings-exp
;EXPECT: sat
(set-logic ALL)
(declare-fun s () (Seq Int))
+; COMMAND-LINE: --strings-exp
;EXPECT: sat
(set-logic ALL)
(declare-fun s () (Seq Int))
+; COMMAND-LINE: --strings-exp
(set-info :smt-lib-version 2.6)
(set-logic QF_SLIA)
(set-info :status unsat)
--- /dev/null
+; EXPECT: unsat
+; COMMAND-LINE: --strings-exp
+(set-logic QF_SLIA)
+(declare-const Str4 String)
+(declare-const Str18 String)
+(assert (str.in_re Str18 (re.++ (str.to_re Str4) (str.to_re "ewgysobutx"))))
+(assert (= Str18 (str.++ Str4 "ewgysobutx")))
+(assert (>= (str.len (str.substr Str18 0 3)) 937))
+(check-sat)
+; COMMAND-LINE: --strings-exp
(set-logic QF_SLIA)
(set-info :status unsat)
(declare-const x String)
+% COMMAND-LINE: --strings-exp
% EXPECT: unsat
x : STRING;
+; COMMAND-LINE: --strings-exp
(set-logic ALL)
(set-info :status unsat)
(declare-fun s () String)
+; COMMAND-LINE: --strings-exp
(set-logic QF_SLIA)
(set-info :status sat)
+; COMMAND-LINE: --strings-exp
(set-logic QF_SLIA)
(set-info :status sat)