diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2019-12-17 02:00:42 -0600 |
---|---|---|
committer | Andres Noetzli <andres.noetzli@gmail.com> | 2019-12-17 00:00:42 -0800 |
commit | 9b2914ed9f7b14ecf535ffe9e1328d0fa042e072 (patch) | |
tree | 0c23031d07a12d84477885c155f10c6ba1c2b737 /test | |
parent | e1074c87769d079936b52a8e8ea33cc03f8b4638 (diff) |
Fix spurious parse error for rational real array constants (#3554)
Currently we can't parse constant arrays that store real values that are given as rationals `(/ n m)`. We throw a spurious parse error for `((as const (Array Int Real)) (/ 1 3))`, indicating that the argument of the array is not constant. This is caused by the fact that `(/ 1 3)` is parsed as a *division* term not a rational value.
This adds a special case to constant array construction so that we compute the result of a constant division instead of using the division term `(/ n m)` when constructing an array constant.
Diffstat (limited to 'test')
-rw-r--r-- | test/regress/CMakeLists.txt | 1 | ||||
-rw-r--r-- | test/regress/regress0/array-const-real-parse.smt2 | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/test/regress/CMakeLists.txt b/test/regress/CMakeLists.txt index f4937f8f3..b05393258 100644 --- a/test/regress/CMakeLists.txt +++ b/test/regress/CMakeLists.txt @@ -36,6 +36,7 @@ set(regress_0_tests regress0/arith/mod-simp.smt2 regress0/arith/mod.01.smt2 regress0/arith/mult.01.smt2 + regress0/array-const-real-parse.smt2 regress0/arrayinuf_declare.smt2 regress0/arrays/arrays0.smt2 regress0/arrays/arrays1.smt2 diff --git a/test/regress/regress0/array-const-real-parse.smt2 b/test/regress/regress0/array-const-real-parse.smt2 new file mode 100644 index 000000000..0246380f8 --- /dev/null +++ b/test/regress/regress0/array-const-real-parse.smt2 @@ -0,0 +1,7 @@ +(set-logic QF_AUFLIRA) +(set-info :status sat) +(declare-fun a () (Array Int Real)) +(assert (= a ((as const (Array Int Real)) 0.0))) +(declare-fun b () (Array Int Real)) +(assert (= b ((as const (Array Int Real)) (/ 1 3)))) +(check-sat) |