07.01.2013 Views

Lecture Notes in Computer Science 3472

Lecture Notes in Computer Science 3472

Lecture Notes in Computer Science 3472

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

18 Run-Time Verification 545<br />

D t M is true if event e1 wastruebeforetimet andfromthattimeuptonowe2 has<br />

not been ever true; and f<strong>in</strong>ally, def<strong>in</strong>itions of negation, disjunction, conjunction<br />

and implication are straightforward; note that ¬undef<strong>in</strong>ed is undef<strong>in</strong>ed.<br />

Table 18.5.3 def<strong>in</strong>es the semantics for conditions and events with respect to<br />

model M at time t, the table is self-explanatory.<br />

M , t |= c iff D t M (c) =true<br />

M , t |= ek (ek prim.) iff ∃ state si such that τ(si) =t and LE (si, ek ) is def<strong>in</strong>ed<br />

M , t |= ↑ c iff ∃ si.τ (si) =t ∧ M ,τ(si) |= c ∧ M ,τ(si−1) � c<br />

i.e, ↑ c occurs when condition c changes from false to true.<br />

M , t |= ↓ c iff ∃ si.τ (si) =t ∧ M ,τ(si) � c ∧ M ,τ(si−1) |= c<br />

i.e, ↓ c occurs when condition c changes from true to false.<br />

M , t |= e1 ∨ e2 iff M , t |= e1 or M , t |= e2<br />

M , t |= e1 ∧ e2<br />

iff M , t |= e1 and M , t |= e2<br />

M , t |= e when c iff M , t |= e and M , t |= c<br />

i.e, event e occurs when condition c is true.<br />

Table 18.2. Semantics of events and conditions<br />

Monitor<strong>in</strong>g Script A PEDL script can monitor any object <strong>in</strong> the target system,<br />

therefore declaration of monitored entities is performed <strong>in</strong> a language specific<br />

manner. In the case of the Railway Gate example, a possible implementation<br />

of the system is sketched <strong>in</strong> Figure 18.9; the PEDL script will monitor the variables<br />

gateP osition and lightState and the methods open, close, on, off. For<br />

simplicity, we assume that there is only one <strong>in</strong>stance of GateController and<br />

LightController classes.<br />

class GateController{<br />

public static f<strong>in</strong>al <strong>in</strong>t UP = 0;<br />

public static f<strong>in</strong>al <strong>in</strong>t DOWN = 1;<br />

public static f<strong>in</strong>al <strong>in</strong>t UPDOWN = 2;<br />

public static f<strong>in</strong>al <strong>in</strong>t DOWNUP = 3;<br />

<strong>in</strong>t gatePosition;<br />

public void open(){...}<br />

public void close(){...}<br />

...<br />

};<br />

class LightController{<br />

public static f<strong>in</strong>al <strong>in</strong>t OFF = 0;<br />

public static f<strong>in</strong>al <strong>in</strong>t FLASHING =<br />

1;<br />

<strong>in</strong>t lightState;<br />

public void on(){...}<br />

public void off(){...}<br />

...<br />

};<br />

Fig. 18.9. The implementation of the railway example<br />

Primitive conditions are computed from boolean expressions over monitored<br />

variables. An example of primitive condition is:<br />

Cond is open<strong>in</strong>g =(GateController.gateP osition == GateController.DOW NUP );

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!