Misplaced Pages

Region (model checking)

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these messages)
This article may be confusing or unclear to readers. In particular, Confusing to those unfamiliar with the topic. Please help clarify the article. There might be a discussion about this on the talk page. (April 2019) (Learn how and when to remove this message)
This article may be too technical for most readers to understand. Please help improve it to make it understandable to non-experts, without removing the technical details. (February 2023) (Learn how and when to remove this message)
(Learn how and when to remove this message)

In model checking, a field of computer science, a region is a convex polytope in R d {\displaystyle \mathbb {R} ^{d}} for some dimension d {\displaystyle d} , and more precisely a zone, satisfying some minimality property. The regions partition R d {\displaystyle \mathbb {R} ^{d}} .

The set of zones depends on a set K {\displaystyle K} of constraints of the form x c {\displaystyle x\leq c} , x c {\displaystyle x\geq c} , x 1 x 2 + c {\displaystyle x_{1}\leq x_{2}+c} and x 1 x 2 + c {\displaystyle x_{1}\geq x_{2}+c} , with x 1 {\displaystyle x_{1}} and x 2 {\displaystyle x_{2}} some variables, and c {\displaystyle c} a constant. The regions are defined such that if two vectors x {\displaystyle {\vec {x}}} and x {\displaystyle {\vec {x}}'} belong to the same region, then they satisfy the same constraints of K {\displaystyle K} . 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 K {\displaystyle K} 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 r r {\displaystyle r\to r'} ensure that r {\displaystyle r'} is a possible future of r {\displaystyle r} . Taking a product of this region automaton and of a timed automaton A {\displaystyle {\mathcal {A}}} which accepts a language L {\displaystyle L} creates a finite automaton or a Büchi automaton which accepts untimed L {\displaystyle L} . In particular, it allows to reduce the emptiness problem for A {\displaystyle {\mathcal {A}}} to the emptiness problem for a finite or Büchi automaton. This technique is used for example by the software UPPAAL.

Definition

Let C = { x 1 , , x d } {\displaystyle C=\{x_{1},\dots ,x_{d}\}} a set of clocks. For each x N {\displaystyle x\in \mathbb {N} } let c x N {\displaystyle c_{x}\in \mathbb {N} } . Intuitively, this number represents an upper bound on the values to which the clock x {\displaystyle x} can be compared. The definition of a region over the clocks of C {\displaystyle C} uses those numbers c x {\displaystyle c_{x}} 's. Three equivalent definitions are now given.

Given a clock assignment ν {\displaystyle \nu } , [ ν ] {\displaystyle } denotes the region in which ν {\displaystyle \nu } belongs. The set of regions is denoted by R {\displaystyle {\mathcal {R}}} .

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 ν 1 {\displaystyle \nu _{1}} and ν 2 {\displaystyle \nu _{2}} are equivalent if they satisfy the following constraints:

  • ν 1 ( x ) c {\displaystyle \nu _{1}(x)\sim c} iff ν 2 ( x ) c {\displaystyle \nu _{2}(x)\sim c} , for each x C {\displaystyle x\in C} and 0 c c x {\displaystyle 0\leq c\leq c_{x}} an integer, and ~ being one of the following relation =, < or .
  • { ν 1 ( x ) } { ν 1 ( y ) } {\displaystyle \{\nu _{1}(x)\}\sim \{\nu _{1}(y)\}} iff { ν 2 ( x ) } { ν 2 ( y ) } {\displaystyle \{\nu _{2}(x)\}\sim \{\nu _{2}(y)\}} , for each x , y C {\displaystyle x,y\in C} , ν 1 ( x ) c x {\displaystyle \nu _{1}(x)\leq c_{x}} , ν 1 ( y ) c y {\displaystyle \nu _{1}(y)\leq c_{y}} , { r } {\displaystyle \{r\}} being the fractional part of the real r {\displaystyle r} , and ~ being one of the following relation =, < or .

The first kind of constraints ensures that ν 1 {\displaystyle \nu _{1}} and ν 2 {\displaystyle \nu _{2}} satisfies the same constraints. Indeed, if ν 1 ( x ) = 0.5 {\displaystyle \nu _{1}(x)=0.5} and ν 2 ( x ) = 1 {\displaystyle \nu _{2}(x)=1} , then only the second assignment satisfies x = 1 {\displaystyle x=1} . On the other hand, if ν 1 ( x ) = 0.5 {\displaystyle \nu _{1}(x)=0.5} and ν 2 ( x ) = 0.6 {\displaystyle \nu _{2}(x)=0.6} , 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 ν 1 = { x 0.5 , y 0.6 } {\displaystyle \nu _{1}=\{x\mapsto 0.5,y\mapsto 0.6\}} and ν 2 = { x 0.5 , y 0.4 } {\displaystyle \nu _{2}=\{x\mapsto 0.5,y\mapsto 0.4\}} . Then, the constraint y = 1 x < 1 {\displaystyle y=1\land x<1} is eventually satisfied by the future of ν 1 {\displaystyle \nu _{1}} without clock reset, but not by the future of ν 2 {\displaystyle \nu _{2}} 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 S {\displaystyle S} of equations and inequations satisfying the following constraints:

  • for each x C {\displaystyle x\in C} , S {\displaystyle S} contains either:
    • x = c {\displaystyle x=c} for some integer 0 c c x {\displaystyle 0\leq c\leq c_{x}}
    • x ( c , c + 1 ) {\displaystyle x\in (c,c+1)} for some integer 0 c < c x {\displaystyle 0\leq c<c_{x}} ,
    • x > c x {\displaystyle x>c_{x}} ,
  • furthermore, for each pair of clocks x , y C {\displaystyle x,y\in C} , where S {\displaystyle S} contains constraints of the form x ( c , c + 1 ) {\displaystyle x\in (c,c+1)} and y ( c , c + 1 ) {\displaystyle y\in (c',c'+1)} , then S {\displaystyle S} contains an (in) equality of the form { x } { y } {\displaystyle \{x\}\sim \{y\}} with {\displaystyle \sim } being either =, < or .

Since, when c {\displaystyle c} and c {\displaystyle c'} are fixed, the last constraint is equivalent to x y + c c {\displaystyle x\sim y+c-c'} .

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 ( log ( c k ) + | C | log ( | C | ) ) {\displaystyle O\left(\sum \log(c_{k})+|C|\log(|C|)\right)} with | C | {\displaystyle |C|} 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 r {\displaystyle r} starting with a clock assignment ν {\displaystyle \nu } , for any other assignment ν {\displaystyle \nu '} in the same region, there is a run r {\displaystyle r'} , 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 C {\displaystyle C} , two assignments two clocks assignments ν 1 {\displaystyle \nu _{1}} and ν 2 {\displaystyle \nu _{2}} belongs to the same region if for each timed automaton A {\displaystyle {\mathcal {A}}} in which the guards never compare a clock x {\displaystyle x} to a number greater than c x {\displaystyle c_{x}} , given any location {\displaystyle \ell } of A {\displaystyle {\mathcal {A}}} , there is a timed bisimulation between the extended states ( , ν 1 ) {\displaystyle (\ell ,\nu _{1})} and ( , ν 2 ) {\displaystyle (\ell ,\nu _{2})} . 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 α {\displaystyle \alpha } defined by a set of (in)equations S {\displaystyle S} , and a set of clocks C C {\displaystyle C'\subseteq C} , the region similar to α {\displaystyle \alpha } in which the clocks of C {\displaystyle C'} are restarted is now defined. This region is denoted by α [ C 0 ] {\displaystyle \alpha } , it is defined by the following constraints:

  • each constraints of S {\displaystyle S} not containing the clock x {\displaystyle x} ,
  • the constraints x = 0 {\displaystyle x=0} for x C {\displaystyle x\in C'} .

The set of assignments defined by α [ C 0 ] {\displaystyle \alpha } is exactly the set of assignments ν [ C 0 ] {\displaystyle \nu } for ν α {\displaystyle \nu \in \alpha } .

Time-successor

Given a region α {\displaystyle \alpha } , the regions which can be attained without resetting a clock are called the time-successors of α {\displaystyle \alpha } . Two equivalent definitions are now given.

Definition

A clock region α {\displaystyle \alpha '} is a time-successor of another clock region α {\displaystyle \alpha } if for each assignment ν α {\displaystyle \nu \in \alpha } , there exists some positive real t ν , α > 0 {\displaystyle t_{\nu ,\alpha '}>0} such that ν + t ν , α α {\displaystyle \nu +t_{\nu ,\alpha '}\in \alpha '} .

Note that it does not mean that α + t ν , α = α {\displaystyle \alpha +t_{\nu ,\alpha '}=\alpha '} . For example, the region α {\displaystyle \alpha } defined by the set of constraint { 0 < x < 1 , 0 < y < 1 , x < y } {\displaystyle \{0<x<1,0<y<1,x<y\}} has the time-successor α {\displaystyle \alpha '} defined by the set of constraint { 0 < x < 1 , y = 1 } {\displaystyle \{0<x<1,y=1\}} . Indeed, for each ν α {\displaystyle \nu \in \alpha } , it suffices to take t ν , α = 1 ν ( y ) {\displaystyle t_{\nu ,\alpha '}=1-\nu (y)} . However, there exists no real t {\displaystyle t} such that α + t = α {\displaystyle \alpha +t=\alpha '} or even such that α + t α {\displaystyle \alpha +t\subseteq \alpha '} ; indeed, α {\displaystyle \alpha } defines a triangle while α {\displaystyle \alpha '} 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 α {\displaystyle \alpha } defined as a set of constraints S {\displaystyle S} , let us define its set of time-successors. In order to do so, the following variables are required. Let T S {\displaystyle T\subseteq S} the set of constraints of S {\displaystyle S} of the form x i = c i {\displaystyle x_{i}=c_{i}} . Let Y C {\displaystyle Y\subseteq C} the set of clocks y {\displaystyle y} such that S {\displaystyle S} contains the constraint y > c y {\displaystyle y>c_{y}} . Let Z C Y {\displaystyle Z\subseteq C\setminus Y} the set of clocks { z } {\displaystyle \{z\}} such that there are no constraints of the form { x } < { z } {\displaystyle \{x\}<\{z\}} in S {\displaystyle S} .

If T {\displaystyle T} is empty, α {\displaystyle \alpha } is its own time successor. If Y = C {\displaystyle Y=C} , then α {\displaystyle \alpha } is the only time-successor of α {\displaystyle \alpha } . Otherwise, there is a least time-successor of α {\displaystyle \alpha } not equal to α {\displaystyle \alpha } . The least time-successor, if T {\displaystyle T} is non-empty, contains:

  • the constraints of S T {\displaystyle S\setminus T}
  • x i > c i {\displaystyle x_{i}>c_{i}} ,
  • { x i } = { x j } {\displaystyle \{x_{i}\}=\{x_{j}\}} , and
  • for each y {\displaystyle y} such that y > c y {\displaystyle y>c_{y}} does not belong to S {\displaystyle S} , the constraint x i < y {\displaystyle x_{i}<y} .

If T {\displaystyle T} is empty, the least time-successor is defined by the following constraints:

  • the constraints of S {\displaystyle S} not using the clocks of Z {\displaystyle Z} ,
  • the constraint z = c + 1 {\displaystyle z=c+1} , for each constraint c < z < c + 1 {\displaystyle c<z<c+1} in S {\displaystyle S} , with z Z {\displaystyle z\in Z} .

Properties

There are at most | C | ! 2 | C | x C ( 2 c x + 2 ) {\displaystyle |C|!2^{|C|}\prod _{x\in C}(2c_{x}+2)} regions, where | C | {\displaystyle |C|} is the number of clocks.

Region automaton

Given a timed automaton A {\displaystyle {\mathcal {A}}} , its region automaton is a finite automaton or a Büchi automaton which accepts untimed L {\displaystyle L} . This automaton is similar to A {\displaystyle {\mathcal {A}}} , where clocks are replaced by region. Intuitively, the region automaton is contructude as a product of A {\displaystyle {\mathcal {A}}} 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 α 0 {\displaystyle \alpha _{0}} , defined by the set of constraints { x = 0 x C } {\displaystyle \{x=0\mid x\in C\}} ,
  • the set of edges are ( α , α [ C 0 ] ) {\displaystyle (\alpha ,\alpha ')} , for α {\displaystyle \alpha '} a time-successor of α {\displaystyle \alpha } .

Region automaton

Let A = Σ , L , L 0 , C , F , E {\displaystyle {\mathcal {A}}=\langle \Sigma ,L,L_{0},C,F,E\rangle } a timed automaton. For each clock x C {\displaystyle x\in C} , let c x {\displaystyle c_{x}} the greatest number c {\displaystyle c} such that there exists a guard of the form x c {\displaystyle x\sim c} in A {\displaystyle {\mathcal {A}}} . The region automaton of A {\displaystyle {\mathcal {A}}} , denoted by R ( A ) {\displaystyle R({\mathcal {A}})} is a finite or Büchi automaton which is essentially a product of A {\displaystyle {\mathcal {A}}} and of the region graph defined above. That is, each state of the region automaton is a pair containing a location of A {\displaystyle {\mathcal {A}}} 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:

  • its alphabet is Σ {\displaystyle \Sigma } ,
  • its set of states is L × R {\displaystyle L\times {\mathcal {R}}} ,
  • its set of states is L 0 × { α 0 } {\displaystyle L_{0}\times \{\alpha _{0}\}} with α 0 {\displaystyle \alpha _{0}} the initial region,
  • its set of accepting states is F × R {\displaystyle F\times {\mathcal {R}}} ,
  • its transition relation δ {\displaystyle \delta } contains ( ( , α ) , a , ( , α [ C 0 ] ) ) {\displaystyle ((\ell ,\alpha ),a,(\ell ',\alpha '))} , for ( , a , g , C , ) E {\displaystyle (\ell ,a,g,C',\ell ')\in E} , such that γ α {\displaystyle \gamma \models \alpha '} and α {\displaystyle \alpha '} is a time-successor of α {\displaystyle \alpha } .

Given any run r = ( 0 , ν 0 ) t 1 σ 1 ( 1 , ν 1 ) {\displaystyle r=(\ell _{0},\nu _{0}){\xrightarrow{\sigma _{1}}}(\ell _{1},\nu _{1})\dots } of A {\displaystyle {\mathcal {A}}} , the sequence ( 0 , [ ν 0 ] ) σ 1 ( 1 , [ ν 1 ] ) {\displaystyle (\ell _{0},){\xrightarrow {\sigma _{1}}}(\ell _{1},)\dots } is denoted [ r ] {\displaystyle } , it is a run of R ( A ) {\displaystyle R({\mathcal {A}})} and is accepting if and only if r {\displaystyle r} is accepting. It follows that L ( R ( A ) ) = Untime ( L ( A ) ) {\displaystyle L(R({\mathcal {A}}))=\operatorname {Untime} (L({\mathcal {A}}))} . In particular, A {\displaystyle {\mathcal {A}}} accepts a timed-word if and only if R ( A ) {\displaystyle R({\mathcal {A}})} accepts a word. Furthermore, an accepting run of A {\displaystyle {\mathcal {A}}} can be computed from an accepting run of R ( A ) {\displaystyle R({\mathcal {A}})} .

References

  1. ^ Bengtsson, Johan; Yi, Wang L (2004). "Timed Automata: Semantics, Algorithms and Tools". Lectures on Concurrency and Petri Nets. Lecture Notes in Computer Science. Vol. 3098. pp. 87–124. doi:10.1007/978-3-540-27755-2_3. ISBN 978-3-540-22261-3.
  2. ^ Alur, Rajeev; Dill, David L (April 25, 1994). "A theory of timed automata" (PDF). Theoretical Computer Science. 126 (2): 183–235. doi:10.1016/0304-3975(94)90010-8.
Categories: