diff options
author | Andres Noetzli <andres.noetzli@gmail.com> | 2020-03-18 23:46:50 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-18 23:46:50 -0700 |
commit | d862942f821ea14973207ef538be3326fb11c17c (patch) | |
tree | 80a6b809f84019d9bcd1e0552cea778b10a1e8c8 /test/regress | |
parent | 9c960866c9e71e543c5688aac826a8150c899ca6 (diff) |
Only allow bv2nat/int2bv with BV and integer logic (#4118)
CVC4 supports `bv2nat` and `int2bv` to convert bit-vectors to/from
integers. Those operators are not standard. This commit only enables
those operators when parsing is non-strict and both bit-vectors and
integers are enabled in the logic. To achieve this, the commit
simplifies the handling of logics in the parser: Instead of defining a
separate `Logic` enum in the `Smt2` class, we simply use `LogicInfo`
directly.
Diffstat (limited to 'test/regress')
-rw-r--r-- | test/regress/CMakeLists.txt | 1 | ||||
-rw-r--r-- | test/regress/regress0/parser/bv_nat.smt2 | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/test/regress/CMakeLists.txt b/test/regress/CMakeLists.txt index bffb2c4db..0ea611435 100644 --- a/test/regress/CMakeLists.txt +++ b/test/regress/CMakeLists.txt @@ -608,6 +608,7 @@ set(regress_0_tests regress0/parallel-let.smt2 regress0/parser/as.smt2 regress0/parser/bv_arity_smt2.6.smt2 + regress0/parser/bv_nat.smt2 regress0/parser/constraint.smt2 regress0/parser/declarefun-emptyset-uf.smt2 regress0/parser/force_logic_set_logic.smt2 diff --git a/test/regress/regress0/parser/bv_nat.smt2 b/test/regress/regress0/parser/bv_nat.smt2 new file mode 100644 index 000000000..fc2140854 --- /dev/null +++ b/test/regress/regress0/parser/bv_nat.smt2 @@ -0,0 +1,13 @@ +; EXPECT: sat +; EXPECT: not declared +; SCRUBBER: grep -o "sat\|not declared" +; EXIT: 1 +(set-logic QF_BVLIA) +(declare-const x (_ BitVec 4)) +(assert (= (bv2nat x) 0)) +(check-sat) +(reset) +(set-logic QF_BV) +(declare-const x (_ BitVec 4)) +(assert (= (bv2nat x) 0)) +(check-sat) |