【发布时间】:2013-12-06 19:02:30
【问题描述】:
我正在尝试解决一个涉及命题可满足性(使用量词)和线性算术的问题。
我已经制定了这个问题,Z3能够解决它,但是它花费的时间太长了。
我一直试图通过指定战术来帮助 Z3,但我没有取得太大进展(我对逻辑理论一无所知)。
以下是一个高度简化的问题,它抓住了我要解决的问题的本质。有人可以提出建议吗?
我尝试阅读 Nelson Oppen 方法之类的东西,但是有很多不熟悉的符号,并且需要很长时间才能学会。
另外,Z3 是否允许用户调整这些配置?最后,如何在 z3py 中使用这些策略?
(declare-datatypes () ((newtype (item1) (item2) (item3))))
(declare-fun f (newtype newtype) Bool)
(declare-fun cost (newtype newtype) Real)
(assert (exists ((x newtype)(y newtype)) (f x y)))
(assert (forall ((x newtype)(y newtype)) (=> (f x y) (> (cost x y) 0))))
(assert (forall ((x newtype) (y newtype)) (<= (cost x y) 5)))
(check-sat)
(get-model)
【问题讨论】: