我有一个未解释的函数,其值由一些约束计算。
Z3给出的模型包含这些陈述 -
(define-fun matrix!2 ((x!1 Int) (x!2 Int)) Int
(ite (and (= x!1 0) (= x!2 5)) 10
(ite (and (= x!1 1) (= x!2 5)) 11
(ite (and (= x!1 0) (= x!2 1)) 1
(ite (and (= x!1 0) (= x!2 2)) 3
(ite (and (= x!1 0) (= x!2 3)) 5
(ite (and (= x!1 0) (= x!2 4)) 7
0)))))))
(define-fun k!0 ((x!1 Int)) Int
(ite (>= x!1 0) (ite (>= x!1 1) 1 0) (- 1)))
(define-fun k!1 ((x!1 Int)) Int
(let ((a!1 (ite (>= x!1 3) (ite (>= x!1 4) (ite (>= x!1 5) 5 4) 3) 2)))
(ite (>= x!1 1) (ite (>= x!1 2) a!1 1) 0)))
(define-fun matrix ((x!1 Int) (x!2 Int)) Int
(matrix!2 (k!0 x!1) (k!1 x!2)))
现在,我想看看实际值是多少
(matrix 0 0), (matrix 2 0), (matrix 2 2)
等。
问题:
答案 0 :(得分:1)
以下情况如何?
(declare-fun m05 () Int)
(declare-fun m15 () Int)
(assert (= m05 (matrix 0 5)))
(assert (= m15 (matrix 1 5)))
(check-sat)
(get-model)