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

Temporal Logic We briefly recall basic notions of f<strong>in</strong>ite trace l<strong>in</strong>ear temporal<br />

logic <strong>in</strong>clud<strong>in</strong>g a recursive def<strong>in</strong>ition of the satisfaction relation on a f<strong>in</strong>ite<br />

trace and a LTL formula.<br />

The satisfaction relation |= ⊆ Trace × Formula def<strong>in</strong>es when a trace t satisfies<br />

a formula ϕ, written t |= ϕ, and is def<strong>in</strong>ed <strong>in</strong>ductively over the structure<br />

of the formula as follows: where p ∈ Prop is any atomic proposition,<br />

head : Trace → Trace and tail : Trace → Trace are two functions tak<strong>in</strong>g the<br />

head and the tail of a trace respectively, length is a function return<strong>in</strong>g the length<br />

of a f<strong>in</strong>ite trace, ɛ denotes a empty trace and ϕ and ψ are any formulas:<br />

t |= true is always true,<br />

t |= false is always false,<br />

t |= p iff t �= ɛ and head(t) isp,<br />

t |= ϕ ∧ (∨, ⇒, ⇔)ψ iff t |= ϕ and (or, implied, iff) t |= ψ,<br />

t |= ◦ϕ iff t �= ɛ and tail(t) |= ϕ,<br />

t |= ✷ϕ iff (∀ 1 ≤ i ≤ length(t))ti |= ϕ,<br />

t |= ✸ϕ iff (∃ 1 ≤ i ≤ length(t)+1)ti |= ϕ,<br />

t |= ϕ U ψ iff (∃ 1 ≤ i ≤ length(t)+1)ti |= ψ and<br />

(∀ 1 ≤ j < i)tj |= ϕ.<br />

The LTL operators have a slightly different <strong>in</strong>terpretation <strong>in</strong> the context of<br />

f<strong>in</strong>ite traces, though similar <strong>in</strong> spirit to their standard semantics <strong>in</strong> classical LTL<br />

with <strong>in</strong>f<strong>in</strong>ite traces. The formula ◦ϕ (next ϕ) holds for a f<strong>in</strong>ite trace iff the trace<br />

is nonempty and ϕ holds <strong>in</strong> the suffix trace start<strong>in</strong>g <strong>in</strong> the next (second) time<br />

po<strong>in</strong>t. The formula ✷ϕ (always ϕ) holdsifϕholds <strong>in</strong> all time po<strong>in</strong>ts, while ✸ϕ<br />

(eventually ϕ) holdsifϕholds <strong>in</strong> present or <strong>in</strong> some future time po<strong>in</strong>t. The<br />

formula ϕ U ψ (ϕ until ψ) holdsifψholds <strong>in</strong> present or <strong>in</strong> some future time<br />

po<strong>in</strong>t, and until then ϕ holds. As an example illustrat<strong>in</strong>g the semantics, the<br />

formula ✷(ϕ ⇒ ✸ψ) holds for a f<strong>in</strong>ite trace iff for any time po<strong>in</strong>t <strong>in</strong> the trace it<br />

holds that if ϕ is true then eventually ψ is true.<br />

LTL is widely accepted as reasonably good formalism to express requirements<br />

of reactive systems. However, there is a tricky aspect of specification-based monitor<strong>in</strong>g<br />

which dist<strong>in</strong>guishes it from other formal methods, such as model check<strong>in</strong>g<br />

and theorem prov<strong>in</strong>g: the end of trace. Sooner or later, the monitored program<br />

will be stopped and so does its execution trace. At that moment, the observer<br />

needs to make a decision regard<strong>in</strong>g the validity of checked properties. Let us<br />

consider the formula ✷(p ⇒ ✸q). If each p was followed by at least one q dur<strong>in</strong>g<br />

the monitored execution, then, at some extent one could say that the formula<br />

was satisfied; but one should be aware that this is not a def<strong>in</strong>itive answer because<br />

the formula could have been very well violated <strong>in</strong> the future if the program had<br />

not been stopped. However, there are LTL properties that give the user absolute<br />

confidence dur<strong>in</strong>g the monitor<strong>in</strong>g. For example, a violation of a safety property<br />

reflects a clear misbehavior of the monitored program.<br />

In PathExplorer, the fact that the relation |= can be def<strong>in</strong>ed recursively <strong>in</strong><br />

the context of f<strong>in</strong>ite traces is crucial to the development of generic dynamic pro-

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

Saved successfully!

Ooh no, something went wrong!