PBES Greybox Implementation Notes
Gijs Kant
Instantiation from PBES to Parity Game
PBES
Predicate formulae are defined by the following grammar:
where ,
,
is a data term of sort
,
is a
predicate variable,
is a data variable of sort
, and
is a vector
of data terms. Any predicate formula without predicate variables is called a simple formula. The
class of predicate formulae is denoted
.
Definition
A First-Order Boolean Equation is an equation of the form:
where is a minimum (
) or maximum (
) fixed
point operator,
is a data variable of sort
, and
is a predicate
formula.
Definition
A Parameterised Boolean Equation System (PBES) is a sequence of First-Order Boolean Equations:
We adopt the standard limitations: expressions are in positive form (negation occurs only in data expressions) and every variable occurs only once as the left hand side of an equation. A PBES that contains no quantifiers and parameters is called a Boolean Equation System (BES). A PBES can be instantiated to a BES by expanding the quantifiers to finite conjunctions or disjunctions and substituting concrete values for the data parameters.
A one-to-one mapping can be made from a BES to an equivalent parity game if the BES has only expressions that are either conjunctive or disjunctive. The parity game is then represented by a game graph with nodes that represent propositional variables with concrete parameters and edges that represent dependencies. To make instantiation of a PBES to a parity game more direct, we preprocess the PBES to a format that only allows expressions to be either conjunctive or disjunctive. This format is called the Parameterised Parity Game.
Definition
A PBES is a Parameterised Parity Game (PPG) if every right hand side of an equation is a formula of the form:
where and
are simple boolean formulae and
is a data
expression.
and
are finite (possibly empty) index sets.
The expressions range over two index sets and
. The left part is a conjunction
(or disjunction) of simple expressions
that can be seen as conditions that must hold in
the current state. The right part is a conjunction (or disjunction) of quantifiers over a (possibly
empty) vector of variables for next states
with parameters
,
guarded by simple expression
.
Before transforming arbitrary PBESs to PPG we first define another normal form on PBESs to make
the transformation easier. This normal form allows an arbitrary sequence of bounded quantifiers as
outermost operators with a conjunctive normal form at the core, called the Bounded Quantifier Normal
Form (BQNF). This is similar to Predicate Formula Normal Form (PFNF), implemented in the
pbesrewr tool, in that quantification is outermost and the core is a conjunctive normal form.
Unlike PFNF, BQNF allows bounds on the quantified variables (hence bounded quantifiers), and
universal quantification is allowed within the conjunctive part while existential quantification is
allowed within the disjunctive parts.
Definition
A First-Order Boolean formula is in Bounded Quantifier Normal Form (BQNF) if it has the form:
where ,
,
,
, and
are simple
boolean formulae, and
is a data expression.
,
,
,
and
are finite (possibly empty) index sets.
Translation from BQNF to Parameterised Parity Game
In order to automatically transform a PBES to a PPG, we define a transformation function from BQNF
to PPG. For brevity, types of parameters are omitted. For equation system
with each
in BQNF, the translation to
PPG is defined as follows. Here
,
(variables in
do not occur in
),
,
,
,
are simple formulae, and
,
are formulae that may contain predicate variables.
For a full equation system:
For a simple equation body (no quantifiers):
For a universally quantified body:
For an existentially quantified body:
For a conjunctive CONJ body:
For a disjunctive CONJ body:
The helper functions and
are:
Move Quantifiers Inward
Note the following equality:
Since the PPG form requires conjuncts of quantifiers rather than quantifiers over conjuncts, it is
useful to rewrite expressions so that conjunctions appear more on the outside and universal
quantifiers more to the inside. In the rewriting, not all parameters of the quantifier have to be
moved inward (see the example below). For this we introduce the quantifier inward rewriter
:
where is an arbitrary expression in BQNF and
is a data term of sort
. The guarded condition
is defined as:
The function is defined recursively as follows, where
and
:
Example
The formula forall x,y . (x < 5) => ((x==a) /\ (y==b)) should translate to:
(forall x . (x < 5) => (x==a)) /\ (forall y . (exists x . x < 5) => (y==b))
Partitioned State Vector, Transition Groups, and Dependency Matrix
We regard the instantiation of PBESs to Parity Games as generating a transition system, where states are propositional variables with concrete parameters and transitions are dependencies, specified by the right hand side of the corresponding equation in the PBES. We use the tool LTSmin to generate a Parity Game given a PBES.
Partitioned State Vector
The state is represented as a vector for a fixed
. For PBES instantiation, the state vector is partitioned as:
where is a propositional variable and for
each
is the value of parameter
.
is the total number of parameter
signatures in the system, ordered alphabetically; the signature consists of the name and type of the
parameter. From the propositional variable
, the type
, priority (an integer value), and fixpoint operator
can be derived.
Transition Groups
The equations in the PBES specify the transitions between states. These transitions can be partitioned by the part of the equation system they originate from — in this case, the parts of the right hand sides of the equations.
For a PBES of the form:
for each there is a transition group
with an associated
transition relation
, defined as:
for all such that
.
Example
A specification of two sequential buffers (buffer.2):
with the property that if a message is read through , it will eventually be
sent through
:
The resulting PBES is (transition groups numbered (1)–(9)):
For this equation system, the structure of the state vector is
. The initial
state is encoded as
; since the initial
state has no parameter
, a default value is chosen. The numbers (1)–(9) denote the
different transition groups: each conjunct of a conjunctive expression forms a group. For example:
yields the empty set because
.
results
in
.
Dependency Matrix
For an equation , the list of parameters is
. Let
be
the set of free data variables occurring in a data term
. Let
be the set of free data variables occurring in an expression
such that the variables are not merely passed on to the next state. For example,
with
, for the expression
,
. The variable
is not in the set because it does
not influence the computation but is only passed on to the next state.
For a formula , the function
computes the variable
parameters changed in the formula:
The function determines if
contains a branch that directly
results in
or
(not a variable). For group
and state vector part
, we define read dependence
and write dependence
:
Definition
For a PPG , the PPG dependency matrix
is a
matrix
defined for
and
as:
Example
For the PBES in the previous example, the dependency matrix is:
g |
X |
q_in |
q_out |
d |
|---|---|---|---|---|
1 |
w |
|||
2 |
||||
3 |
||||
4 |
||||
5 |
||||
6 |
r |
|||
7 |
||||
8 |
r |
|||
9 |
+ denotes both read and write dependency, w write dependency only, r read dependency
only, and - no dependency between the group and the state vector part. The effect of caching
is illustrated by transition group (5): it only moves states from to
without affecting parameters. Once such a transition has been computed (by
Group-Next) it can be applied to any
-state simply by replacing
with
.
Helpful Functions
For an equation :
Let be the set of free data variables occurring in a data term
. The function
is defined as:
For a formula , the function
computes the
variable parameters changed in the formula:
For a formula , the function
computes the
variable parameters in
that are reset in the formula (meaning that in a successor
state those parameter values will not be used):
For a formula , the function
determines if it contains a
branch that directly results in a boolean value (not a variable):