【问题标题】:Model for QF_AUFBV Query Missing the Array缺少数组的 QF_AUFBV 查询模型
【发布时间】:2013-01-24 18:37:14
【问题描述】:

我有以下查询(使用 SMT-LIB v1.0 标准编写):

(benchmark gametime
:status unknown
:logic QF_AUFBV
:extrafuns ((x  BitVec[32]))
:extrafuns ((a  Array[32:32]))
:extrapreds ((constraint1 ))
:extrapreds ((constraint0 ))
:formula
(flet ($x37 (and (iff constraint0 (= (select a bv0[32]) bv0[32])) (iff constraint1 (= x bv1[32]))))
(and $x37 (and constraint0 constraint1)))
)

(查询有点多余,但它是自动生成的。)

通过 Z3 运行此程序,并要求提供模型,我收到以下信息:

a -> as-array[k!0]
constraint1 -> true
x -> bv1[32]
constraint0 -> true
k!0 -> {
  bv0[32] -> bv0[32]
  else -> bv0[32]
}

这很好,因为我根据需要有“a”和“x”的值。然而,另一个查询是类似的,除了一个小的变化:

(benchmark gametime
:status unknown
:logic QF_AUFBV
:extrafuns ((x  BitVec[32]))
:extrafuns ((a  Array[32:32]))
:extrapreds ((constraint1 ))
:extrapreds ((constraint0 ))
:formula
(flet ($x37 (and (iff constraint0 (**bvuge** (select a bv0[32]) bv0[32])) (iff constraint1 (= x bv1[32]))))
(and $x37 (and constraint0 constraint1)))
)

突出显示了更改:以前的相等现在是“bvuge”检查。我从 Z3 收到以下型号:

constraint1 -> true
x -> bv1[32]
constraint0 -> true

我没有“a”的作业了。这是故意的吗?如果模型中不存在我应该假设的变量的“默认”值吗? (例如,这里的默认值是数组“a”处处为零。)

不管怎样,这个问题只有在操作是“bvuge”时才会出现。其他的(“bvsge”、“bvugt”、“bvsgt”、“bvult”、“bvslt”、“bvule”、“bvsle”)似乎有效。

【问题讨论】:

    标签: z3


    【解决方案1】:

    我没有“a”的作业了。这是故意的吗?

    是的,这是故意的。数组的任何值都将满足公式。 这是因为约束0:

       (bvuge (select a bv0[32]) bv0[32])) 
    

    等价于真。在无符号比较下,任何位向量值都大于或等于 0。 所以'a'的值是无关紧要的。

    【讨论】:

    • 啊,谢谢!那么有没有办法“强制”一个值(即使是任意的)出现在模型中?
    猜你喜欢
    • 2023-01-17
    • 2017-03-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多