Z3JAVA_定义函数的Z3 Java API

我需要你帮助用Z3

Java API定义一个函数.

我尝试解决这样的问题(使用z3.exe进程可以正常工作):

(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)

这个smt文件的结果是:

sat

(model

(define-fun a () Real

1.0)

(define-fun c () Bool

false)

(define-fun b () Real

1.0)

)

现在的问题是:没有选项,用java API定义一个函数.在另一篇文章(Equivalent of define-fun in Z3 API)中,我注意到在java API中使用以下语句:

(declare-fun max2 (Real Real) Real)

(assert (forall ((y Real) (x Real)) (= (max2 y x) (ite (<= x y) y x))))

所以我在我的smt文件中替换了(define-fun max2((x Real)(y Real))Real(ite(< = x y)y x))并再次启动了z3.exe进程.结果如下:

unknown

(model

(define-fun b () Real

0.0)

)

所以,正如你所看到的,再也没有令人满意的结果了.在java中翻译它将获得相同的结果UNKNOWN.

任何想法,我能做什么?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值