【问题标题】:Label on SMT-LIB 2.0 assertions in z3z3 中 SMT-LIB 2.0 断言上的标签
【发布时间】:2011-12-09 21:20:39
【问题描述】:

您能告诉我如何在 z3 SMT-LIB 2.0 基准测试中命名断言吗?我更喜欢使用 SMT-LIB 的标准语法,但由于 z3 似乎不理解它,我只是在寻找一个使用 z3 的语法。需要获得带有标签的未饱和核心。

这是我测试的基准示例:

(set-option enable-cores)
(set-logic AUFLIA)
(declare-fun x () Int)
(declare-fun y () Int)
(declare-fun z () Int)
(assert (! (<= 0 x) :named hyp1))
(assert (! (<= 0 y) :named hyp2))
(assert (! (<= 0 z) :named hyp3))
(assert (! (< x y) :named hyp4))
(assert (! (and (<= 0 y) (<= y x)) :named hyp5))
(assert (! (not (= x z)) :named goal))
(check-sat)
(get-unsat-core)

由于矛盾(x

(error "ERROR: line 10 column 31: could not locate id  hyp1.")
(error "ERROR: line 11 column 31: could not locate id  hyp2.")
(error "ERROR: line 12 column 31: could not locate id  hyp3.")
(error "ERROR: line 13 column 30: could not locate id  hyp4.")
(error "ERROR: line 16 column 36: could not locate id  hyp5.")
(error "ERROR: line 18 column 35: could not locate id  goal.")
sat
()

我知道 z3 不理解这种命名方式,但我在 z3 文档中找不到另一种方式。

你能帮帮我吗?

【问题讨论】:

    标签: labels z3 smt


    【解决方案1】:

    如果我改变你的第一个命令

    (set-option enable-cores)
    

    (set-option :produce-unsat-cores true)
    

    然后我运行你的脚本:

    z3 -smt2 script.smt2
    

    我得到一个输出

    unsat
    (hyp4 hyp5)
    

    我相信你所期待的。请注意,我使用的是 Z3 3.2(适用于 Linux,但这应该没有任何区别)。

    【讨论】:

    • 谢谢,但我之前试过这个,我在未知 id 上得到同样的错误,加上这个消息:“(错误”第 20 行第 16 列:核心尚未启用,使用(set-option enable-cores)")",这就是我尝试使用上述选项的原因。我认为z3的版本是问题所在。我在 Linux 上使用 Z3 2.19。我去拿你的版本试试。
    • 确实:如果您查看release notes,您会发现自 Z3 2.19 以来,SMT-LIB 2.0 支持方面发生了很多变化。
    • 我刚试过。它适用于 Z3 3.2。再次感谢@Philippe。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-08-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-11-09
    相关资源
    最近更新 更多