SlideShare uma empresa Scribd logo
1 de 45
Interactive Verification of Safety-Critical Software
Daniela da Cruz, Pedro R. Henriques, Jorge S. Pinto
Universidade do Minho, Portugal
danieladacruz@di.uminho.pt
COMPSAC’2013, Kyoto, Japan
July 25, 2013
Daniela da Cruz Interactive Verification of Safety-Critical Software
Context
Nowadays there are various recommendations contained in industry
norms that reinforces the importance of Formal Software
Verification:
ISO/IEC-15408 (known as Common Criteria, for security
sensitive applications)
CENELEC EN 50128 (in the railway domain)
DO-178C (in the aerospace domain).
“Safety is imperative to keeping the skies friendly, and DO-178B
has been keeping avionics systems engineers on the straight and
narrow for years.”, in VME and Critical System magazine.
Daniela da Cruz Interactive Verification of Safety-Critical Software
Context
Verification activities are essential to achieve the required level
of confidence expected in critical software
but
They are becoming increasingly costly.
Formal program verification offers a way to reduce these costs
while providing stronger guarantees than testing.
Daniela da Cruz Interactive Verification of Safety-Critical Software
Context
The goal of the tools known as Verification Condition Generators
(VCGens) is precisely to ensure that a software satisfies its formal
specification.
Daniela da Cruz Interactive Verification of Safety-Critical Software
Motivation
Current trend:
Use a single generation strategy and send the resulting proof
obligations to an external SMT solver.
Our proposal:
1 To establish a basis for the generation of verification
conditions combining forward and backward reasoning;
2 To introduce an interactive (visual) technique to verify a
program.
Daniela da Cruz Interactive Verification of Safety-Critical Software
Motivation
Consider the following sequence of statements:
1 x := 100;
x := x+50;
and P = y > 10, Q = x ≥ 100.
Daniela da Cruz Interactive Verification of Safety-Critical Software
Motivation
Using traditional VCGens, we would need to choose one of the
following VCs to prove the correctness of the program:
y > 10 → true
or
(y > 10 ∧ x = 150) → x ≥ 100
Our approach is to allow the mix of both strategies (and using
intermediate points):
(y > 10 ∧ x = 100) → x ≥ 50
Daniela da Cruz Interactive Verification of Safety-Critical Software
Outline
1 Basic Concepts
The Language
Verification Conditions Generation
2 Labelled Control Flow Graph
3 Verification Graphs
4 Applications
5 Conclusions & Future Work
Daniela da Cruz Interactive Verification of Safety-Critical Software
Contents
1 Basic Concepts
The Language
Verification Conditions Generation
2 Labelled Control Flow Graph
3 Verification Graphs
4 Applications
5 Conclusions & Future Work
Daniela da Cruz Interactive Verification of Safety-Critical Software
The Language
Assert A ::= b | true | false | A ∧ A | A ∨ A | ¬ A | A → A
| ∀ x. A | ∃ x. A
Comm C ::= skip | x := e | if b then S else S
| while b do {A, ev } S | call p
Block S ::= C | C ; S
Proc Φ ::= pre A post A proc p = S
Prog Π ::= Φ | Π Φ
Daniela da Cruz Interactive Verification of Safety-Critical Software
Verification Conditions Generation
There are two well-established methods for producing sets of
verification conditions:
based on backward propagation and
based on forward propagation of assertions.
Daniela da Cruz Interactive Verification of Safety-Critical Software
Backward Propagation
Verification Conditions of a Block:
Backward Propagation:
VCGw
(P, S, Q) = {P → wprec(S, Q)} ∪ wvc(S, Q)
wprec(skip, Q) = Q
wprec(x := e, Q) = Q[e/x]
wprec(if b then St else Sf , Q) = (b → wprec(St , Q)) ∧ ( ¬ b → wprec(Sf , Q))
wprec(while b do {I} S, Q) = I
wprec(call p, Q) = ∀ xf . (∀ yf . pre(p)[yf /y] → post(p)[yf /y, xf /x]) → Q[xf /x]
wprec(C; S, Q) = wprec(C, wprec(S, Q))
Daniela da Cruz Interactive Verification of Safety-Critical Software
Backward Propagation
Verification Conditions of a Block (cont.):
Backward Propagation:
wvc(skip, Q) = ∅
wvc(x := e, Q) = ∅
wvc(if b then St else Sf , Q) = wvc(St , Q) ∪ wvc(Sf , Q)
wvc(while b do {I} S, Q) = {I ∧ b → wprec(S, I), I ∧ ¬b → Q} ∪ wvc(S, I)
Verification Conditions of a Program:
Verif(Π) =
p∈P(Π)
VCGw
(pre(p), body(p), post(p))
Daniela da Cruz Interactive Verification of Safety-Critical Software
Forward Propagation
Verification Conditions of a Block (cont.):
Forward Propagation:
VCGs
(P, S, Q) = svc(S, Q) ∪ {spost(S, P) → Q}
spost(skip, P) = P
spost(x := e, P) = ∃ v. P[v/x] ∧ x = e[v/x]
spost(if b then St else Sf , P) = spost(St , P ∧ b) ∨ spost(Sf , P ∧ ¬ b)
spost(while b do {I} S, P) = I ∧ ¬ b
spost(call p, P) = ∃ xf . P[xf /x] ∧ (∀ yf . pre(p)[yf /y, xf /x] → post(p)[yf /y])
spost(C; S, P) = spost(S, spost(C, P))
Daniela da Cruz Interactive Verification of Safety-Critical Software
Forward Propagation
Verification Conditions of a Block (cont.):
svc(skip, P) = ∅
svc(x := e, P) = ∅
svc(if b then St else Sf , P) = svc(St , P ∧ b) ∪ svc(Sf , P ∧ ¬ b)
svc(while b do {I} S, P) = {P → I, spost(S, I ∧ b) → I} ∪ svc(S, I ∧ b)
svc(call p, P) = ∅
svc(C; S, P) = svc(C, P) ∪ svc(S, spost(C, P))
Verification Conditions of a Program:
Verif(Π) =
p∈P(Π)
VCGs
(pre(p), body(p), post(p))
Daniela da Cruz Interactive Verification of Safety-Critical Software
Backward Propagation vs. Forward Propagation
Are these two approaches equivalent?
Do they produce equivalent optimized verification conditions?
Daniela da Cruz Interactive Verification of Safety-Critical Software
Backward Propagation vs. Forward Propagation
The method used for generating VCs is important for the following
reasons:
Forward propagation introduces existential quantifiers in the
generated VCs.
There are serious efficiency issues involved: a naive algorithm
can produce verification conditions of exponential size on the
length of the program, thus compromising any hope of
automating the verification process.
Daniela da Cruz Interactive Verification of Safety-Critical Software
Backward Propagation vs. Forward Propagation
We should be able to identify the particular execution paths
that causes a failed verification. A method for producing VCs
that facilitates this is advisable for debugging applications.
A failed verification may be due not only to an incorrect
program, but also possibly to inadequate annotations.
Complementing the automated verification techniques with
interactive features can help the users find the appropriate
annotations.
Daniela da Cruz Interactive Verification of Safety-Critical Software
Contents
1 Basic Concepts
The Language
Verification Conditions Generation
2 Labelled Control Flow Graph
3 Verification Graphs
4 Applications
5 Conclusions & Future Work
Daniela da Cruz Interactive Verification of Safety-Critical Software
Labelled Control Flow Graph
Given a program S, precondition P and postcondition Q such that
S = C1 ; . . . ; Cn, the labeled control flow graph LCFG(S, P, Q)
of S with respect to (P, Q) is a labeled directed acyclic graph
whose edge labels are pairs of logical assertions on program states.
(see paper for details about definition and construction of LCFG.)
Daniela da Cruz Interactive Verification of Safety-Critical Software
Labelled Control Flow Graph (example)
Consider the following simple program:
i f ( y > 0) then
2 x := 100;
x := x+50;
4 x := x−100
e l s e
6 x := x −150;
x := x −100;
8 x := x+100
and P = y > 10, Q = x ≥ 0.
Daniela da Cruz Interactive Verification of Safety-Critical Software
Labelled Control Flow Graph (example)
Daniela da Cruz Interactive Verification of Safety-Critical Software
Labelled Control Flow Graph
The basic intuition of labeled CFGs is that for every pair of
consecutive commands Ci , Ci+1 in S, there exists an edge
(Ci , Ci+1) in LCFG(S, P, Q) whose label consists of:
the strongest postcondition of the prefix of S ending with Ci ,
and
the weakest precondition of the suffix of S beginning with
Ci+1
with respect to the local specification (P, Q) of S.
Daniela da Cruz Interactive Verification of Safety-Critical Software
Labelled Control Flow Graph
We now have that:
|= VCGw
t (P, S, Q) implies |= φ → ψ for every label (φ, ψ) in the
graph.
Daniela da Cruz Interactive Verification of Safety-Critical Software
Contents
1 Basic Concepts
The Language
Verification Conditions Generation
2 Labelled Control Flow Graph
3 Verification Graphs
4 Applications
5 Conclusions & Future Work
Daniela da Cruz Interactive Verification of Safety-Critical Software
Verification Graphs
How can a Labelled Control Flow Graph be used for interactive
verification?
Daniela da Cruz Interactive Verification of Safety-Critical Software
Verification Graphs
Let Π be a program and p ∈ P(Π) a procedure of Π. Then the
verification graph of p, VG(p), is the graph
LCFG(body(p), pre(p), post(p)).
A formula φ → ψ such that (φ, ψ) is the label of an edge in the
verification graph of p will be called an edge condition of p.
Daniela da Cruz Interactive Verification of Safety-Critical Software
Verification Graphs
The idea is thus to assign a status to each edge.
Colors green, red and black are used for this purpose:
The edges whose conditions are known to be valid/invalid are
set to green/red, and we let this“check”status propagate
along the edges of the verification graph.
If all edges become green then the procedure has been
successfully verified.
Daniela da Cruz Interactive Verification of Safety-Critical Software
Verification Graphs — Edge Color
Daniela da Cruz Interactive Verification of Safety-Critical Software
Verification Graphs
In blocks not containing loops and conditionals, it is equivalent to
check the validity of any edge condition in the block’s path in the
Verification Graph.
But, in blocks containing conditionals or loops, that doesn’t
happen.
Different edge conditions need to be checked, and validity can be
propagated through the graph only by following a set of rules.
Daniela da Cruz Interactive Verification of Safety-Critical Software
Verification Graphs — Edge Color
Daniela da Cruz Interactive Verification of Safety-Critical Software
Verification Graphs — Edge Color
Daniela da Cruz Interactive Verification of Safety-Critical Software
Verification Graphs — while loops
And what about while loops?
Consider the subgraph
A
(φ1,ψ1)
→ do
(φ2,ψ2)
→ . . .
(φ3,ψ3)
→ od
(φ4,ψ4)
→ B
φ1 → ψ1 is the loop initialization VC;
φ2 → ψ2, . . . , φ3 → ψ3 are invariant preservation VCs; and
φ4 → ψ4 is the VC ensuring that the postcondition is granted
by the invariant.
It is necessary to establish independently the validity of these VCs...
Daniela da Cruz Interactive Verification of Safety-Critical Software
Verification Graphs
What is obtained is a CFG annotated with assertions from
which different sets can be picked whose validity is sufficient
to guarantee the correctness of the procedure.
Each particular set corresponds to one particular verification
strategy, mixing the use of strongest postconditions and
weakest preconditions.
Daniela da Cruz Interactive Verification of Safety-Critical Software
Verification Graphs — example
Small example
(computes the amount of taxes payable in UK, in 1999)
Daniela da Cruz Interactive Verification of Safety-Critical Software
Verification Graphs — example
Using a standard VCGen the result is a single VC, too big and
complex to be understandable.
((age ≥ 18) → (((age ≥ 75) → ((((age ≥ 65) ∧ (income > 16800)) → ((((5980−
((income − 16800)/2)) > 4335) → (((5980 − ((income − 16800)/2)) + 2000) > 5750))
∧ ((!((5980 − ((income − 16800)/2)) > 4335)) → (4335 > 5750)))) ∧ ((!((age ≥ 65)
∧ (income > 16800))) → true))) ∧ ((!(age ≥ 75)) → (((age ≥ 65) → ((((age ≥ 65)
∧ (income > 16800)) → ((((5720 − ((income − 16800)/2)) > 4335) → (((5720−
((income − 16800)/2)) + 2000) > 5750)) ∧ ((!((5720 − ((income − 16800)/2)) > 4335))
→ (4335 > 5750)))) ∧ ((!((age ≥ 65) ∧ (income > 16800))) → true))) ∧ ((!(age ≥ 65))
→ ((((age ≥ 65) ∧ (income > 16800)) → ((((4335 − ((income − 16800)/2)) > 4335)
→ (((4335 − ((income − 16800)/2)) + 2000) > 5750)) ∧ ((!((4335 − ((income − 16800)/2))
> 4335)) → (4335 > 5750)))) ∧ ((!((age ≥ 65) ∧ (income > 16800))) → true)))))))
Daniela da Cruz Interactive Verification of Safety-Critical Software
Verification Graphs — example
Daniela da Cruz Interactive Verification of Safety-Critical Software
Verification Graphs — example
Zooming-in on the subgraph correspondent to the second
conditional statement in the method, suppose that the user select
the last edge inside the then branch. The edge condition sent to
the prover is:
∃v0 : age ≥ 65 && income > 16800 && t > 4335
&& personal == t + 2000 → personal > 5750
Daniela da Cruz Interactive Verification of Safety-Critical Software
Verification Graphs — example
Daniela da Cruz Interactive Verification of Safety-Critical Software
Verification Graphs — example
If we now pick the last edge inside the else branch, the following
condition is sent to the prover:
∃v0 : age ≥ 65 && income > 16800 && t > 4335
&& personal = t + 2000 → personal > 5750
Daniela da Cruz Interactive Verification of Safety-Critical Software
Verification Graphs — example
Daniela da Cruz Interactive Verification of Safety-Critical Software
Contents
1 Basic Concepts
The Language
Verification Conditions Generation
2 Labelled Control Flow Graph
3 Verification Graphs
4 Applications
5 Conclusions & Future Work
Daniela da Cruz Interactive Verification of Safety-Critical Software
Applications
Intermediate Assertions
Automatic Error Path Discovery
Verification Condition Splitting
Daniela da Cruz Interactive Verification of Safety-Critical Software
Contents
1 Basic Concepts
The Language
Verification Conditions Generation
2 Labelled Control Flow Graph
3 Verification Graphs
4 Applications
5 Conclusions & Future Work
Daniela da Cruz Interactive Verification of Safety-Critical Software
Conclusions & Future Work
We propose an alternative approach to the traditional
verification of programs based on labeled control flow graphs.
The idea is to show the whole or a single part of the LCFG to
help the software engineer, in a interactive way, to exclude the
correct statements and focus on the wrong ones in order to fix
the existing bugs.
As future work, we intend to automatize the discovery of the
error paths.
Daniela da Cruz Interactive Verification of Safety-Critical Software

Mais conteúdo relacionado

Mais procurados

Critical buckling load geometric nonlinearity analysis of springs with rigid ...
Critical buckling load geometric nonlinearity analysis of springs with rigid ...Critical buckling load geometric nonlinearity analysis of springs with rigid ...
Critical buckling load geometric nonlinearity analysis of springs with rigid ...Salar Delavar Qashqai
 
Security of Artificial Intelligence
Security of Artificial IntelligenceSecurity of Artificial Intelligence
Security of Artificial IntelligenceFederico Cerutti
 
Cn os-lp lab manual k.roshan
Cn os-lp lab manual k.roshanCn os-lp lab manual k.roshan
Cn os-lp lab manual k.roshanriturajj
 
Geometric and material nonlinearity analysis of 2 d truss with force control ...
Geometric and material nonlinearity analysis of 2 d truss with force control ...Geometric and material nonlinearity analysis of 2 d truss with force control ...
Geometric and material nonlinearity analysis of 2 d truss with force control ...Salar Delavar Qashqai
 
c-programming-using-pointers
c-programming-using-pointersc-programming-using-pointers
c-programming-using-pointersSushil Mishra
 
Computational complexity
Computational complexityComputational complexity
Computational complexityFulvio Corno
 
Chapter 6 Balagurusamy Programming ANSI in c
Chapter 6  Balagurusamy Programming ANSI  in cChapter 6  Balagurusamy Programming ANSI  in c
Chapter 6 Balagurusamy Programming ANSI in cBUBT
 
Lab. Programs in C
Lab. Programs in CLab. Programs in C
Lab. Programs in CSaket Pathak
 
Os lab file c programs
Os lab file c programsOs lab file c programs
Os lab file c programsKandarp Tiwari
 
Chapter 5 Balagurusamy Programming ANSI in c
Chapter 5 Balagurusamy Programming ANSI  in cChapter 5 Balagurusamy Programming ANSI  in c
Chapter 5 Balagurusamy Programming ANSI in cBUBT
 
C basics
C basicsC basics
C basicsMSc CST
 
Chapter 2 : Balagurusamy_ Programming ANsI in C
Chapter 2 :  Balagurusamy_ Programming ANsI in CChapter 2 :  Balagurusamy_ Programming ANsI in C
Chapter 2 : Balagurusamy_ Programming ANsI in CBUBT
 

Mais procurados (20)

APSEC2020 Keynote
APSEC2020 KeynoteAPSEC2020 Keynote
APSEC2020 Keynote
 
Critical buckling load geometric nonlinearity analysis of springs with rigid ...
Critical buckling load geometric nonlinearity analysis of springs with rigid ...Critical buckling load geometric nonlinearity analysis of springs with rigid ...
Critical buckling load geometric nonlinearity analysis of springs with rigid ...
 
Revision1schema C programming
Revision1schema C programmingRevision1schema C programming
Revision1schema C programming
 
Cprogramcontrolifelseselection3
Cprogramcontrolifelseselection3Cprogramcontrolifelseselection3
Cprogramcontrolifelseselection3
 
Security of Artificial Intelligence
Security of Artificial IntelligenceSecurity of Artificial Intelligence
Security of Artificial Intelligence
 
Cn os-lp lab manual k.roshan
Cn os-lp lab manual k.roshanCn os-lp lab manual k.roshan
Cn os-lp lab manual k.roshan
 
Geometric and material nonlinearity analysis of 2 d truss with force control ...
Geometric and material nonlinearity analysis of 2 d truss with force control ...Geometric and material nonlinearity analysis of 2 d truss with force control ...
Geometric and material nonlinearity analysis of 2 d truss with force control ...
 
c-programming-using-pointers
c-programming-using-pointersc-programming-using-pointers
c-programming-using-pointers
 
Computational complexity
Computational complexityComputational complexity
Computational complexity
 
Chapter 6 Balagurusamy Programming ANSI in c
Chapter 6  Balagurusamy Programming ANSI  in cChapter 6  Balagurusamy Programming ANSI  in c
Chapter 6 Balagurusamy Programming ANSI in c
 
Lab. Programs in C
Lab. Programs in CLab. Programs in C
Lab. Programs in C
 
Os lab file c programs
Os lab file c programsOs lab file c programs
Os lab file c programs
 
Chapter 5 Balagurusamy Programming ANSI in c
Chapter 5 Balagurusamy Programming ANSI  in cChapter 5 Balagurusamy Programming ANSI  in c
Chapter 5 Balagurusamy Programming ANSI in c
 
C basics
C basicsC basics
C basics
 
Revision1 C programming
Revision1 C programmingRevision1 C programming
Revision1 C programming
 
NUS PhD e-open day 2020
NUS PhD e-open day 2020NUS PhD e-open day 2020
NUS PhD e-open day 2020
 
Mobilesoft 2017 Keynote
Mobilesoft 2017 KeynoteMobilesoft 2017 Keynote
Mobilesoft 2017 Keynote
 
Chapter 2 : Balagurusamy_ Programming ANsI in C
Chapter 2 :  Balagurusamy_ Programming ANsI in CChapter 2 :  Balagurusamy_ Programming ANsI in C
Chapter 2 : Balagurusamy_ Programming ANsI in C
 
Chapter02b
Chapter02bChapter02b
Chapter02b
 
C Programming
C ProgrammingC Programming
C Programming
 

Destaque

Comment Analysis approach for Program Comprehension (Software Engineering Wor...
Comment Analysis approach for Program Comprehension (Software Engineering Wor...Comment Analysis approach for Program Comprehension (Software Engineering Wor...
Comment Analysis approach for Program Comprehension (Software Engineering Wor...Daniela Da Cruz
 
Game Development with AndEngine
Game Development with AndEngineGame Development with AndEngine
Game Development with AndEngineDaniela Da Cruz
 
Introduction to iOS and Objective-C
Introduction to iOS and Objective-CIntroduction to iOS and Objective-C
Introduction to iOS and Objective-CDaniela Da Cruz
 
Testing safety critical control systems
Testing safety critical control systemsTesting safety critical control systems
Testing safety critical control systemsyvjadi123
 
Model-Driven Development for Safety-Critical Software
Model-Driven Development for Safety-Critical SoftwareModel-Driven Development for Safety-Critical Software
Model-Driven Development for Safety-Critical Softwaregjuljo
 
Android Lesson 3 - Intent
Android Lesson 3 - IntentAndroid Lesson 3 - Intent
Android Lesson 3 - IntentDaniela Da Cruz
 
Code coverage for automation scripts
Code coverage for automation scriptsCode coverage for automation scripts
Code coverage for automation scriptsvodQA
 
Safety-Critical Systems and The Benefits of Using Ada
Safety-Critical Systems and The Benefits of Using AdaSafety-Critical Systems and The Benefits of Using Ada
Safety-Critical Systems and The Benefits of Using AdaAdrian Hoe
 

Destaque (13)

C basics
C basicsC basics
C basics
 
Android Introduction
Android IntroductionAndroid Introduction
Android Introduction
 
Comment Analysis approach for Program Comprehension (Software Engineering Wor...
Comment Analysis approach for Program Comprehension (Software Engineering Wor...Comment Analysis approach for Program Comprehension (Software Engineering Wor...
Comment Analysis approach for Program Comprehension (Software Engineering Wor...
 
Game Development with AndEngine
Game Development with AndEngineGame Development with AndEngine
Game Development with AndEngine
 
Introduction to iOS and Objective-C
Introduction to iOS and Objective-CIntroduction to iOS and Objective-C
Introduction to iOS and Objective-C
 
Testing safety critical control systems
Testing safety critical control systemsTesting safety critical control systems
Testing safety critical control systems
 
Games Concepts
Games ConceptsGames Concepts
Games Concepts
 
Model-Driven Development for Safety-Critical Software
Model-Driven Development for Safety-Critical SoftwareModel-Driven Development for Safety-Critical Software
Model-Driven Development for Safety-Critical Software
 
Android Lesson 3 - Intent
Android Lesson 3 - IntentAndroid Lesson 3 - Intent
Android Lesson 3 - Intent
 
Android Lesson 2
Android Lesson 2Android Lesson 2
Android Lesson 2
 
Do 178 B Summary
Do 178 B SummaryDo 178 B Summary
Do 178 B Summary
 
Code coverage for automation scripts
Code coverage for automation scriptsCode coverage for automation scripts
Code coverage for automation scripts
 
Safety-Critical Systems and The Benefits of Using Ada
Safety-Critical Systems and The Benefits of Using AdaSafety-Critical Systems and The Benefits of Using Ada
Safety-Critical Systems and The Benefits of Using Ada
 

Semelhante a Interactive Verification of Safety-Critical Systems

Verification, Slicing and Visualization of Programs with Contracts
Verification, Slicing and Visualization of Programs with ContractsVerification, Slicing and Visualization of Programs with Contracts
Verification, Slicing and Visualization of Programs with Contractspinker
 
Verification Conditions for Single-Assignment Programs
Verification Conditions for Single-Assignment ProgramsVerification Conditions for Single-Assignment Programs
Verification Conditions for Single-Assignment Programspinker
 
A Comparative Analysis of Slicing for Structured Programs
A Comparative Analysis of Slicing for Structured ProgramsA Comparative Analysis of Slicing for Structured Programs
A Comparative Analysis of Slicing for Structured ProgramsEditor IJCATR
 
connecting discrete mathematics and software engineering
connecting discrete mathematics and software engineeringconnecting discrete mathematics and software engineering
connecting discrete mathematics and software engineeringRam Kumar K R
 
Sw metrics for regression testing
Sw metrics for regression testingSw metrics for regression testing
Sw metrics for regression testingJyotsna Sharma
 
SSL Failing, Sharing, and Scheduling
SSL Failing, Sharing, and SchedulingSSL Failing, Sharing, and Scheduling
SSL Failing, Sharing, and SchedulingDavid Evans
 
Compiler Construction | Lecture 11 | Monotone Frameworks
Compiler Construction | Lecture 11 | Monotone FrameworksCompiler Construction | Lecture 11 | Monotone Frameworks
Compiler Construction | Lecture 11 | Monotone FrameworksEelco Visser
 
A Future for R: Parallel and Distributed Processing in R for Everyone
A Future for R: Parallel and Distributed Processing in R for EveryoneA Future for R: Parallel and Distributed Processing in R for Everyone
A Future for R: Parallel and Distributed Processing in R for Everyoneinside-BigData.com
 
building global software/earthcube->sciencecloud
building global software/earthcube->sciencecloudbuilding global software/earthcube->sciencecloud
building global software/earthcube->sciencecloudIan Foster
 
[論文紹介] VCC-Finder: Finding Potential Vulnerabilities in Open-Source Projects ...
[論文紹介] VCC-Finder: Finding Potential Vulnerabilities in Open-Source Projects ...[論文紹介] VCC-Finder: Finding Potential Vulnerabilities in Open-Source Projects ...
[論文紹介] VCC-Finder: Finding Potential Vulnerabilities in Open-Source Projects ...Kenta Yamamoto
 
Test flawfinder. This program wont compile or run; thats not
 Test flawfinder.  This program wont compile or run; thats not Test flawfinder.  This program wont compile or run; thats not
Test flawfinder. This program wont compile or run; thats notMoseStaton39
 
Numerical analysis
Numerical analysisNumerical analysis
Numerical analysisVishal Singh
 
electronic money by aways yare
electronic money by aways yareelectronic money by aways yare
electronic money by aways yareaways daahir
 
TMPA-2015: Implementing the MetaVCG Approach in the C-light System
TMPA-2015: Implementing the MetaVCG Approach in the C-light SystemTMPA-2015: Implementing the MetaVCG Approach in the C-light System
TMPA-2015: Implementing the MetaVCG Approach in the C-light SystemIosif Itkin
 

Semelhante a Interactive Verification of Safety-Critical Systems (20)

Verification, Slicing and Visualization of Programs with Contracts
Verification, Slicing and Visualization of Programs with ContractsVerification, Slicing and Visualization of Programs with Contracts
Verification, Slicing and Visualization of Programs with Contracts
 
Static Analysis and Verification of C Programs
Static Analysis and Verification of C ProgramsStatic Analysis and Verification of C Programs
Static Analysis and Verification of C Programs
 
Verification Conditions for Single-Assignment Programs
Verification Conditions for Single-Assignment ProgramsVerification Conditions for Single-Assignment Programs
Verification Conditions for Single-Assignment Programs
 
slides.07.pptx
slides.07.pptxslides.07.pptx
slides.07.pptx
 
A Comparative Analysis of Slicing for Structured Programs
A Comparative Analysis of Slicing for Structured ProgramsA Comparative Analysis of Slicing for Structured Programs
A Comparative Analysis of Slicing for Structured Programs
 
connecting discrete mathematics and software engineering
connecting discrete mathematics and software engineeringconnecting discrete mathematics and software engineering
connecting discrete mathematics and software engineering
 
Ch7
Ch7Ch7
Ch7
 
C programs
C programsC programs
C programs
 
Sw metrics for regression testing
Sw metrics for regression testingSw metrics for regression testing
Sw metrics for regression testing
 
SSL Failing, Sharing, and Scheduling
SSL Failing, Sharing, and SchedulingSSL Failing, Sharing, and Scheduling
SSL Failing, Sharing, and Scheduling
 
Compiler Construction | Lecture 11 | Monotone Frameworks
Compiler Construction | Lecture 11 | Monotone FrameworksCompiler Construction | Lecture 11 | Monotone Frameworks
Compiler Construction | Lecture 11 | Monotone Frameworks
 
Software metrics
Software metricsSoftware metrics
Software metrics
 
A Future for R: Parallel and Distributed Processing in R for Everyone
A Future for R: Parallel and Distributed Processing in R for EveryoneA Future for R: Parallel and Distributed Processing in R for Everyone
A Future for R: Parallel and Distributed Processing in R for Everyone
 
building global software/earthcube->sciencecloud
building global software/earthcube->sciencecloudbuilding global software/earthcube->sciencecloud
building global software/earthcube->sciencecloud
 
[論文紹介] VCC-Finder: Finding Potential Vulnerabilities in Open-Source Projects ...
[論文紹介] VCC-Finder: Finding Potential Vulnerabilities in Open-Source Projects ...[論文紹介] VCC-Finder: Finding Potential Vulnerabilities in Open-Source Projects ...
[論文紹介] VCC-Finder: Finding Potential Vulnerabilities in Open-Source Projects ...
 
Test flawfinder. This program wont compile or run; thats not
 Test flawfinder.  This program wont compile or run; thats not Test flawfinder.  This program wont compile or run; thats not
Test flawfinder. This program wont compile or run; thats not
 
Numerical analysis
Numerical analysisNumerical analysis
Numerical analysis
 
electronic money by aways yare
electronic money by aways yareelectronic money by aways yare
electronic money by aways yare
 
C lab
C labC lab
C lab
 
TMPA-2015: Implementing the MetaVCG Approach in the C-light System
TMPA-2015: Implementing the MetaVCG Approach in the C-light SystemTMPA-2015: Implementing the MetaVCG Approach in the C-light System
TMPA-2015: Implementing the MetaVCG Approach in the C-light System
 

Último

UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 

Último (20)

UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 

Interactive Verification of Safety-Critical Systems

  • 1. Interactive Verification of Safety-Critical Software Daniela da Cruz, Pedro R. Henriques, Jorge S. Pinto Universidade do Minho, Portugal danieladacruz@di.uminho.pt COMPSAC’2013, Kyoto, Japan July 25, 2013 Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 2. Context Nowadays there are various recommendations contained in industry norms that reinforces the importance of Formal Software Verification: ISO/IEC-15408 (known as Common Criteria, for security sensitive applications) CENELEC EN 50128 (in the railway domain) DO-178C (in the aerospace domain). “Safety is imperative to keeping the skies friendly, and DO-178B has been keeping avionics systems engineers on the straight and narrow for years.”, in VME and Critical System magazine. Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 3. Context Verification activities are essential to achieve the required level of confidence expected in critical software but They are becoming increasingly costly. Formal program verification offers a way to reduce these costs while providing stronger guarantees than testing. Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 4. Context The goal of the tools known as Verification Condition Generators (VCGens) is precisely to ensure that a software satisfies its formal specification. Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 5. Motivation Current trend: Use a single generation strategy and send the resulting proof obligations to an external SMT solver. Our proposal: 1 To establish a basis for the generation of verification conditions combining forward and backward reasoning; 2 To introduce an interactive (visual) technique to verify a program. Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 6. Motivation Consider the following sequence of statements: 1 x := 100; x := x+50; and P = y > 10, Q = x ≥ 100. Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 7. Motivation Using traditional VCGens, we would need to choose one of the following VCs to prove the correctness of the program: y > 10 → true or (y > 10 ∧ x = 150) → x ≥ 100 Our approach is to allow the mix of both strategies (and using intermediate points): (y > 10 ∧ x = 100) → x ≥ 50 Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 8. Outline 1 Basic Concepts The Language Verification Conditions Generation 2 Labelled Control Flow Graph 3 Verification Graphs 4 Applications 5 Conclusions & Future Work Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 9. Contents 1 Basic Concepts The Language Verification Conditions Generation 2 Labelled Control Flow Graph 3 Verification Graphs 4 Applications 5 Conclusions & Future Work Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 10. The Language Assert A ::= b | true | false | A ∧ A | A ∨ A | ¬ A | A → A | ∀ x. A | ∃ x. A Comm C ::= skip | x := e | if b then S else S | while b do {A, ev } S | call p Block S ::= C | C ; S Proc Φ ::= pre A post A proc p = S Prog Π ::= Φ | Π Φ Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 11. Verification Conditions Generation There are two well-established methods for producing sets of verification conditions: based on backward propagation and based on forward propagation of assertions. Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 12. Backward Propagation Verification Conditions of a Block: Backward Propagation: VCGw (P, S, Q) = {P → wprec(S, Q)} ∪ wvc(S, Q) wprec(skip, Q) = Q wprec(x := e, Q) = Q[e/x] wprec(if b then St else Sf , Q) = (b → wprec(St , Q)) ∧ ( ¬ b → wprec(Sf , Q)) wprec(while b do {I} S, Q) = I wprec(call p, Q) = ∀ xf . (∀ yf . pre(p)[yf /y] → post(p)[yf /y, xf /x]) → Q[xf /x] wprec(C; S, Q) = wprec(C, wprec(S, Q)) Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 13. Backward Propagation Verification Conditions of a Block (cont.): Backward Propagation: wvc(skip, Q) = ∅ wvc(x := e, Q) = ∅ wvc(if b then St else Sf , Q) = wvc(St , Q) ∪ wvc(Sf , Q) wvc(while b do {I} S, Q) = {I ∧ b → wprec(S, I), I ∧ ¬b → Q} ∪ wvc(S, I) Verification Conditions of a Program: Verif(Π) = p∈P(Π) VCGw (pre(p), body(p), post(p)) Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 14. Forward Propagation Verification Conditions of a Block (cont.): Forward Propagation: VCGs (P, S, Q) = svc(S, Q) ∪ {spost(S, P) → Q} spost(skip, P) = P spost(x := e, P) = ∃ v. P[v/x] ∧ x = e[v/x] spost(if b then St else Sf , P) = spost(St , P ∧ b) ∨ spost(Sf , P ∧ ¬ b) spost(while b do {I} S, P) = I ∧ ¬ b spost(call p, P) = ∃ xf . P[xf /x] ∧ (∀ yf . pre(p)[yf /y, xf /x] → post(p)[yf /y]) spost(C; S, P) = spost(S, spost(C, P)) Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 15. Forward Propagation Verification Conditions of a Block (cont.): svc(skip, P) = ∅ svc(x := e, P) = ∅ svc(if b then St else Sf , P) = svc(St , P ∧ b) ∪ svc(Sf , P ∧ ¬ b) svc(while b do {I} S, P) = {P → I, spost(S, I ∧ b) → I} ∪ svc(S, I ∧ b) svc(call p, P) = ∅ svc(C; S, P) = svc(C, P) ∪ svc(S, spost(C, P)) Verification Conditions of a Program: Verif(Π) = p∈P(Π) VCGs (pre(p), body(p), post(p)) Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 16. Backward Propagation vs. Forward Propagation Are these two approaches equivalent? Do they produce equivalent optimized verification conditions? Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 17. Backward Propagation vs. Forward Propagation The method used for generating VCs is important for the following reasons: Forward propagation introduces existential quantifiers in the generated VCs. There are serious efficiency issues involved: a naive algorithm can produce verification conditions of exponential size on the length of the program, thus compromising any hope of automating the verification process. Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 18. Backward Propagation vs. Forward Propagation We should be able to identify the particular execution paths that causes a failed verification. A method for producing VCs that facilitates this is advisable for debugging applications. A failed verification may be due not only to an incorrect program, but also possibly to inadequate annotations. Complementing the automated verification techniques with interactive features can help the users find the appropriate annotations. Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 19. Contents 1 Basic Concepts The Language Verification Conditions Generation 2 Labelled Control Flow Graph 3 Verification Graphs 4 Applications 5 Conclusions & Future Work Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 20. Labelled Control Flow Graph Given a program S, precondition P and postcondition Q such that S = C1 ; . . . ; Cn, the labeled control flow graph LCFG(S, P, Q) of S with respect to (P, Q) is a labeled directed acyclic graph whose edge labels are pairs of logical assertions on program states. (see paper for details about definition and construction of LCFG.) Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 21. Labelled Control Flow Graph (example) Consider the following simple program: i f ( y > 0) then 2 x := 100; x := x+50; 4 x := x−100 e l s e 6 x := x −150; x := x −100; 8 x := x+100 and P = y > 10, Q = x ≥ 0. Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 22. Labelled Control Flow Graph (example) Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 23. Labelled Control Flow Graph The basic intuition of labeled CFGs is that for every pair of consecutive commands Ci , Ci+1 in S, there exists an edge (Ci , Ci+1) in LCFG(S, P, Q) whose label consists of: the strongest postcondition of the prefix of S ending with Ci , and the weakest precondition of the suffix of S beginning with Ci+1 with respect to the local specification (P, Q) of S. Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 24. Labelled Control Flow Graph We now have that: |= VCGw t (P, S, Q) implies |= φ → ψ for every label (φ, ψ) in the graph. Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 25. Contents 1 Basic Concepts The Language Verification Conditions Generation 2 Labelled Control Flow Graph 3 Verification Graphs 4 Applications 5 Conclusions & Future Work Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 26. Verification Graphs How can a Labelled Control Flow Graph be used for interactive verification? Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 27. Verification Graphs Let Π be a program and p ∈ P(Π) a procedure of Π. Then the verification graph of p, VG(p), is the graph LCFG(body(p), pre(p), post(p)). A formula φ → ψ such that (φ, ψ) is the label of an edge in the verification graph of p will be called an edge condition of p. Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 28. Verification Graphs The idea is thus to assign a status to each edge. Colors green, red and black are used for this purpose: The edges whose conditions are known to be valid/invalid are set to green/red, and we let this“check”status propagate along the edges of the verification graph. If all edges become green then the procedure has been successfully verified. Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 29. Verification Graphs — Edge Color Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 30. Verification Graphs In blocks not containing loops and conditionals, it is equivalent to check the validity of any edge condition in the block’s path in the Verification Graph. But, in blocks containing conditionals or loops, that doesn’t happen. Different edge conditions need to be checked, and validity can be propagated through the graph only by following a set of rules. Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 31. Verification Graphs — Edge Color Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 32. Verification Graphs — Edge Color Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 33. Verification Graphs — while loops And what about while loops? Consider the subgraph A (φ1,ψ1) → do (φ2,ψ2) → . . . (φ3,ψ3) → od (φ4,ψ4) → B φ1 → ψ1 is the loop initialization VC; φ2 → ψ2, . . . , φ3 → ψ3 are invariant preservation VCs; and φ4 → ψ4 is the VC ensuring that the postcondition is granted by the invariant. It is necessary to establish independently the validity of these VCs... Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 34. Verification Graphs What is obtained is a CFG annotated with assertions from which different sets can be picked whose validity is sufficient to guarantee the correctness of the procedure. Each particular set corresponds to one particular verification strategy, mixing the use of strongest postconditions and weakest preconditions. Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 35. Verification Graphs — example Small example (computes the amount of taxes payable in UK, in 1999) Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 36. Verification Graphs — example Using a standard VCGen the result is a single VC, too big and complex to be understandable. ((age ≥ 18) → (((age ≥ 75) → ((((age ≥ 65) ∧ (income > 16800)) → ((((5980− ((income − 16800)/2)) > 4335) → (((5980 − ((income − 16800)/2)) + 2000) > 5750)) ∧ ((!((5980 − ((income − 16800)/2)) > 4335)) → (4335 > 5750)))) ∧ ((!((age ≥ 65) ∧ (income > 16800))) → true))) ∧ ((!(age ≥ 75)) → (((age ≥ 65) → ((((age ≥ 65) ∧ (income > 16800)) → ((((5720 − ((income − 16800)/2)) > 4335) → (((5720− ((income − 16800)/2)) + 2000) > 5750)) ∧ ((!((5720 − ((income − 16800)/2)) > 4335)) → (4335 > 5750)))) ∧ ((!((age ≥ 65) ∧ (income > 16800))) → true))) ∧ ((!(age ≥ 65)) → ((((age ≥ 65) ∧ (income > 16800)) → ((((4335 − ((income − 16800)/2)) > 4335) → (((4335 − ((income − 16800)/2)) + 2000) > 5750)) ∧ ((!((4335 − ((income − 16800)/2)) > 4335)) → (4335 > 5750)))) ∧ ((!((age ≥ 65) ∧ (income > 16800))) → true))))))) Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 37. Verification Graphs — example Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 38. Verification Graphs — example Zooming-in on the subgraph correspondent to the second conditional statement in the method, suppose that the user select the last edge inside the then branch. The edge condition sent to the prover is: ∃v0 : age ≥ 65 && income > 16800 && t > 4335 && personal == t + 2000 → personal > 5750 Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 39. Verification Graphs — example Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 40. Verification Graphs — example If we now pick the last edge inside the else branch, the following condition is sent to the prover: ∃v0 : age ≥ 65 && income > 16800 && t > 4335 && personal = t + 2000 → personal > 5750 Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 41. Verification Graphs — example Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 42. Contents 1 Basic Concepts The Language Verification Conditions Generation 2 Labelled Control Flow Graph 3 Verification Graphs 4 Applications 5 Conclusions & Future Work Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 43. Applications Intermediate Assertions Automatic Error Path Discovery Verification Condition Splitting Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 44. Contents 1 Basic Concepts The Language Verification Conditions Generation 2 Labelled Control Flow Graph 3 Verification Graphs 4 Applications 5 Conclusions & Future Work Daniela da Cruz Interactive Verification of Safety-Critical Software
  • 45. Conclusions & Future Work We propose an alternative approach to the traditional verification of programs based on labeled control flow graphs. The idea is to show the whole or a single part of the LCFG to help the software engineer, in a interactive way, to exclude the correct statements and focus on the wrong ones in order to fix the existing bugs. As future work, we intend to automatize the discovery of the error paths. Daniela da Cruz Interactive Verification of Safety-Critical Software