This module implements a Z3 style analysis of instantiation sets for the MBQI procedure on
BitVec encoded EPR problems. The procedure tracks the following sets:
- For every predicate
pfor each argument positionia set of ground termsA_p_i - For every quantified variable
x- a set of ground terms
S_x, referred to as the instantiation set ofx - a set of variables, called the "avoid set"
- a set of ground terms, called the "exception set"
- a set of ground terms
In an initial step we analyze all existing quantifiers and visit their propositional atoms with polarity information:
x = tin:- negative polarity: adds the ground term
ttoS_x. - positive polarity: makes makes
tan exception forxand puts every element of the sort intoS_x.
- negative polarity: adds the ground term
x = yin:- negative polarity: merges all sets of
xandy. - positive polarity: puts
xandyinto each other's avoid set.
- negative polarity: merges all sets of
p(.., x, ..)withxat positionimerges the classes ofxandA_p_i.
After this initial analysis of the quantifiers we can inspect the ground instances (and continue to
do so as the CEGAR loop works), here we are interested in correctly maintaining the A_p_i sets by
inserting ground terms t occuring at position i in p. In particular, only the positions where
where a variable occurs matter, the rest can be discarded.
By continously updating the instantiation sets during the CEGAR loop we maintain candidate sets of
interesting values for all variables in the form of the S_x sets. We use these to limit the search
to interesting instances as opposed to always allowing any member of the sort in.
The avoid and exception sets are used to build clever models of predicates that help this procedure.
If e is a full application of toBvPredₙ, return n. A full application consists of 4 * n
sort encoding arguments, the predicate itself and n BitVec arguments.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The information associated with a frozen class of the instantiation set analysis.
- sort : SortId
- full : Bool
Whether the instantiation set contains all elements of the sort.
The ground terms in the instantiation set, in the order they were discovered.
- termSet : Std.HashSet Expr
- exceptions : Std.HashSet Expr
Ground terms whose value the projection else value should avoid.
- avoid : Std.HashSet Nat
Classes whose projection else value the projection else value of this class should avoid.
Instances For
The frozen result of the instantiation set analysis, enriched with ground terms as the CEGAR loop discovers them.
- classes : Std.HashMap Nat InstClass
Map from eqc roots to their information.
For each quantified fact and each of its variables the eqc root of
S_x.- posRoot : Std.HashMap (Expr × Nat) Nat
For each
(p, i)that has a quantified variable at argumentiofpthe eqc root ofA_p_i. Exactly these positions require a projection.
Instances For
Analyze the quantified facts of problem. The ground terms of the problem are not taken into
account yet, they have to be added through addGround.
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Trace the instantiation sets of all classes that are not unrestricted.
Equations
- One or more equations did not get rendered due to their size.