UCL - To Read
UCL - To Read
A simple introduction
F. Raimondi
Slide 2
Slide 3
Introduction
There is a great advantage in being able to verify the correctness of
computer systems, whether they are hardware, software, or a
combination. This is most obvious in the case of safety-critical
systems, but also applies to those that are commercially critical (such
as mass-produced chips), mission critical (think of NASA rovers),
etc.
In this lecture: verification using model checking.
Model checking is an automatic, model-based, property verification
approach.
Slide 4
Slide 5
Required property
Slide 5
Required property
represent
Logical formula
Slide 5
Required property
abstract
Logical model M
represent
Logical formula
M |= ?
Slide 5
Slide 6
Slide 7
CTL Syntax
We start from a set of atomic propositions AP = {p, q, . . .}. Atomic
propositions stand for atomic facts which may hold in a system, e.g.
Printer ps706 is busy, Process 1486 is idle, The value of x is
5, etc.
The Backus-Naur form form CTL formulae is the following:
::= | | p | | | | | AX | EX |
AF | EF | AG | EG | A[U ] | E[U ]
Slide 8
CTL Syntax
Each CTL operator is a pair of symbols. The first one is either A
(for All paths), or E (there Exists a path). The second one is
one of X (neXt state), F (in a Future state), G (Globally in the
future) or U (Until).
NOTICE: U is a binary operator, it could be written EU (, ) or
AU (, ). Notice that the quantifier is graphically separated (e.g.,
E[pU q]), but it is in fact a single operator EU , which could be
written EU (p, q).
Example: AG(p (EF q)) is read as It is Globally the case that, if
p is true, then there Exists a path such that at some point in the
Future q is true.
Slide 9
Slide 10
EF
EG
EU
Slide 10
Slide 11
AU
AF
q
EG
Slide 11
Slide 12
Slide 13
CTL Semantics
You should be able to identify well-formed CTL formulae. Now: how
to evaluate formulae, i.e., how to decide whether or not a formula is
true.
Slide 14
CTL Semantics
You should be able to identify well-formed CTL formulae. Now: how
to evaluate formulae, i.e., how to decide whether or not a formula is
true.
You should know the meaning of tautology and unsatisfiable formulae:
AG(p p) : tautology
AG(p p): unsatisfiable
Slide 14
CTL Semantics
You should be able to identify well-formed CTL formulae. Now: how
to evaluate formulae, i.e., how to decide whether or not a formula is
true.
You should know the meaning of tautology and unsatisfiable formulae:
AG(p p) : tautology
AG(p p): unsatisfiable
But what about EF p? it may be true or not, depending on how we
evaluate formulae.
Slide 14
Slide 15
r
s1
Slide 16
r
s1
s2
p,q s0
s2
q,r
s1
s2
s2
r
s2
r
Slide 17
s2
p,q
s3
q,r
q,r
s1
Slide 18
s2
q,r
s1
s3
p,q
q,r
s0
s3
s2
q,r
s1
q,r
r
s3
p,q
q,r
s3
q,r
s0
Slide 19
Short summary
You should be able to recognise well-formed CTL formulas.
You know what a transition system is (M = (S, Rt , L)).
You know how to unwind a transition system and obtain
computation paths.
Next: Given a CTL formula and a transition system M , establish
whether or not is true at a given state s in M , written as:
M, s |=
Slide 20
iff
p L(s)
M, s |=
iff
M, s 6|=
M, s |=
iff
M, s |= and M, s |=
M, s |=
iff
M, s |= or M, s |=
Slide 21
iff
s s.t. sRt s , M, s |=
M, s |= EX
iff
M, s |= AG
iff
M, s |= EG
iff
M, s |= AF
iff
M, s |= EF
iff
Slide 22
iff
M, s |= E[U ]
iff
Slide 23
s2
p,q
s3
q,r
q,r
s1
Slide 24
Slide 25
AX EX
AG
EF
AF
EG
Slide 26
Specification patterns
Temporal logics are useful to express requirements of systems.
Typically, requirements have common and recurring patterns. For
instance, two example of patterns:
Liveness: Something good will eventually happen. For
instance: Whenever any process requests to enter its critical
section, it will eventually be permitted to do so. In CTL:
AG(request AF (critical))
Safety: Nothing bad will happen. For instance, Only one
process is in its critical section at any time. In CTL (with 2
processes only):
AG((critical1 critical2 ))
A simple introduction to CTL and model checking
Slide 27
Slide 28
Slide 28
Summary
You are able to recognise and write well-formed CTL formulas.
You are able to unwind a transition system in computation paths.
You are able to evaluate whether or not a given CTL formula is
true at a given state of a transition system M .
You are able to recognise (simple) equivalent CTL formulas.
You are able to translate simple requirements from plain English
into CTL syntax.
Slide 29
Slide 30
Slide 31
Slide 32
Slide 33
Slide 34
Summary
You should be able to understand and to solve exercises about:
CTL syntax and parse trees.
CTL semantics: transition systems, computation paths, establish
whether or not a formula is true at a state in a model.
Recognise (simple) equivalent formulas.
Formalise in CTL temporal requirements expressed in plain
English.
Basic ideas about model checking algorithms.
Slide 35
Slide 36