我正在尝试解决一个涉及命题可满足性(使用量词)和线性算术的问题。
这个问题我已经制定好了,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)