【发布时间】:2015-06-12 06:50:33
【问题描述】:
在玩 nuZ 时,我偶然发现了这个:
(declare-fun x () Int)
(declare-fun y () Int)
(assert-soft (= x 1) :weight 1 :id first)
(assert-soft (= y 4) :weight 3 :id first)
(assert-soft (= x 2) :weight 1 :id second)
(assert-soft (= y 5) :weight 3 :id second)
(assert-soft (= x 3) :weight 1 :id third)
(assert-soft (= y 6) :weight 3 :id third)
(maximize (+ x y))
(check-sat)
(get-model)
给了我这个结果(使用 Z3 不稳定分支 4.4.0):
first |-> 0
second |-> 4
third |-> 4
(+ x y) |-> 5
sat
(model
(define-fun x () Int
1)
(define-fun y () Int
4)
)
我不太了解输出。我知道在第一步中重量是最大化的。
当权重相等时,nuZ 不应该最大化目标 (+ x y) 吗?
问候, 约翰
【问题讨论】:
标签: optimization z3