diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/regress/Makefile.tests | 6 | ||||
-rw-r--r-- | test/regress/regress0/strings/rewrites-re-concat.smt2 | 21 | ||||
-rw-r--r-- | test/regress/regress1/strings/issue1684-regex.smt2 | 8 | ||||
-rw-r--r-- | test/regress/regress1/strings/non_termination_regular_expression4.smt2 | 36 | ||||
-rw-r--r-- | test/regress/regress1/strings/norn-13.smt2 | 23 | ||||
-rw-r--r-- | test/regress/regress1/strings/policy_variable.smt2 | 40 | ||||
-rw-r--r-- | test/regress/regress1/strings/re-elim-exact.smt2 | 10 |
7 files changed, 144 insertions, 0 deletions
diff --git a/test/regress/Makefile.tests b/test/regress/Makefile.tests index 6187cb2fa..63593c662 100644 --- a/test/regress/Makefile.tests +++ b/test/regress/Makefile.tests @@ -814,6 +814,7 @@ REG0_TESTS = \ regress0/strings/norn-31.smt2 \ regress0/strings/norn-simp-rew.smt2 \ regress0/strings/repl-rewrites2.smt2 \ + regress0/strings/rewrites-re-concat.smt2 \ regress0/strings/rewrites-v2.smt2 \ regress0/strings/std2.6.1.smt2 \ regress0/strings/str003.smt2 \ @@ -1485,6 +1486,7 @@ REG1_TESTS = \ regress1/strings/idof-triv.smt2 \ regress1/strings/ilc-l-nt.smt2 \ regress1/strings/issue1105.smt2 \ + regress1/strings/issue1684-regex.smt2 \ regress1/strings/issue2060.smt2 \ regress1/strings/kaluza-fl.smt2 \ regress1/strings/loop002.smt2 \ @@ -1496,12 +1498,16 @@ REG1_TESTS = \ regress1/strings/loop008.smt2 \ regress1/strings/loop009.smt2 \ regress1/strings/nf-ff-contains-abs.smt2 \ + regress1/strings/non_termination_regular_expression4.smt2 \ + regress1/strings/norn-13.smt2 \ regress1/strings/norn-360.smt2 \ regress1/strings/norn-ab.smt2 \ regress1/strings/norn-nel-bug-052116.smt2 \ regress1/strings/norn-simp-rew-sat.smt2 \ regress1/strings/nterm-re-inter-sigma.smt2 \ regress1/strings/pierre150331.smt2 \ + regress1/strings/policy_variable.smt2 \ + regress1/strings/re-elim-exact.smt2 \ regress1/strings/re-unsound-080718.smt2 \ regress1/strings/regexp001.smt2 \ regress1/strings/regexp002.smt2 \ diff --git a/test/regress/regress0/strings/rewrites-re-concat.smt2 b/test/regress/regress0/strings/rewrites-re-concat.smt2 new file mode 100644 index 000000000..fe6691e73 --- /dev/null +++ b/test/regress/regress0/strings/rewrites-re-concat.smt2 @@ -0,0 +1,21 @@ +(set-info :smt-lib-version 2.5) +(set-logic SLIA) +(set-info :status unsat) + +(declare-fun x () String) +(assert (str.in.re x (re.++ (str.to.re "baa") (re.* (str.to.re "a")) (re.* (str.to.re "c"))))) + +(declare-fun y () String) +(assert (< (str.len y) 2)) + +(assert (or +(not (str.in.re x (re.++ (str.to.re "baa") (re.* (str.to.re "a")) (re.* (str.to.re "a")) (re.* (str.to.re "c"))))) +(not (str.in.re x (re.++ (str.to.re "ba") (str.to.re "") (re.* (str.to.re "a")) (str.to.re "a") (re.* (str.to.re "c"))))) +(not (str.in.re x (re.++ (str.to.re "b") (re.* (str.to.re "a")) (str.to.re "a") (re.* (str.to.re "a")) (str.to.re "a") (re.* (str.to.re "c"))))) + +(str.in.re y (re.++ re.allchar re.allchar (re.* re.allchar) re.allchar)) +(str.in.re y (re.++ re.allchar re.allchar re.allchar)) +) +) + +(check-sat) diff --git a/test/regress/regress1/strings/issue1684-regex.smt2 b/test/regress/regress1/strings/issue1684-regex.smt2 new file mode 100644 index 000000000..35eb8456d --- /dev/null +++ b/test/regress/regress1/strings/issue1684-regex.smt2 @@ -0,0 +1,8 @@ +(set-info :smt-lib-version 2.5) +(set-logic QF_S) +(set-info :status sat) +(set-option :strings-exp true) +(declare-const s String) +(assert (str.in.re s (re.* (re.range "\x00" "\xFF")))) +(assert (str.in.re s (re.range "\x00" "\xFF"))) +(check-sat)
\ No newline at end of file diff --git a/test/regress/regress1/strings/non_termination_regular_expression4.smt2 b/test/regress/regress1/strings/non_termination_regular_expression4.smt2 new file mode 100644 index 000000000..0b527345d --- /dev/null +++ b/test/regress/regress1/strings/non_termination_regular_expression4.smt2 @@ -0,0 +1,36 @@ +(set-info :smt-lib-version 2.5) +(set-logic ALL) +(set-info :status unsat) +(set-option :strings-exp true) +(set-option :re-elim true) +(declare-const actionName String) +(declare-const actionNamespace String) + +; Action: p0.0 +(declare-const p0.0.action Bool) +(assert (= p0.0.action (and (= actionNamespace "foobar") (str.in.re actionName (re.++ (str.to.re "foo") (re.* re.allchar) (re.++ (str.to.re "") re.allchar (str.to.re "bar"))))))) + +; Policy: 0 +(declare-const p0.denies Bool) +(assert (not p0.denies)) +(declare-const p0.allows Bool) +(assert (= p0.allows (and (not p0.denies) p0.0.action))) +(declare-const p0.neutral Bool) +(assert (= p0.neutral (and (not p0.allows) (not p0.denies)))) + +; Action: p1.0 +(declare-const p1.0.action Bool) +(assert (= p1.0.action (and (= actionNamespace "foobar") (str.in.re actionName (re.++ (re.++ (str.to.re "foo") re.allchar (str.to.re "")) (re.* re.allchar) (str.to.re "bar")))))) + +; Policy: 1 +(declare-const p1.denies Bool) +(assert (not p1.denies)) +(declare-const p1.allows Bool) +(assert (= p1.allows (and (not p1.denies) p1.0.action))) +(declare-const p1.neutral Bool) +(assert (= p1.neutral (and (not p1.allows) (not p1.denies)))) + +; Goals +(assert p0.allows) +(assert (or p1.denies p1.neutral)) +(check-sat) diff --git a/test/regress/regress1/strings/norn-13.smt2 b/test/regress/regress1/strings/norn-13.smt2 new file mode 100644 index 000000000..912f4477a --- /dev/null +++ b/test/regress/regress1/strings/norn-13.smt2 @@ -0,0 +1,23 @@ +(set-logic QF_S) +(set-option :strings-exp true) +(set-info :status sat) + +(declare-fun var_0 () String) +(declare-fun var_1 () String) +(declare-fun var_2 () String) +(declare-fun var_3 () String) +(declare-fun var_4 () String) +(declare-fun var_5 () String) +(declare-fun var_6 () String) +(declare-fun var_7 () String) +(declare-fun var_8 () String) +(declare-fun var_9 () String) +(declare-fun var_10 () String) +(declare-fun var_11 () String) +(declare-fun var_12 () String) + +(assert (str.in.re "" (re.* (re.range "a" "u")))) +(assert (str.in.re var_4 (re.* (re.range "a" "u")))) +(assert (str.in.re var_4 (re.* (re.union (str.to.re "a") (str.to.re "b"))))) +(assert (not (str.in.re (str.++ var_4 "z" ) (re.* (str.to.re "z"))))) +(check-sat) diff --git a/test/regress/regress1/strings/policy_variable.smt2 b/test/regress/regress1/strings/policy_variable.smt2 new file mode 100644 index 000000000..4d14e95d5 --- /dev/null +++ b/test/regress/regress1/strings/policy_variable.smt2 @@ -0,0 +1,40 @@ +(set-info :smt-lib-version 2.5) +(set-logic ALL) +(set-info :status unsat) +(set-option :strings-exp true) +(set-option :re-elim true) +(declare-const actionName String) +(declare-const actionNamespace String) +(declare-const example_key String) + +; Action: p0.0 +(declare-const p0.0.action Bool) +(assert (= p0.0.action (and (= "foobar" actionNamespace) (and (str.prefixof "ab" actionName) (str.contains (str.substr actionName 2 (- (str.len actionName) 3)) "b") (str.suffixof "b" actionName) (not (= actionName "abb")) (not (= actionName "ab")))))) + +; Policy: 0 +(declare-const p0.denies Bool) +(assert (not p0.denies)) +(declare-const p0.allows Bool) +(assert (= p0.allows (and (not p0.denies) p0.0.action))) +(declare-const p0.neutral Bool) +(assert (= p0.neutral (and (not p0.allows) (not p0.denies)))) + +; Action: p1.0 +(declare-const p1.0.action Bool) +(assert (= p1.0.action (and (= "foobar" actionNamespace) (and (str.prefixof "a" actionName) (str.prefixof example_key (str.substr actionName 1 (- (str.len actionName) 1))) (str.contains (str.substr actionName (+ 1 (str.len example_key)) (- (str.len actionName) 1 (str.len example_key))) "b") (str.suffixof "b" actionName))))) + +(declare-const p1.0.condition Bool) +(assert (= p1.0.condition (str.prefixof "bb" example_key))) + +; Policy: 1 +(declare-const p1.denies Bool) +(assert (not p1.denies)) +(declare-const p1.allows Bool) +(assert (= p1.allows (and (not p1.denies) p1.0.action p1.0.condition))) +(declare-const p1.neutral Bool) +(assert (= p1.neutral (and (not p1.allows) (not p1.denies)))) + +; Goals +(assert (or p0.neutral p0.denies)) +(assert p1.allows) +(check-sat) diff --git a/test/regress/regress1/strings/re-elim-exact.smt2 b/test/regress/regress1/strings/re-elim-exact.smt2 new file mode 100644 index 000000000..62b934610 --- /dev/null +++ b/test/regress/regress1/strings/re-elim-exact.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 :re-elim true) +(declare-fun x () String) + +(assert (str.in.re x (re.++ re.allchar (str.to.re "A") re.allchar (str.to.re "B") re.allchar))) + +(check-sat) |