fbpx
Wikipedia

Clock (model checking)

In model checking, a subfield of computer science, a clock is a mathematical object used to model time. More precisely, a clock measures how much time passed since a particular event occurs, in this sense, a clock is more precisely an abstraction of a stopwatch. In a model of some particular program, the value of the clock may either be the time since the program was started, or the time since a particular event occurred in the program. Those clocks are used in the definition of timed automaton, signal automaton, timed propositional temporal logic and clock temporal logic. They are also used in programs such as UPPAAL which implement timed automata.[1]

Generally, the model of a system uses many clocks. Those multiple clocks are required in order to track a bounded number of events. All of those clocks are synchronized. That means that the difference in value between two fixed clocks is constant until one of them is restarted. In the language of electronics, it means that clock's jitter is null.

Example edit

Let us assume that we want to modelize an elevator in a building with ten floors. Our model may have   clocks  , such that the value of the clock   is the time someone had wait for the elevator at floor  . This clock is started when someone calls the elevator on floor   (and the elevator was not already called on this floor since last time it visited that floor). This clock can be turned off when the elevator arrives at floor  . In this example, we actually need ten distinct clocks because we need to track ten independent events. Another clock   may be used to check how much time an elevator spent at a particular floor.

A model of this elevator can then use those clocks to assert whether the elevator's program satisfies properties such as "assuming the elevator is not kept on a floor for more than fifteen seconds, then no one has to wait for the elevator for more than three minutes". In order to check whether this statement holds, it suffices to check that, in every run of the model in which the clock   is always smaller than fifteen seconds, each clock   is turned off before it reaches three minutes.

Definition edit

Formally, a set   of clocks is simply a finite set[1]: 191 . Each element of a set of clock is called a clock. Intuitively, a clock is similar to a variable in first-order logic, it is an element which may be used in a logical formula and which may takes a number of differente values.

Clock valuations edit

A clock valuation or clock interpretation[1]: 193    over   is usually defined as a function from   to the set of non-negative real. Equivalently, a valuation can be considered as a point in  .

The initial assignment   is the constant function sending each clock to 0. Intuitively, it represents the initial time of the program, where each clocks are initialized simultaneously.

Given a clock assignment  , and a real  ,   denotes the clock assignment sending each clock   to  . Intuitively, it represents the valuation   after which   time units passed.

Given a subset   of clocks,   denotes the assignment similar to   in which the clocks of   are reset. Formally,   sends each clock   to 0 and each clock   to  .

Inactive clocks edit

The program UPPAAL introduce the notion of inactive clocks.[2] A clock is inactive at some time if there is no possible future in which the clock's value is checked without being reset first. In our example above, the clock   is considered to be inactive when the elevator arrive at floor  , and remains inactive until someone call the elevator at floor  .

When allowing for inactive clock, a valuation may associate a clock   to some special value   to indicate that it is inactive. If   then   also equals  .

Clock constraint edit

An atomic clock constraint is simply a term of the form  , where   is a clock,   is a comparison operator, such as <, ≤, = ≥, or >, and   is an integral constant. In our previous example, we may use the atomic clock constraints   to state that the person at floor   waited for less than three minutes, and   to state that the elevator stayed at some floor for more than fifteen seconds. A valuation   satisfies an atomic clock valuation   if and only if  .

A clock constraint is either a finite conjunction of atomic clock constraint or is the constant "true" (which can be considered as the empty conjunction). A valuation   satisfies a clock constraint   if it satisfies each atomic clock constraint  .

Diagonal constraint edit

Depending on the context, an atomic clock constraint may also be of the form  . Such a constraint is called a diagonal constraint, because   defines a diagonal line in  .

Allowing diagonal constraints may allow to decrease the size of a formula or of an automaton used to describe a system. However, algorithm's complexity may increase when diagonal constraints are allowed. In most system using clocks, allowing diagonal constraint does not increase the expressivity of the logic. We now explain how to encode such constraint with Boolean variable and non-diagonal constraint.

A diagonal constraint   may be simulated using non-diagonal constraint as follows. When   is reset, check whether   holds or not. Recall this information in a Boolean variable   and replace   by this variable. When   is reset, set   to true if   is < or ≤ or if   is = and  .

The way to encode a Boolean variable depends on the system which uses the clock. For example, UPPAAL supports Boolean variables directly. Timed automata and signal automata can encode a Boolean value in their locations. In clock temporal logic over timed words, the Boolean variable may be encoded using a new clock  , whose value is 0 if and only if   is false. That is,   is reset as long as   is supposed to be false. In timed propositional temporal logic, the formula  , which restart   and then evaluates  , can be replaced by the formula  , where   and   are copies of the formulas  , where   are replaced by the true and false constant respectively.

Sets defined by clock constraints edit

A clock constraint defines a set of valuations. Two kinds of such sets are considered in the literature.

A zone is a non-empty set of valuations satisfying a clock constraint. Zones and clock constraints are implemented using difference bound matrix.

Given a model  , it uses a finite number of constants in its clock constraints. Let   be the greatest constant used. A region is a non-empty zone in which no constraint greater than   are used, and furthermore, such that it is minimal for the inclusion.

See also edit

Notes edit

  1. ^ a b c 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.
  2. ^ Behrmann, Gerd; David, Alexandre; Larsen, Kim G (November 28, 2006). "A Tutorial on Uppaal 4.0" (PDF): 28. {{cite journal}}: Cite journal requires |journal= (help)

clock, model, checking, model, checking, subfield, computer, science, clock, mathematical, object, used, model, time, more, precisely, clock, measures, much, time, passed, since, particular, event, occurs, this, sense, clock, more, precisely, abstraction, stop. In model checking a subfield of computer science a clock is a mathematical object used to model time More precisely a clock measures how much time passed since a particular event occurs in this sense a clock is more precisely an abstraction of a stopwatch In a model of some particular program the value of the clock may either be the time since the program was started or the time since a particular event occurred in the program Those clocks are used in the definition of timed automaton signal automaton timed propositional temporal logic and clock temporal logic They are also used in programs such as UPPAAL which implement timed automata 1 Generally the model of a system uses many clocks Those multiple clocks are required in order to track a bounded number of events All of those clocks are synchronized That means that the difference in value between two fixed clocks is constant until one of them is restarted In the language of electronics it means that clock s jitter is null Contents 1 Example 2 Definition 2 1 Clock valuations 2 2 Inactive clocks 3 Clock constraint 3 1 Diagonal constraint 3 2 Sets defined by clock constraints 4 See also 5 NotesExample editLet us assume that we want to modelize an elevator in a building with ten floors Our model may have n displaystyle n nbsp clocks c0 c9 displaystyle c 0 dots c 9 nbsp such that the value of the clock ci displaystyle c i nbsp is the time someone had wait for the elevator at floor i displaystyle i nbsp This clock is started when someone calls the elevator on floor i displaystyle i nbsp and the elevator was not already called on this floor since last time it visited that floor This clock can be turned off when the elevator arrives at floor i displaystyle i nbsp In this example we actually need ten distinct clocks because we need to track ten independent events Another clock s displaystyle s nbsp may be used to check how much time an elevator spent at a particular floor A model of this elevator can then use those clocks to assert whether the elevator s program satisfies properties such as assuming the elevator is not kept on a floor for more than fifteen seconds then no one has to wait for the elevator for more than three minutes In order to check whether this statement holds it suffices to check that in every run of the model in which the clock s displaystyle s nbsp is always smaller than fifteen seconds each clock ci displaystyle c i nbsp is turned off before it reaches three minutes Definition editFormally a set X displaystyle X nbsp of clocks is simply a finite set 1 191 Each element of a set of clock is called a clock Intuitively a clock is similar to a variable in first order logic it is an element which may be used in a logical formula and which may takes a number of differente values Clock valuations edit A clock valuation or clock interpretation 1 193 n displaystyle nu nbsp over X x1 xn displaystyle X x 1 dots x n nbsp is usually defined as a function from X displaystyle X nbsp to the set of non negative real Equivalently a valuation can be considered as a point in R 0n displaystyle mathbb R geq 0 n nbsp The initial assignment n0 displaystyle nu 0 nbsp is the constant function sending each clock to 0 Intuitively it represents the initial time of the program where each clocks are initialized simultaneously Given a clock assignment n displaystyle nu nbsp and a real t 0 displaystyle t geq 0 nbsp n t displaystyle nu t nbsp denotes the clock assignment sending each clock x C displaystyle x in C nbsp to n x t displaystyle nu x t nbsp Intuitively it represents the valuation n displaystyle nu nbsp after which t displaystyle t nbsp time units passed Given a subset r C displaystyle r subseteq C nbsp of clocks n r 0 displaystyle nu r rightarrow 0 nbsp denotes the assignment similar to n displaystyle nu nbsp in which the clocks of r displaystyle r nbsp are reset Formally n r 0 displaystyle nu r rightarrow 0 nbsp sends each clock x r displaystyle x in r nbsp to 0 and each clock x r displaystyle x not in r nbsp to n x displaystyle nu x nbsp Inactive clocks edit The program UPPAAL introduce the notion of inactive clocks 2 A clock is inactive at some time if there is no possible future in which the clock s value is checked without being reset first In our example above the clock ci displaystyle c i nbsp is considered to be inactive when the elevator arrive at floor i displaystyle i nbsp and remains inactive until someone call the elevator at floor i displaystyle i nbsp When allowing for inactive clock a valuation may associate a clock x displaystyle x nbsp to some special value displaystyle bot nbsp to indicate that it is inactive If n x displaystyle nu x bot nbsp then n t x displaystyle nu t x nbsp also equals displaystyle bot nbsp Clock constraint editAn atomic clock constraint is simply a term of the form x c displaystyle x sim c nbsp where x displaystyle x nbsp is a clock displaystyle sim nbsp is a comparison operator such as lt or gt and c N displaystyle c in mathbb N nbsp is an integral constant In our previous example we may use the atomic clock constraints ci 180 displaystyle c i leq 180 nbsp to state that the person at floor i displaystyle i nbsp waited for less than three minutes and s gt 15 displaystyle s gt 15 nbsp to state that the elevator stayed at some floor for more than fifteen seconds A valuation n displaystyle nu nbsp satisfies an atomic clock valuation x c displaystyle x sim c nbsp if and only if n x c displaystyle nu x sim c nbsp A clock constraint is either a finite conjunction of atomic clock constraint or is the constant true which can be considered as the empty conjunction A valuation n displaystyle nu nbsp satisfies a clock constraint i 1nxi ici displaystyle bigwedge i 1 n x i sim i c i nbsp if it satisfies each atomic clock constraint xi ici displaystyle x i sim i c i nbsp Diagonal constraint edit Depending on the context an atomic clock constraint may also be of the form xi xj c displaystyle x i sim x j c nbsp Such a constraint is called a diagonal constraint because x1 x2 c displaystyle x 1 x 2 c nbsp defines a diagonal line in R 02 displaystyle mathbb R geq 0 2 nbsp Allowing diagonal constraints may allow to decrease the size of a formula or of an automaton used to describe a system However algorithm s complexity may increase when diagonal constraints are allowed In most system using clocks allowing diagonal constraint does not increase the expressivity of the logic We now explain how to encode such constraint with Boolean variable and non diagonal constraint A diagonal constraint xi xj c displaystyle x i sim x j c nbsp may be simulated using non diagonal constraint as follows When xj displaystyle x j nbsp is reset check whether xi c displaystyle x i sim c nbsp holds or not Recall this information in a Boolean variable bi j c displaystyle b i j c nbsp and replace xi xj c displaystyle x i sim x j c nbsp by this variable When xi displaystyle x i nbsp is reset set bi j c displaystyle b i j c nbsp to true if displaystyle sim nbsp is lt or or if displaystyle sim nbsp is and c 0 displaystyle c 0 nbsp The way to encode a Boolean variable depends on the system which uses the clock For example UPPAAL supports Boolean variables directly Timed automata and signal automata can encode a Boolean value in their locations In clock temporal logic over timed words the Boolean variable may be encoded using a new clock xi j c displaystyle x i j c nbsp whose value is 0 if and only if bi j c displaystyle b i j c nbsp is false That is xi j c displaystyle x i j c nbsp is reset as long as xi j c displaystyle x i j c nbsp is supposed to be false In timed propositional temporal logic the formula xi ϕ displaystyle x i phi nbsp which restart xi displaystyle x i nbsp and then evaluates ϕ displaystyle phi nbsp can be replaced by the formula xi xi xj c ϕ xi xj c ϕ displaystyle x i x i sim x j c implies phi top land neg x i sim x j c implies phi bot nbsp where ϕ displaystyle phi top nbsp and ϕ displaystyle phi bot nbsp are copies of the formulas ϕ displaystyle phi nbsp where xi xj c displaystyle x i sim x j c nbsp are replaced by the true and false constant respectively Sets defined by clock constraints edit A clock constraint defines a set of valuations Two kinds of such sets are considered in the literature A zone is a non empty set of valuations satisfying a clock constraint Zones and clock constraints are implemented using difference bound matrix Given a model M displaystyle M nbsp it uses a finite number of constants in its clock constraints Let K displaystyle K nbsp be the greatest constant used A region is a non empty zone in which no constraint greater than K displaystyle K nbsp are used and furthermore such that it is minimal for the inclusion See also editTimed automaton Signal automaton Clock temporal logic Timed propositional temporal logicNotes edit a b c 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 Behrmann Gerd David Alexandre Larsen Kim G November 28 2006 A Tutorial on Uppaal 4 0 PDF 28 a href Template Cite journal html title Template Cite journal cite journal a Cite journal requires journal help Retrieved from https en wikipedia org w index php title Clock model checking amp oldid 1214212156, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.