Region (model checking) explained
In model checking, a field of computer science, a region is a convex polytope in
for some dimension
, and more precisely a zone, satisfying some minimality property. The regions partition
.
The set of zones depends on a set
of constraints of the form
,
,
and
, with
and
some variables, and
a constant. The regions are defined such that if two vectors
and
belong to the same region, then they satisfy the same constraints of
. Furthermore, when those vectors are considered as a tuple of
clocks, both vectors have the same set of possible futures. Intuitively, it means that any
timed propositional temporal logic-formula, or
timed automaton or
signal automaton using only the constraints of
can not distinguish both vectors.
The set of region allows to create the region automaton, which is a directed graph in which each node is a region, and each edge
ensure that
is a possible future of
. Taking a product of this region automaton and of a
timed automaton
which accepts a language
creates a
finite automaton or a
Büchi automaton which accepts untimed
. In particular, it allows to reduce the emptiness problem for
to the emptiness problem for a finite or Büchi automaton. This technique is used for example by the software
UPPAAL.
[1] Definition
Let
a set of
clocks. For each
let
. Intuitively, this number represents an upper bound on the values to which the clock
can be compared. The definition of a region over the clocks of
uses those numbers
's. Three equivalent definitions are now given.
Given a clock assignment
,
denotes the region in which
belongs. The set of regions is denoted by
.
Equivalence of clocks assignment
The first definition allow to easily test whether two assignments belong to the same region.
A region may be defined as an equivalence class for some equivalence relation. Two clocks assignments
and
are equivalent if they satisfy the following constraints:
[2]
iff
, for each
and
an integer, and ~ being one of the following relation
=,
< or
≤.
\{\nu1(x)\}\sim\{\nu1(y)\}
iff
\{\nu2(x)\}\sim\{\nu2(y)\}
, for each
,
,
,
being the
fractional part of the real
, and ~ being one of the following relation
=,
< or
≤.
The first kind of constraints ensures that
and
satisfies the same constraints. Indeed, if
and
, then only the second assignment satisfies
. On the other hand, if
and
, both assignment satisfies exactly the same set of constraint, since the constraints use only integral constants.
The second kind of constraints ensures that the future of two assignments satisfy the same constraints. For example, let
\nu1=\{x\mapsto0.5,y\mapsto0.6\}
and
\nu2=\{x\mapsto0.5,y\mapsto0.4\}
. Then, the constraint
is eventually satisfied by the future of
without clock reset, but not by the future of
without clock reset.
Explicit definition of a region
While the previous definition allow to test whether two assignments belong to the same region, it does not allow to easily represents a region as a data structure. The third definition given below allow to give a canonical encoding of a region.
A region can be explicitly defined as a zone, using a set
of equations and inequations satisfying the following constraints:
,
contains either:
for some integer
for some integer
,
,
- furthermore, for each pair of clocks
, where
contains constraints of the form
and
, then
contains an (in) equality of the form
with
being either
=,
< or
≤.
Since, when
and
are fixed, the last constraint is equivalent to
.
This definition allow to encode a region as a data structure. It suffices, for each clock, to state to which interval it belongs and to recall the order of the fractional part of the clocks which belong in an open interval of length 1. It follows that the size of this structure is
O\left(\sumlog(ck)+|C|log(|C|)\right)
with
the number of clocks.
Timed bisimulation
Let us now give a third definition of regions. While this definition is more abstract, it is also the reason why regions are used in model checking. Intuitively, this definition states that two clock assignments belong to the same region if the differences between them are such that no timed automaton can notice them. Given any run
starting with a clock assignment
, for any other assignment
in the same region, there is a run
, going through the same locations, reading the same letters, where the only difference is that the time waited between two successive transition may be different, and thus the successive clock variations are different.
The formal definition is now given. Given a set of clock
, two assignments two clocks assignments
and
belongs to the same region if for each
timed automaton
in which the guards never compare a clock
to a number greater than
, given any location
of
, there is a timed
bisimulation between the extended states
and
. More precisely, this bisimulation preserves letters and locations but not the exact clock assignments.
Operation on regions
Some operations are now defined over regions: Resetting some of its clock, and letting time pass.
Resetting clocks
Given a region
defined by a set of (in)equations
, and a set of clocks
, the region similar to
in which the clocks of
are restarted is now defined. This region is denoted by
, it is defined by the following constraints:
not containing the clock
,
for
.
The set of assignments defined by
is exactly the set of assignments
for
.
Time-successor
Given a region
, the regions which can be attained without resetting a clock are called the time-successors of
. Two equivalent definitions are now given.
Definition
A clock region
is a time-successor of another clock region
if for each assignment
, there exists some positive real
such that
\nu+t\nu,\alpha'\in\alpha'
.
Note that it does not mean that
\alpha+t\nu,\alpha'=\alpha'
. For example, the region
defined by the set of constraint
has the time-successor
defined by the set of constraint
. Indeed, for each
, it suffices to take
. However, there exists no real
such that
or even such that
; indeed,
defines a triangle while
defines a segment.
Computable definition
The second definition now given allow to explicitly compute the set of time-successor of a region, given by its set of constraints.
Given a region
defined as a set of constraints
, let us define its set of time-successors. In order to do so, the following variables are required. Let
the set of constraints of
of the form
. Let
the set of clocks
such that
contains the constraint
. Let
the set of clocks
such that there are no constraints of the form
in
.
If
is empty,
is its own time successor. If
, then
is the only time-successor of
. Otherwise, there is a least time-successor of
not equal to
. The least time-successor, if
is non-empty, contains:
,
, and
such that
does not belong to
, the constraint
.If
is empty, the least time-successor is defined by the following constraints:
not using the clocks of
,
, for each constraint
in
, with
.
Properties
There are at most
regions, where
is the number of clocks.
Region automaton
Given a timed automaton
, its
region automaton is a
finite automaton or a
Büchi automaton which accepts untimed
. This automaton is similar to
, where clocks are replaced by region. Intuitively, the region automaton is contructude as a product of
and of the region graph. This region graph is defined first.
Region graph
The region graph is a rooted directed graph which models the set of possible clock valuations during a run of a timed-autoamton. It is defined as follows:
- its nodes are regions,
- its root is the initial region
, defined by the set of constraints
,
(\alpha,\alpha'[C'\mapsto0])
, for
a time-successor of
.
Region automaton
Let
lA=\langle\Sigma,L,L0,C,F,E\rangle
a
timed automaton. For each clock
, let
the greatest number
such that there exists a guard of the form
in
. The
region automaton of
, denoted by
is a finite or Büchi automaton which is essentially a product of
and of the region graph defined above. That is, each state of the region automaton is a pair containing a location of
and a region. Since two clocks assignment belonging to the same region satisfies the same guard, each region contains enough information to decide which transitions can be taken.
Formally, the region automaton is defined as follows:
,
,
with
the initial region,
- its set of accepting states is
,
contains
((\ell,\alpha),a,(\ell',\alpha'[C'\mapsto0]))
, for
, such that
and
is a time-successor of
.
Given any run
r=(\ell0,\nu0)\xrightarrow[t1]{\sigma1}(\ell1,\nu1)...
of
, the sequence
(\ell0,[\nu0])\xrightarrow{\sigma1}(\ell1,[\nu1])...
is denoted
, it is a run of
and is accepting if and only if
is accepting. It follows that
L(R(lA))=\operatorname{Untime}(L(lA))
. In particular,
accepts a timed-word if and only if
accepts a word. Furthermore, an accepting run of
can be computed from an accepting run of
.
References
- Book: Bengtsson . Johan . Yi . Wang L . Lectures on Concurrency and Petri Nets . Timed Automata: Semantics, Algorithms and Tools . Lecture Notes in Computer Science . 2004 . 3098 . 87–124 . 10.1007/978-3-540-27755-2_3 . 978-3-540-22261-3 . http://www.it.uu.se/research/group/darts/papers/texts/by-lncs04.ps.
- Alur . Rajeev . Dill . David L . A theory of timed automata . Theoretical Computer Science . April 25, 1994 . 126 . 2 . 183–235 . 10.1016/0304-3975(94)90010-8 . free .