Z3中警告消息背后的原因是什么:"找不到量词的模式(量词id:k!18)"

Ash*_*hiq 6 z3

我发现了一个问题,如下面的简单SMT-LIB程序所示.

SMT-LIB代码:

(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)
Run Code Online (Sandbox Code Playgroud)

这给出了以下警告:

WARNING: failed to find a pattern for quantifier (quantifier id: k!18)
sat
........
........
Run Code Online (Sandbox Code Playgroud)

我想知道警告信息.我知道我错过了什么,但我无法理解.任何人都可以帮我解决这个问题吗?

Leo*_*ura 3

Z3 使用不同的引擎来处理量词(请参阅Z3 指南)。这些引擎之一基于模式匹配(E-Matching)。Z3 尝试推断每个量化公式的模式。如果找不到,则会发出警告消息。用户还可以为每个量词提供模式。该指南展示了如何操作。该idk!18是Z3创建的默认id。它基于行号(在您的情况下为第 18 行)。您还可以为量词提供您自己的 id。该警告只是告诉用户电子匹配引擎将无法处理指定的量词。