Can Z3 output “anything” for unconstrained values of UF?

不打扰是莪最后的温柔 提交于 2019-12-24 18:06:26

问题


Some values of uninterpreted functions can be unconstrained during the search. For example, if in smt query only f(1) is called, then f(2), f(3) can be anything. Is there a way (some option may be) to know which values were not used during the solving and therefore can be anything?


回答1:


For quantifier free problems, you can achieve that by using the option :model-partial to true. Here is an example (also available here):

(set-option :model-partial true)

(declare-fun f (Int) Int)

(assert (> (f 0) 0))
(assert (< (f 1) 0))

(check-sat)
(get-model)

In this example, we get the output:

sat
(model 
  (define-fun f ((x!1 Int)) Int
    (ite (= x!1 0) 1
    (ite (= x!1 1) (- 1)
      #unspecified)))
)

BTW, in the next release (Z3 4.3.2), this option is renamed to :model.partial. In the next release, the options are grouped in modules.



来源:https://stackoverflow.com/questions/15388999/can-z3-output-anything-for-unconstrained-values-of-uf

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!