I'd like to use variable-only patterns to obtain decision procedures for certain theories encoded using quantified axioms. More precisely, I want to enforce that certain variables in these axioms are instantiated with all terms of the corresponding sort. These variables only appear below predicate symbols, so there is no danger for creating matching loops.
For example, consider the following partial query:
(declare-sort Loc 0)
(declare-sort Map 2)
(declare-fun read ((Map Loc Loc) Loc) Loc)
(declare-fun Btwn ((Map Loc Loc) Loc Loc Loc) Bool)
...
(assert (forall ((?f (Map Loc Loc)) (?x Loc) (?y Loc))
(or (not (= (read ?f ?x) ?x)) (not (Btwn ?f ?x ?y ?y)) (= ?x ?y))))
In the axiom, I'd like to instantiate the variables ?f and ?x for all ground terms matching read ?f ?x and the variable ?y with all terms of sort Loc.
If I add the following multi-pattern to the axiom:
:pattern ((read ?f ?x) ?y)
then Z3 reports an error for the variable-only pattern ?y. If I omit ?y in the pattern as follows:
:pattern ((read ?f ?x))
then Z3 reports a warning saying that not all variables occur in the pattern. It seems impossible to suppress this warning. Also, in this case, I am not sure whether the pattern actually yields the intended instantiations. Is there a solution that gives me the instantiations I am looking for (without warnings)?
Note that the theories I am interested in don't fall into any of the fragments for which MBQI alone yields a decision procedure (as far as I understand). I can partially instantiate the axioms up-front to obtain an EPR theory (which is what I do at the moment), but I'd rather like the solver to do this for me.