diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2018-11-21 14:44:44 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-21 14:44:44 -0600 |
commit | 2c05402119dba7e90e24621c5768514ab2f5042c (patch) | |
tree | cec74ac8b51d20c622205bfa39e6ef6e44d510dc /test | |
parent | b3b1fffb390d19312227d7095fb404e9e0447d95 (diff) |
Support string replace all (#2704)
Diffstat (limited to 'test')
-rw-r--r-- | test/regress/CMakeLists.txt | 5 | ||||
-rw-r--r-- | test/regress/regress0/strings/replaceall-eval.smt2 | 10 | ||||
-rw-r--r-- | test/regress/regress1/strings/replaceall-len.smt2 | 10 | ||||
-rw-r--r-- | test/regress/regress1/strings/replaceall-replace.smt2 | 13 | ||||
-rw-r--r-- | test/regress/regress2/strings/replaceall-diffrange.smt2 | 11 | ||||
-rw-r--r-- | test/regress/regress2/strings/replaceall-len-c.smt2 | 8 |
6 files changed, 57 insertions, 0 deletions
diff --git a/test/regress/CMakeLists.txt b/test/regress/CMakeLists.txt index 6736d712b..a1d5a35aa 100644 --- a/test/regress/CMakeLists.txt +++ b/test/regress/CMakeLists.txt @@ -825,6 +825,7 @@ set(regress_0_tests regress0/strings/norn-31.smt2 regress0/strings/norn-simp-rew.smt2 regress0/strings/repl-rewrites2.smt2 + regress0/strings/replaceall-eval.smt2 regress0/strings/rewrites-re-concat.smt2 regress0/strings/rewrites-v2.smt2 regress0/strings/std2.6.1.smt2 @@ -1544,6 +1545,8 @@ set(regress_1_tests regress1/strings/reloop.smt2 regress1/strings/repl-empty-sem.smt2 regress1/strings/repl-soundness-sem.smt2 + regress1/strings/replaceall-len.smt2 + regress1/strings/replaceall-replace.smt2 regress1/strings/rew-020618.smt2 regress1/strings/stoi-400million.smt2 regress1/strings/str-code-sat.smt2 @@ -1729,6 +1732,8 @@ set(regress_2_tests regress2/strings/non_termination_regular_expression6.smt2 regress2/strings/norn-dis-0707-3.smt2 regress2/strings/repl-repl.smt2 + regress2/strings/replaceall-diffrange.smt2 + regress2/strings/replaceall-len-c.smt2 regress2/sygus/MPwL_d1s3.sy regress2/sygus/array_sum_dd.sy regress2/sygus/cegisunif-depth1-bv.sy diff --git a/test/regress/regress0/strings/replaceall-eval.smt2 b/test/regress/regress0/strings/replaceall-eval.smt2 new file mode 100644 index 000000000..924515901 --- /dev/null +++ b/test/regress/regress0/strings/replaceall-eval.smt2 @@ -0,0 +1,10 @@ +(set-info :smt-lib-version 2.5) +(set-logic ALL) +(set-info :status sat) +(declare-fun x () String) +(declare-fun y () String) + +(assert (= x (str.replaceall "AABAABBC" "B" "def"))) +(assert (= y (str.replaceall "AABAABBC" "AB" "BA"))) + +(check-sat) diff --git a/test/regress/regress1/strings/replaceall-len.smt2 b/test/regress/regress1/strings/replaceall-len.smt2 new file mode 100644 index 000000000..448d8e98f --- /dev/null +++ b/test/regress/regress1/strings/replaceall-len.smt2 @@ -0,0 +1,10 @@ +(set-info :smt-lib-version 2.5) +(set-logic ALL) +(set-info :status sat) +(set-option :strings-exp true) +(set-option :strings-fmf true) +(set-option :produce-models true) +(declare-fun x () String) +(assert (= (str.len (str.replaceall x "B" "CC")) (+ (str.len x) 2))) +(assert (> (str.len x) 2)) +(check-sat) diff --git a/test/regress/regress1/strings/replaceall-replace.smt2 b/test/regress/regress1/strings/replaceall-replace.smt2 new file mode 100644 index 000000000..5bf5b5b16 --- /dev/null +++ b/test/regress/regress1/strings/replaceall-replace.smt2 @@ -0,0 +1,13 @@ +(set-info :smt-lib-version 2.5) +(set-logic ALL) +(set-info :status sat) +(set-option :strings-exp true) +(set-option :strings-fmf true) +(set-option :produce-models true) +(declare-fun x () String) +(declare-fun y () String) +(declare-fun z () String) +(assert (not (= x ""))) +(assert (not (= y ""))) +(assert (not (= (str.replace x y z) (str.replaceall x y z)))) +(check-sat) diff --git a/test/regress/regress2/strings/replaceall-diffrange.smt2 b/test/regress/regress2/strings/replaceall-diffrange.smt2 new file mode 100644 index 000000000..5d1ef57bf --- /dev/null +++ b/test/regress/regress2/strings/replaceall-diffrange.smt2 @@ -0,0 +1,11 @@ +(set-info :smt-lib-version 2.5) +(set-logic ALL) +(set-info :status sat) +(set-option :strings-exp true) +(set-option :strings-fmf true) +(declare-fun x () String) +(declare-fun y () String) +(declare-fun z () String) +(declare-fun w () String) +(assert (= (str.len (str.replaceall x y z)) (+ (str.len (str.replaceall x y w)) 3))) +(check-sat) diff --git a/test/regress/regress2/strings/replaceall-len-c.smt2 b/test/regress/regress2/strings/replaceall-len-c.smt2 new file mode 100644 index 000000000..336ec10e4 --- /dev/null +++ b/test/regress/regress2/strings/replaceall-len-c.smt2 @@ -0,0 +1,8 @@ +(set-info :smt-lib-version 2.5) +(set-logic ALL) +(set-info :status sat) +(set-option :strings-exp true) +(set-option :strings-fmf true) +(declare-fun x () String) +(assert (= (str.len (str.replaceall "ABBABAAB" x "C")) 5)) +(check-sat) |