I need your help defining a function with the Z3 Java API. I try to solve something like this (which is working fine with the z3.exe process):
(declare-fun a () Real)
(declare-fun b () Real)
(declare-fun c () Bool)
(define-fun max2 ((x Real) (y Real)) Real (ite (<= x y) y x))
(assert (and (>= a 0.0) (<= a 100.0)))
(assert (or (= (max2 (+ 100.0 (* (- 1.0) a)) (/ 1.0 1000.0)) 0.0) c (not (= b 0.0))))
(check-sat-using (then simplify bit-blast qfnra))
(get-model)
The result of this smt-file is:
sat
(model
(define-fun a () Real
1.0)
(define-fun c () Bool
false)
(define-fun b () Real
1.0)
)
The problem now is: There is no option, to define a function with the java API. In another post (Equivalent of define-fun in Z3 API), i noticed to use the following statement in the java API:
(declare-fun max2 (Real Real) Real)
(assert (forall ((y Real) (x Real)) (= (max2 y x) (ite (<= x y) y x))))
So i replaced (define-fun max2 ((x Real) (y Real)) Real (ite (<= x y) y x)) in my smt-file and started the z3.exe process again. The result was the following:
unknown
(model
(define-fun b () Real
0.0)
)
So, as you can see, there is no satisfiable result any more. Translating this in java, will get the same result UNKNOWN.
Any ideas, what i can do?