我已经设法使用 Z3 创建了一个记录数组,但现在正在努力查看在数组上执行 $\forall$ 操作所需的语法......这是我到目前为止的 SMT-LIB2 代码片段示例.
(declare-datatypes () ((rec (mk-R5 (age Int) (area Int) (married Bool)))))
(declare-const recs (Array Int rec))
(declare-const r1 rec)
(assert(= (age r1) 15))
(assert(= (area r1) 10001))
(assert(= (married r1) true))
(declare-const r2 rec)
(assert(= (age r2) 35))
(assert(= (area r2) 2845))
(assert(= (married r2) true))
(declare-const x Int)
(declare-const y Int)
(assert (= recs (store recs x r1)))
(assert (= recs (store recs y r2)))
(assert(forall ((i rec)) (= (married i) true)))
(check-sat)
(get-model)
我想倒数第三行应该对数组有一些参考,但我已经尝试了一切,教程并没有帮助我解决这个问题。
如何对这里的数组执行 $\forall$ 操作?