问题
In SMT-LIB:
(declare-fun y () Real)
(declare-fun x () Real)
(assert (= 0.0 x))
(assert (= y (/ 1.0 x)))
(check-sat)
Should this model be SAT or UNSAT?
回答1:
In SMT-LIB 2.0 and 2.5, all functions are total, so this example is SAT in SMT-LIB. Both Z3 and CVC4 do indeed return SAT for the example in the question.
I found this counter-intuitive. I think it would be mathematically more well justified to say that y=1/x, x=0
is unsatisfiable in the reals. In Mathematica, the equivalent code returns an empty list, indicating that no solution exists, i.e., FindInstance[Element[x, Reals] && Element[y, Reals] && x == 0 && y == 1/x, {x, y}]
returns {}
Nonetheless, /
is defined this way in SMT-LIB. So as far as Z3 or CVC4 are concerned, this problem is SAT.
来源:https://stackoverflow.com/questions/38107558/y-1-x-x-0-satisfiable-in-the-reals