Hoare logic
Lecture 4: A verifier for Hoare logic
Jean Pichon-Pharabod University of Cambridge CST Part II – 2017/18
Hoare logic Lecture 4: A verifier for Hoare logic Jean - - PowerPoint PPT Presentation
Hoare logic Lecture 4: A verifier for Hoare logic Jean Pichon-Pharabod University of Cambridge CST Part II 2017/18 Introduction Last time, we saw that that proofs in Hoare logic can involve large amounts of very error-prone bookkeeping
Jean Pichon-Pharabod University of Cambridge CST Part II – 2017/18
1
2
3
4
5
6
the program works;
discharge the VCs requires a good understanding of how they work.
7
8
9
10
⊢ P ⇒ Q ⊢ {P} skip {Q} ⊢ {P} C1 {R} ⊢ {R} C2 {Q} ⊢ {P} C1; C2 {Q} ⊢ P ⇒ Q[E/V ] ⊢ {P} V := E {Q} ⊢ {P} C {Q[E/V ]} ⊢ {P} C; V := E {Q} ⊢ P ⇒ I ⊢ {I ∧ B} C {I} ⊢ I ∧ ¬B ⇒ Q ⊢ {P} while B do C {Q} ⊢ {P ∧ B} C1 {Q} ⊢ {P ∧ ¬B} C2 {Q} ⊢ {P} if B then C1 else C2 {Q}
11
12
def
def
def
def
def
def
13
14
15
16
17
def
18
def
19
def
20
def
21
22
def
23
def
def
24
25
26
27
def
28
def
29
30
32
33
34
35
36
def
37
38
39
40
41
42
43