SMTLIB 语法中的 z3 量词消除

z3 quantifiers elimination in SMTLIB syntax

我有以下使用 z3py 消除量词的示例。但是我想使用 SMTLIB 语法重写它(代码低于 python 代码)。不知何故,我没有得到与从 python 得到的相同的输出,它们是公式。我想知道是否有人可以指出我的问题。

从 z3 导入 * a, 五 = Ints('a five') cmp = Bool('cmp')<br> j = 目标() j.add(存在([五, cmp], 并且(五==一个, cmp == (5 < 1000), 假 == cmp)))<br> t = 策略('qe') print(t(j)) # 输出 [[1000 <= a]]

(declare-fun five () Int) (declare-fun a () Int) (declare-fun cmp () Bool) (assert (exists ((five Int) (cmp Bool)) (and (= five a) (= cmp (< five 1000)) (= cmp false) ))) (apply (then qe smt))

输出 (目标 (目标 :精度精确:深度1) )

我问得太快了。经过更多搜索(Quantifier Elimination - More questions),我在下面找到了解决方案。

(declare-fun five () Int) (declare-fun a () Int) (declare-fun cmp () Bool) (assert (exists ((five Int) (cmp Bool)) (and (= five a) (= cmp (< five 1000)) (= cmp false) ))) (apply (using-params qe :qe-nonlinear true))