首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用存在量词来编写长的smt-lib表达式?

如何使用存在量词来编写长的smt-lib表达式?
EN

Stack Overflow用户
提问于 2014-04-09 10:19:10
回答 1查看 257关注 0票数 3

我有以下表达式

代码语言:javascript
复制
(declare-fun x00 () Real)
(declare-fun x01 () Real)
(declare-fun x10 () Real)
(declare-fun x11 () Real)
(declare-fun t0init () Real)
(declare-fun z0init0 () Real)
(declare-fun z0init1 () Real)
(assert (>= t0init 0))
(assert (= (+ x00 z0init0) x10))
(assert (= (+ x01 z0init1) x11))
(assert (< (+ (* 1 x00)(* 0 x01)) 0.0))
(assert (= (+ (* 0 x00)(* 1 x01)) 0.0))
(assert (< (+ (* 1 x10)(* 0 x11)) 0.0))
(assert (= (+ (* 0 x10)(* 1 x11)) 0.0))
...
(assert (< (+ (* 1 x40)(* 0 x41)) 0.0))
(assert (= (+ (* 0 x40)(* 1 x41)) 0.0))
(assert (= (+ (* 1 z4end0)(* 0 z4end1)) (* t4end 1)))
(assert (= (+ (* 0 z4end0)(* 1 z4end1)) (* t4end -2)))

我想用一个简单的公式来表达以下几点:

代码语言:javascript
复制
(assert exists (x00 x01) ("the above expression"))

然后执行量词消去。

有人知道怎么走吗?我知道如何使用z3py来实现它,但是我需要一些更快的解决方案。

非常感谢你的任何暗示。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-04-09 10:43:07

一个可能的解决方案如下

代码语言:javascript
复制
(declare-fun x00 () Real)
(declare-fun x01 () Real)
(declare-fun x10 () Real)
(declare-fun x11 () Real)
(declare-fun t0init () Real)
(declare-fun z0init0 () Real)
(declare-fun z0init1 () Real)
(define-fun conjecture () Bool
   (and (>= t0init 0) (= (+ x00 z0init0) x10) (= (+ x01 z0init1) x11)))
(assert (exists ((x00 Real) (x01 Real)) conjecture))
(check-sat)

而相应的输出是

代码语言:javascript
复制
sat

我不确定您所需要的量词消除是否会与Z3一起工作。也许对于你的问题,“减少”的"Redlog“是更好的选择。万事如意。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22959546

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档