Encoding Separation Logic in Coq and Its Application
Reynald Affeldt
AIST-RCIS
Nicolas Marti
University of Tokyo
Encoding Separation Logic in Coq and Its Application Reynald - - PowerPoint PPT Presentation
Encoding Separation Logic in Coq and Its Application Reynald Affeldt Nicolas Marti AIST-RCIS University of Tokyo Research Project Verification of low-level software: Specialized operating systems Device drivers
AIST-RCIS
University of Tokyo
memory” [Bevier, IEEE Trans. 1988]
– E.g., a user application replacing the process descriptor of an authentication server
processor runs in segmented mode
blocks and only free blocks are marked as such
user privilege and context switching preserves this privilege
Next slides See paper and website for details See paper and website for details
hmAlloc (y, sizey);
if (y == 0) return ERROR; /* split the found block to the appropriate size */ split (y, sizey); /* if not found, compact and search again */ if (y == 0) { compact(); y = findFree (sizey); }
hmAlloc (y, sizey); /* look for a large-enough block */ y = findFree (sizey); y sizey y
hmAlloc (y, sizey); y sizey hmAlloc (y, sizey); y sizey
1 1
heap-list, or
followed by a heap-list
) ( )) 2 ( ) 2 ( ( ) , ( ) .( ) ( )) 2 ( ) 2 ( ) , ( ) .( ) , .( next l next l next allocated l nil next next next l next l next free l nil next next nil st l st l list
Array list
( Array list
∗ − − + ∗ ∧ ≠ ∃ ∨ ∗ − − + ∗ ∧ ≠ ∃ ∨ ∃ = a a a
)))) 1 ( ) 1 ( ( ) . (( ( ) ( − + ∗ ∃ ∧ > ∨ ∧ = = sz l e l e sz sz sz l Array emp Array a
Formal predicates:
x x x f a
x x y y x
x x y y y x
⎪ ⎪ ⎪ ⎭ ⎪ ⎪ ⎪ ⎬ ⎫ ⎪ ⎪ ⎪ ⎩ ⎪ ⎪ ⎪ ⎨ ⎧ ∗ ∧ = ∨ ∗ ∗ ∧ ≥ ∃ == ⎪ ⎪ ⎪ ⎭ ⎪ ⎪ ⎪ ⎬ ⎫ ⎪ ⎪ ⎪ ⎩ ⎪ ⎪ ⎪ ⎨ ⎧ ∗ ∧ = ∨ ∗ ∗ ∧ ≥ ∃
x x y y x x y
size x base hm x y size y size x base hm y x size size size size y y size x base hm x y size y size x base hm y x size size size Array List
Array Array List
); , ( split } ERROR; return { ) ( if Array List
Array Array List
_ }{} { _ }{} , { . _ }{} { _ } }{ { .
[Reynolds, LICS 2002]
Next slide Overview in previous slides
Core separation logic Additional facilities
Assignments pointer dereferences, destructive updates, loops, etc.
Variables and heap
Satisfaction relation |= Operational semantics st ⎯ c→ st’ Hoare triples {P}c{Q}
Data structures (arrays, lists), lemmas (split, concatenation, insertion, etc.), weakest preconditions generator (triples for backward reasoning), frame rule (for compositional reasoning), tactics for heap partitions
Soundness
– Verification of micro-kernels:
– Commercial o.s. verified in PowerEpsilon – Verification of error-recovery of system calls
– C++ translation into PVS
– Verification of C programs:
– Separation logic encoding:
– Decidable fragment [Berdine et al., FSTTCS 2004] – Symbolic evaluator [Berdine et al., APLAS 2005]
APLAS 2005]: