我正在尝试编写类似于here中关于Z3中内置序列的约束:
feature pos gene_1 gene_2 gene_3 gene_n sum_all average_all
A 1 6/87 2/87 51/87 0/87 sum_row1 average_row1
A 2 4/87 5/87 8/87 2/87 sum_row2 average_row2
A 3 1/87 74/87 5/87 0/87 sum_row3 average_row3
B 1 11/54 2/54 41/54 89/54 sum_row4 average_row4
B 2 4/54 5/54 3/54 5/54 sum_row5 average_row5
B 3 4/54 0/54 5/54 21/54 sum_row6 average_row6
我可能这样做的方式不对,但我得到以下异常:
(declare-fun a () (Seq Int))
(declare-fun b () (Seq Int))
(assert (= a (seq.++ (seq.unit 1) (seq.unit 2))))
(assert (forall ((i Int)) (=> (and (<= 0 i) (< i (seq.len a))) (= (seq.at a i) (seq.at b i)))))
(check-sat)
一般情况下,Z3能否为描述“序列理解”的约束构建模型,即对内置序列进行映射和过滤?