【发布时间】:2012-07-22 10:44:47
【问题描述】:
说我有
t1<x and x<t2
是否可以隐藏变量 x 以便
t1<t2
在 Z3 中?
【问题讨论】:
说我有
t1<x and x<t2
是否可以隐藏变量 x 以便
t1<t2
在 Z3 中?
【问题讨论】:
使用Redlog的Redlog的可能解决方案:
【讨论】:
您可以使用量词消除来做到这一点。这是一个例子:
(declare-const t1 Int)
(declare-const t2 Int)
(elim-quantifiers (exists ((x Int)) (and (< t1 x) (< x t2))))
您可以在线尝试此示例:http://rise4fun.com/Z3/kp0X
【讨论】:
t1、t2 和x 是整数。对于整数,如果a < b 那么a <= b - 1。因此,结合不等式t1 <= x - 1 和x <= t2 - 1,我们得到t1 - t2 <= -2。如果我们将Int替换为Real,我们将得到一个等价于t1 - t2 < 0的公式。