LPS Implementation Notes
The LPS-library
This document describes data types and algorithms of the LPS-library.
Terms
For an arbitrary term we define
as the set of data
variables that occur in
. The result of substituting
for
in a term
is denoted as
. With
we
denote that data variable
is a subterm of data expression
.
Timed Linear processes
Let be the set of all data expressions, with
an
equivalence relation on
. All data expressions have implicitly
defined an associated sort. Let
be the set of all
data variables. Furthermore, let
be the set of action labels.
A timed linear process
is a process equation of the following form:
(2)
and and
are disjoint and finite index sets, and for
:
is the condition function,
is a multi-action
, where
is the action parameter function,
is the time stamp function,
is the next state function.
The components of vector
are called the process parameters of
.
Untimed Linear processes
Similarly, an untimed linear process is a process equation of the
following form:
(3)
with ,
and
defined as above.
State Space
An untimed linear process (3) with initial value
defines a labeled transition system
, where
is the (possibly infinite) set of states,
is the (possibly infinite) set of labels,
,
is the initial state.
For we define
as
.
Global variables
In the mCRL2 tool set a linear process is parameterized with a finite set
of so called global variables. This means that the expressions
,
,
, and
may contain
unbound variables from the set
. Global variables have the implicit
property that any two processes obtained by assigning values to them are
strongly bisimulation equivalent. In many algorithms we will simply ignore
global variables. In some cases, algorithms may assign values to some of the
global variables.
Notations
Let be an untimed linear process as defined in (3).
A constant parameter of
is a parameter
that has a constant value for all reachable states of the corresponding state space, given an initial state
.
An insignificant parameter of
is a process parameter
such that for any two initial states that differ only at the value of
, the corresponding state spaces are isomorphic.
Let
be a linear process,
a data variable and
a data expression. Then
is the linear process obtained from
by applying the substitution
to all terms
,
,
, and
that appear in the definition of
.
Linear processes
Linear process expressions in mCRL2 are expressions built according to the following syntax:
Expression |
C++ equivalent |
ATerm grammar |
|---|---|---|
|
Action |
|
|
LinearProcessSummand |
|
|
LinearProcessSummand |
|
process_initializer(f, d:=e)(where
|
LinearProcessInit |
|
linear_process(f, v, s)(where
|
LinearProcess |
where the types of the symbols are as follows:
a (timed) multi-action |
|
a string (action name) |
|
a (timed) deadlock |
|
a process identifier |
|
a sequence of data expressions |
|
a sequence of data variables |
|
a data expression of type real |
|
a sequence of summands |
|
a data expression of type bool |
A grammar for linear processes can be found in the Process implementation notes document.
Well typedness constraints
Not all linear processes that adhere to the grammar for linear processes are considered valid. A number of restrictions apply to make them valid input for the mCRL2 toolset. These restrictions are called well typedness constraints.
Well typedness constraints for data specifications
the domain and range sorts of constructors are declared in the data specification
the domain and range sorts of mappings are declared in the data specification
Well typedness constraints for a linear process
the process parameters have unique names
process parameters and summation variables have different names
the left hand sides of the assignments of summands are contained in the process parameters
the summands are well typed
Well typedness constraints for linear process specifications
the sorts occurring in the summation variables are declared in the data specification
the sorts occurring in the process parameters are declared in the data specification
the sorts occurring in the global variables are declared in the data specification
the sorts occurring in the action labels are declared in the data specification
the action labels occurring in the linear process are declared in the action specification
the data specification is well typed
the linear process is well typed
the process initializer is well typed
the global variables occurring in the linear process are declared in the global variable specification
the global variables occurring in the initial process are declared in the global variable specification
the global variables have unique names
Well typedness constraints for other types
the sorts of the left and right hand side of an assignment are the same
the time of a summand has type Real
the condition of a summand has type Bool
the set of left hand sides of assignments in an action summand or process initializer does not contain duplicates
Algorithms
We now define two operations on linear processes: removing (insignificant)
parameters and removing constant parameters. Let be a linear
process as defined in (3) or (2), and let
be a set of insignificant parameters of
. Then we define
as a linear
process obtained from
by removing
from the process parameters of
,
and by replacing each term
,
,
,
or
that appears in the definition of
, and that has one
of the variables
as a subterm by a term
,
,
, or
that
does not have one of the variables
as a subterm,
and such that the remaining process is strongly bisimulation equivalent to
[1].
Let be a linear process as defined in (3) or
(2), and let
be a set of
constant parameters of
, given the state
. Then we define
as a linear process obtained from
by removing
from the process parameters of
, and
by replacing each term
,
,
, or
that appears in the definition of
by a term
,
,
, or
that
does not have one of the variables
as a subterm,
and such that the remaining process is strongly bisimulation equivalent to
[2].
Or should this be restricted to the result of substituting all the constant values, and possibly applying the rewriter to it?
Parelm
Let be the stochastic linear process
with initial state
with the process parameters of
. The algorithm
is used to find insignificant process parameters that can be
eliminated from
without altering the corresponding state space. It is
not guaranteed that all insignificant process parameters are detected.
Parelm implementations
We define the following implementations of parelm:
where . Note that
is the
-th
component of the vector of terms
.
Note
In the implementation, the initial seed set (resp.
in
Parelm1) also includes variables occurring in deadlock summands
,
specifically variables free in the condition
and in the
time expression
. The dependency graph
is built
from action summands only, since deadlock summands have no next-state
assignment.
Constelm
Let be the stochastic linear process
with initial state
with the process parameters of
. The algorithm
is used to find process parameters that have a constant
value. If needed the global variables of
will be assigned constant
values. The result is a substitution
that assigns these constant
values to the corresponding process parameters and global variables. It is
not guaranteed that all constant parameters are detected.
Constelm implementations
Then we define the following implementation of :
where is the set of global variables of the linear process
,
is a rewriter, and
is the empty substitution (i.e. the
identity function). The notation
means
with
An alternative implementation:
where .
Conversion to linear process
The function converts a process expression to linear process format,
if it is linear.