Professional Documents
Culture Documents
MF Merged
MF Merged
Abderahman KRIOUILE
Scientists Quotes
“Software engineers want to be real engineers.
Real engineers use mathematics.
Formal methods are the mathematics
of software engineering.
Therefore, software engineers should use
formal methods.”
linkedin.com/in/akriouile @A_KRIOUILE Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 2
Contents Today
• Need for Formal Methods • Overview of Critical-Systems
• Formal Methods Definition • Need for Formal Methods
• Formal Modeling • Formal Methods Definition
• Temporal logics • Examples of
• Model Checking Formal Techniques
• CADP toolbox
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 3 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 4
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 5 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 6
Systems whose failure can cause the loss of Systems whose failure can cause the failure
big or huge amounts of money of the goals of important missions
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 9 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 10
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 13 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 14
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 15 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 16
SCADE Example
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 17 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 18
Code Code
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 19 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 20
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 21 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 22
Infeasible behaviors
All behaviors of
the program
False negative
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 23 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 24
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 27 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 28
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 29 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 30
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 31 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 32
Synthesis
• Formal Methods are introduced to industry
• Certification
– Security: Formal Methods are mandatory for high
certification level
– For example: FM recommended in railway area
– In Aeronautic, DO-333 is a technical supplement
of the DO-178C introducing Formal Methods.
Contents
• Need for Formal Methods
• Formal Methods Definition
• Formal Modeling
• Temporal logics
• Model Checking
• CADP toolbox
linkedin.com/in/akriouile @A_KRIOUILE Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 2
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 3 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 4
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 5 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 6
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 7 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 8
• Start of the Soda Machine FSM Model • Second Phase of the Soda Machine FSM Model
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 9 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 10
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 11 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 12
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 13 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 14
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 15 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 16
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 17 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 18
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 19 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 20
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 21 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 22
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 23 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 24
Contents
• Need for Formal Methods
• Formal Methods Definition
• Formal Modeling
• Temporal logics
• Model Checking
• CADP toolbox
linkedin.com/in/akriouile @A_KRIOUILE Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 2
Process Calculus
• Process refers to a behavior of a system
– execution of a software system
– actions of a machine
– the actions of a human being
• Behavior is the set of events or actions that a
system can perform
– We consider an abstraction or idealization of the
PROCESS CALCULI “real” behavior
– We have an observation of the behavior
• We call action the chosen unit of observation
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 3 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 4
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 5 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 6
• Disadvantages d
– Less intuitive syntax 5
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 7 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 8
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 9 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 10
par par
0 0 0 0 0
a c a; b M1
a c a c
1 2
b c a d || ||
1
|| 1 = 1
|| 1 = =
3
b
4
d
5 c; d M2
b d c a b d
6 7 end par end par
2 2 2 2
d b
8
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 11 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 12
Asynchronous Product
In LNT
with communication
M1 x M2
M1 M2 M1 M2
0
par b in par b in
0 0 0 0
a c
a; b M1
a c 1 2 a c
|| ||
1
|| 1 = c a 1
|| 1 = =
b 3 b c; b M2
b b b b b
End par End par
2 2 4 2 2
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 13 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 14
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 15 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 16
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 17 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 18
Contents
• Need for Formal Methods
• Formal Methods Definition
• Formal Modeling
• Temporal logics
• Model Checking
• CADP toolbox
linkedin.com/in/akriouile @A_KRIOUILE Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 2
7 2 7 2 false false
finsc0 d0 := true finsc1 d1 := true d0 := false d0 := true d0 := false d0 := true
6 3 6 3 true true
debutsc0 t :=0 debutsc1 t :=1
d1 := false ? d0 := false ?
t automaton: t :=1
5 4 5 4
t :=0 ? 0 1 t :=1 ?
t=1? t=0?
t=0
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 5 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 6
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 9 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 10
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 15 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 16
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 17 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 18
• We have: s2 ≈ t2 and s3 ≈ t3
• We have: s3~t3, s2~t2, s1~t1, s1~t1’ and s0~t0
• We have not: s1 ≈ t1, s1 ≈ t1’ et s0 ≈ t0 t2~s2 and t3~s3
• We have not: t1~s1, t1’~s1 and t0~s0
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 19 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 20
p TEMPORAL LOGICS
q
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 25 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 26
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 27 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 28
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 29 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 30
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 31 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 32
Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 35 Dr. Abderahman KRIOUILE - Introduction to Formal Methods - ENSIAS 2015/2016 36