Why does Z3 return “unknown” on this simple input?

旧时模样 提交于 2019-12-20 04:14:10

问题


Here is the input:

(set-option :auto-config false)
(set-option :mbqi false)
(declare-sort T6)
(declare-sort T7)
(declare-fun set23 (T7 T7) Bool)
(assert (forall ((bv1 T7) (bv0 T7))
  (= (set23 bv0 bv1) (= bv0 bv1))))
(check-sat)

Note that Z3 does not timeout. It returns unknown almost instantaneously.


回答1:


This returns unknown because you've disabled the quantifier handling mechanism (e.g., you disabled the model based quantifier instantiation module, MBQI), and it appears that with the options you've specified, Z3 does not have any other mechanisms enabled for deciding quantified formulas, so it figures out that it cannot decide your formula and returns unknown.

If you change that to true to enable MBQI, you will receive sat as expected. There are a variety of techniques (MBQI, quantifier elimination, etc.) for deciding quantified formulas in Z3 (see in the manual here for an overview: http://rise4fun.com/z3/tutorialcontent/guide#h28 ), e.g., for your example, you can also get sat as expected using the macro finder module (rise4fun link: http://rise4fun.com/Z3/NuQg ):

(set-option :auto-config false)
(set-option :mbqi false)
(set-option :macro-finder true)

(declare-sort T6)
(declare-sort T7)
(declare-fun set23 (T7 T7) Bool)
(assert (forall ((bv1 T7) (bv0 T7))
  (= (set23 bv0 bv1) (= bv0 bv1))))
(check-sat) ; sat


来源:https://stackoverflow.com/questions/22670784/why-does-z3-return-unknown-on-this-simple-input

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