From 1752aeb263a986bf437bb04029474b41987450d2 Mon Sep 17 00:00:00 2001 From: Andres Noetzli Date: Wed, 5 Sep 2018 07:49:59 -0700 Subject: [PATCH] Add regex grammar to rewriter verification tests (#2426) --- test/regress/Makefile.tests | 1 + test/regress/regress1/rr-verify/regex.sy | 32 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 test/regress/regress1/rr-verify/regex.sy diff --git a/test/regress/Makefile.tests b/test/regress/Makefile.tests index 39a7a4f4d..b8b047e6d 100644 --- a/test/regress/Makefile.tests +++ b/test/regress/Makefile.tests @@ -1401,6 +1401,7 @@ REG1_TESTS = \ regress1/rr-verify/bool-crci.sy \ regress1/rr-verify/bv-term-32.sy \ regress1/rr-verify/bv-term.sy \ + regress1/rr-verify/regex.sy \ regress1/rr-verify/string-term.sy \ regress1/sep/chain-int.smt2 \ regress1/sep/crash1220.smt2 \ diff --git a/test/regress/regress1/rr-verify/regex.sy b/test/regress/regress1/rr-verify/regex.sy new file mode 100644 index 000000000..6c6da3dd2 --- /dev/null +++ b/test/regress/regress1/rr-verify/regex.sy @@ -0,0 +1,32 @@ +; COMMAND-LINE: --sygus-rr --sygus-samples=1000 --sygus-abort-size=3 --sygus-rr-verify-abort --no-sygus-sym-break +; EXPECT: (error "Maximum term size (3) for enumerative SyGuS exceeded.") +; SCRUBBER: grep -v -E '(\(define-fun|\(candidate-rewrite)' +; EXIT: 1 + +(set-logic SLIA) + +(synth-fun f ((x String) (y String)) Bool ( + +(Start Bool ( + true + false + (= StartStr StartStr) + (str.in.re StartStr StartRe) +)) + +(StartRe RegLan ( + re.allchar + (re.++ StartRe StartRe) + (re.union StartRe StartRe) + (re.* StartRe) + (str.to.re StartStr) +)) + +(StartStr String ( + x y "A" "B" "" + (str.++ StartStr StartStr) +)) + +)) + +(check-synth) -- 2.30.2