diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2018-05-07 10:22:27 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-07 10:22:27 -0500 |
commit | db43ae511c2103f1e9718a8954e26cf7866d14a8 (patch) | |
tree | 3d0654dd38d404bbe31c2bd543a003b351d37336 /test/regress/regress1 | |
parent | 884ad1a946ad6a04664ef97121ce1cebb5513d40 (diff) |
Add support for str.code (#1821)
Diffstat (limited to 'test/regress/regress1')
-rw-r--r-- | test/regress/regress1/strings/code-sequence.smt2 | 14 | ||||
-rw-r--r-- | test/regress/regress1/strings/str-code-sat.smt2 | 24 | ||||
-rw-r--r-- | test/regress/regress1/strings/str-code-unsat-2.smt2 | 6 | ||||
-rw-r--r-- | test/regress/regress1/strings/str-code-unsat-3.smt2 | 21 | ||||
-rw-r--r-- | test/regress/regress1/strings/str-code-unsat.smt2 | 21 |
5 files changed, 86 insertions, 0 deletions
diff --git a/test/regress/regress1/strings/code-sequence.smt2 b/test/regress/regress1/strings/code-sequence.smt2 new file mode 100644 index 000000000..2654017d4 --- /dev/null +++ b/test/regress/regress1/strings/code-sequence.smt2 @@ -0,0 +1,14 @@ +(set-logic SLIA) +(set-option :strings-exp true) +(set-option :strings-fmf true) +(set-option :fmf-bound true) +(set-info :status sat) +(declare-fun x () String) +(assert (forall ((n Int)) (=> (and (<= 0 n) (< n (str.len x))) +(and +(<= 60 (str.code (str.at x n))) +(<= (str.code (str.at x n)) 90) +(< (+ 1 (str.code (str.at x (- n 1)))) (str.code (str.at x n))) +)))) +(assert (> (str.len x) 3)) +(check-sat) diff --git a/test/regress/regress1/strings/str-code-sat.smt2 b/test/regress/regress1/strings/str-code-sat.smt2 new file mode 100644 index 000000000..1acc091c1 --- /dev/null +++ b/test/regress/regress1/strings/str-code-sat.smt2 @@ -0,0 +1,24 @@ +(set-logic QF_SLIA) +(set-info :status sat) +(declare-fun x () String) +(declare-fun y () String) +(declare-fun z () String) +(declare-fun w () String) + +(assert (>= (str.code x) 65)) +(assert (<= (str.code x) 75)) + +(assert (>= (str.code y) 65)) +(assert (<= (str.code y) 75)) + +(assert (>= (str.code z) 65)) +(assert (<= (str.code z) 75)) + +(assert (= (str.len w) 1)) + +(assert (= (+ (str.code x) (str.code y)) 140)) +(assert (= (+ (str.code x) (str.code z)) 141)) + +(assert (distinct x y z w "A" "B" "C" "D" "AA")) + +(check-sat) diff --git a/test/regress/regress1/strings/str-code-unsat-2.smt2 b/test/regress/regress1/strings/str-code-unsat-2.smt2 new file mode 100644 index 000000000..38116061e --- /dev/null +++ b/test/regress/regress1/strings/str-code-unsat-2.smt2 @@ -0,0 +1,6 @@ +(set-logic QF_SLIA) +(set-info :status unsat) +(declare-fun x () String) +(assert (= (str.len x) 1)) +(assert (or (< (str.code x) 0) (> (str.code x) 10000000000000000000000000000))) +(check-sat) diff --git a/test/regress/regress1/strings/str-code-unsat-3.smt2 b/test/regress/regress1/strings/str-code-unsat-3.smt2 new file mode 100644 index 000000000..fa34785c2 --- /dev/null +++ b/test/regress/regress1/strings/str-code-unsat-3.smt2 @@ -0,0 +1,21 @@ +(set-logic QF_SLIA) +(set-info :status unsat) +(declare-fun x () String) +(declare-fun y () String) +(declare-fun z () String) + +(assert (>= (str.code x) 65)) +(assert (<= (str.code x) 75)) + +(assert (>= (str.code y) 65)) +(assert (<= (str.code y) 75)) + +(assert (>= (str.code z) 65)) +(assert (<= (str.code z) 75)) + +(assert (= (+ (str.code x) (str.code y)) 140)) +(assert (= (+ (str.code x) (str.code z)) 141)) + +(assert (distinct x y z "B" "C" "D" "E")) + +(check-sat) diff --git a/test/regress/regress1/strings/str-code-unsat.smt2 b/test/regress/regress1/strings/str-code-unsat.smt2 new file mode 100644 index 000000000..6a3e9062b --- /dev/null +++ b/test/regress/regress1/strings/str-code-unsat.smt2 @@ -0,0 +1,21 @@ +(set-logic QF_SLIA) +(set-info :status unsat) +(declare-fun x () String) +(declare-fun y () String) +(declare-fun z () String) + +(assert (>= (str.code x) 65)) +(assert (<= (str.code x) 75)) + +(assert (>= (str.code y) 65)) +(assert (<= (str.code y) 75)) + +(assert (>= (str.code z) 65)) +(assert (<= (str.code z) 75)) + +(assert (= (+ (str.code x) (str.code y)) 140)) +(assert (= (+ (str.code x) (str.code z)) 140)) + +(assert (distinct x y z)) + +(check-sat) |