当我更改单个断言而不更改定义的函数时,为什么Z3在它找到的模型中输出其他函数

时间:2019-03-31 23:53:45

标签: z3

假设我在Z3中运行以下命令

(declare-const x Int)
(declare-const y Int)
(declare-const z Int)
(assert (and (< x 4) (< x 3)))
(assert (< (- y x) 1))
(assert (> y 1))
(assert (= z y))
(minimize (+ x y z))
(check-sat)
(get-objectives)
(get-model)

这样做将产生以下结果

sat
(objectives
 ((+ x y z) 6)
)
(model 
  (define-fun y () Int
    2)
  (define-fun x () Int
    2)
  (define-fun z () Int
    2)
) 

如果我改为在Z3中运行以下命令(我所更改的只是x <3到x> 0的约束):

(declare-const x Int)
(declare-const y Int)
(declare-const z Int)
(assert (and (< x 4) (> x 0)))
(assert (< (- y x) 1))
(assert (> y 1))
(assert (= z y))
(minimize (+ x y z))
(check-sat)
(get-objectives)
(get-model)

我得到以下输出

sat
(objectives
 ((+ x y z) 6)
)
(model 
  (define-fun x () Int
    2)
  (define-fun z3name!6 () Int
    2)
  (define-fun y () Int
    2)
  (define-fun z3name!5 () Int
    0)
  (define-fun z () Int
    2)
)

据我了解,鉴于我所做的更改,模型不应更改。考虑到这一点在哪里

(define-fun z3name!6 () Int
   2)

(define-fun z3name!5 () Int
   0)

来自何处?我从未定义这些功能。此外,“ z3name!6”和“ z3name!5”是什么意思?

0 个答案:

没有答案