What is the reason behind the warning message in Z3: “failed to find a pattern for quantifier (quantifier id: k!18) ”

两盒软妹~` 提交于 2019-12-10 13:43:38

问题


I find an issue as shown in the following simple SMT-LIB program.

The SMT-LIB code:

(declare-fun isDigit (Int) Bool)
(assert (forall ((x Int))
    (=>     (isDigit x)
        (and (>= x 0) (< x 10))
    )
  )
) 

(assert (forall ((x Int))   
    (=>     (and (>= x 12) (< x 15))
        (exists ((y Int))
            (and    (>= y 1) (< y 6)
                (isHost (- x y))
            )
        )
    )
  )
)

(check-sat)
(get-model)

This gives the following warning:

WARNING: failed to find a pattern for quantifier (quantifier id: k!18)
sat
........
........

I am wondering about the warning message. I know I am missing something, but I cannot understand. Can anyone help me in this issue?


回答1:


Z3 uses different engines for handling quantifiers (see Z3 guide). One of these engines is based on pattern matching (E-Matching). Z3 tries to infer patterns for each quantified formula. If it can't find one, it issues the warning message. The user may also provide patterns for each quantifier. The guide shows how to do it. The id k!18 is the default id created by Z3. It is based on the line number (line 18 in your case). You can also provide your own ids for quantifiers. The warning is just telling users that the E-matching engine will not be able to handle the specified quantifier.



来源:https://stackoverflow.com/questions/9189949/what-is-the-reason-behind-the-warning-message-in-z3-failed-to-find-a-pattern-f

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