Skip to content

Commit 8569ea4

Browse files
committed
add tests for SMT-LIB2 function and let scopes
SMT-LIB2 function definitions have scopes for the identifiers of the parameters. The same holds for let expressions. This was raised in #5143.
1 parent db4c76b commit 8569ea4

File tree

4 files changed

+40
-0
lines changed

4 files changed

+40
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
KNOWNBUG
2+
function-scoping1.smt2
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^unsat$
7+
--
8+
^\(error
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
(set-logic QF_BV)
2+
3+
; the function parameters are in a separate scope
4+
5+
(define-fun min ((a (_ BitVec 8)) (b (_ BitVec 8))) (_ BitVec 8)
6+
(ite (bvule a b) a b))
7+
8+
(declare-const a (_ BitVec 32))
9+
10+
(assert (not (= a a)))
11+
12+
(check-sat)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
KNOWNBUG
2+
let-scoping1.smt2
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^unsat$
7+
--
8+
^\(error
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
(set-logic QF_BV)
2+
3+
; the let parameters are in a separate scope
4+
5+
; let hides the function 'x'
6+
(define-fun let1 () Bool (let ((a true)) a))
7+
8+
(declare-const a (_ BitVec 32))
9+
10+
(assert (not (= a a)))
11+
12+
(check-sat)

0 commit comments

Comments
 (0)