-
Notifications
You must be signed in to change notification settings - Fork 2
SMT-LIB should consider disallowing shadowed variables in define-fun(-rec) #36
Copy link
Copy link
Open
Description
Currently, SMT-LIB gives an unintuitive definition of how define-fun with shadowed variables should be handled, where technically this should be treated as a partial definition based on the standard.
In detail, the SMT-LIB standard page 63 states:
(define-fun f ((x1 U1) ... (xn Un)) U t)
is equivalent to
(declare-fun f (U1 ... Un) U)
(assert (forall ((x1 U1) ... (xn Un)) (= (f x1 ... xn) t)))
Now consider what happens when we have shadowed variables. Take this benchmark:
(set-logic ALL)
(define-fun P ((x Int) (x Int)) Bool (= x 0))
(assert (P 0 1))
(check-sat)
cvc5 1.1.0 and z3 4.8.10 say "unsat" for this. The command
(define-fun P ((x Int) (x Int)) Bool (= x 0))
partially defines P over the domain where its arguments are equal, as
(forall ((x Int) (x Int)) (= (P x x) (= x 0)))
is equivalent to
(forall ((x Int)) (= (P x x) (= x 0)))
meaning (P 0 1) is unconstrained.
It is recommended the standard is updated to explicitly allow variable shadowing in arguments to define-fun(-rec).
See cvc5/cvc5#11507.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels