Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

z3

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?

like image 880
Ashiq Avatar asked Feb 08 '12 08:02

Ashiq


1 Answers

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.

like image 162
Leonardo de Moura Avatar answered Oct 26 '22 18:10

Leonardo de Moura