可以选择将“sat”改为“不满”吗?

时间:2013-10-24 13:00:26

标签: options z3

来自Z3新手的另一个问题。可以选择改变Z3的行为吗?我可能会指望它们会影响终止,或者将satunsat更改为unknown但不将sat更改为unsat,反之亦然。

这个例子:

(set-option :smt.macro-finder true)

(declare-datatypes () ((Option (none) (some (Data Int)))))

(define-sort Set () (Array Option Option))
(declare-fun filter1 (Option) Option)
(declare-fun filter2 (Option) Option)

(declare-var s1 Set)
(declare-var s2 Set)
(declare-var x1 Option)
(declare-var x2 Option)
(declare-var x3 Option)
(declare-var x4 Option)

(assert (not (= x1 none)))
(assert (not (= x2 none)))
(assert (not (= x3 none)))
(assert (not (= x4 none)))
(assert (= (select s1 x1) x2))
(assert (= (select s2 x3) x4))

(assert (forall ((x Option)) (= (filter1 x) (ite (or (= none x) (= (Data x) 1)) x none))))
(assert (forall ((x Option)) (= (filter2 x) (ite (or (= none x) (= (Data x) 2)) x none))))

(assert (= ((_ map filter1) s1) s2))
(assert (= ((_ map filter2) s1) s2))
(check-sat)
(get-model)

返回sat第一行和unsat没有它。

这是一个错误还是我错过了一些基本的东西?

谢谢, Ñ

1 个答案:

答案 0 :(得分:0)

这是一个错误。这两个量词基本上为filter1filter2提供了“定义” 选项smt.macro-finder用于通过扩展这些定义来消除函数符号。它实质上是在进行“宏观扩张”。但是,宏扩展器中存在错误。它不会扩展地图构造中filter1filter2的出现次数:(_ map filter1)(_ map filter2)

此错误将得到修复。 在此期间,我们不应同时使用map构造和smt.macro-finder选项。

相关问题