Open mischel opened 9 years ago
minismt
Real
and Rat
c + sqrt(m)d
) together with a specification (eg allow negative, denomiator, ...)z3
Real
constants (eg 0.5
)to_real
and to_int
The behavior of z3 is not quite clear to me:
Following formula returns sat ((x 1) (y 2.0)
.
(declare-fun x () Int)
(declare-fun y () Real)
(assert (= x 1.5))
(assert (= 1 1.5))
(assert (= y 2.0))
(assert (< x y))
(check-sat)
(get-value (x y))
On the other hand, this example returns unsat
.
(declare-fun x () Int)
(declare-fun y () Real)
(assert (= (to_real x) 1.5))
(assert (= y 2.0))
(assert (< x y))
(check-sat)
(get-value (x y))
It seems there is some casting going on:
This example returns sat
(assert (= 1 1.1))
(check-sat)
whereas this returns unsat
.
(assert (= 1.1 1))
(check-sat)
Possible Approach:
Formula v
to Formula v k
data F v k where
BVal :: Bool -> F v Bool
BVar :: v -> F v Bool
And :: [F v Bool] -> F v Bool
AVal :: k -> F v k
AVar :: v -> F v k
AEq :: Show k => F v k -> F v k -> F v Bool
ivar :: v -> F v Int
ivar = AVAR
pros
cons
minismt supports
Rat
andReal
type. In many of our applications this would be sound. For the LP solver interface (issue #1), we should have aReal
type anyway.The extension is not trivial, as we have to extend/generalize the Formula type. There are some points that should be clarified beforehand.
Real
defined (see http://smtlib.cs.uiowa.edu/theories-Reals_Ints.shtml)Real_Ints
definedsto_int
which is not supported by minismt)