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 529<br />

from a mach<strong>in</strong>e to another one before check<strong>in</strong>g takes place, e.g., transferr<strong>in</strong>g the<br />

file from the client mach<strong>in</strong>e to the vendor’s site.<br />

To illustrate the runtime verification, a basic example will be used along<br />

with the chapter. It is the railroad gate example. It is composed of a gate and<br />

a light. The light can flash or be off. The gate can be closed, opened, clos<strong>in</strong>g<br />

or open<strong>in</strong>g. First the gate is open. Before the door closes, the light flashes to<br />

warn the motorists of the imm<strong>in</strong>ent clos<strong>in</strong>g of the door. The light cont<strong>in</strong>ues to<br />

flash while the door closes until the door is aga<strong>in</strong> opened. The program that<br />

implements this example is supposed to be <strong>in</strong>strumented to send <strong>in</strong>formation<br />

about the state modifications of both the gate and the light. In particular, we<br />

suppose that the program can generate the follow<strong>in</strong>g events at run-time:<br />

• clos<strong>in</strong>g when the gate beg<strong>in</strong>s to close<br />

• closed when the gate is closed<br />

• open<strong>in</strong>g when the gate beg<strong>in</strong>s to open<br />

• opened when the gate is open<br />

• off when the light is off<br />

• flash<strong>in</strong>g when the light beg<strong>in</strong>s to flash.<br />

Dur<strong>in</strong>g the execution of the program, a sequence of events is generated.<br />

The sequence is an execution trace of the program. For example, three different<br />

executions can generate these traces:<br />

(1) open, off, flash<strong>in</strong>g, clos<strong>in</strong>g, closed, open<strong>in</strong>g, open, off.<br />

(2) open, off, flash<strong>in</strong>g, clos<strong>in</strong>g, closed, off, open<strong>in</strong>g, open.<br />

(3) open, off, clos<strong>in</strong>g, flash<strong>in</strong>g, closed, open<strong>in</strong>g, open, off.<br />

A runtime verification technique checks an execution trace aga<strong>in</strong>st requirements.<br />

For example, the requirement that “whenever the gate beg<strong>in</strong>s to open,<br />

then the gate has been clos<strong>in</strong>g <strong>in</strong> the past, and s<strong>in</strong>ce then the light has not<br />

f<strong>in</strong>ished flash<strong>in</strong>g”, can be formalized by the past LTL formula [Pnu77]:<br />

↑ is open<strong>in</strong>g ⇒ [is clos<strong>in</strong>g, ↓ (is flash<strong>in</strong>g))<br />

Another requirement could be “always <strong>in</strong> the future whenever the light is<br />

off, then the gate will not be clos<strong>in</strong>g until the light will be flash<strong>in</strong>g”, can be<br />

formalized by the future LTL formula:<br />

✷(is off ⇒¬is clos<strong>in</strong>g U is flash<strong>in</strong>g)<br />

The notations ↑ p (beg<strong>in</strong> p), ↓ p (end p), p ⇒ q (p implies q), [p, q) (q<strong>in</strong>the<br />

past and not q s<strong>in</strong>ce p), ✷p (always p), ¬p (not p) and p U q (p until a) will be<br />

<strong>in</strong>troduced latter <strong>in</strong> the paper. Propositions is open<strong>in</strong>g, is clos<strong>in</strong>g, is flash<strong>in</strong>g<br />

and is off describe <strong>in</strong>tuitively the state of both the gate and the light, and they<br />

correspond to conditions gate = open<strong>in</strong>g, gate = clos<strong>in</strong>g, light = flash<strong>in</strong>g and<br />

light = off, respectively.<br />

By match<strong>in</strong>g the formal requirements with the three execution traces, a runtime<br />

verification technique can detect a violation of the first requirement <strong>in</strong> the

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

Saved successfully!

Ooh no, something went wrong!