SLIDE 1
Abstract Interpretation Harry Xu CS 253/INF 212 Spring 2013 - - PowerPoint PPT Presentation
Abstract Interpretation Harry Xu CS 253/INF 212 Spring 2013 - - PowerPoint PPT Presentation
Abstract Interpretation Harry Xu CS 253/INF 212 Spring 2013 Acknowledgements Many slides in this file were taken from the tutorial slides that Patrick Cousot used in VMCAI05 Abstract Interpretation A theory of sound approximation of
SLIDE 2
SLIDE 3
Abstract Interpretation
- A theory of sound approximation of the
semantics of computer programs
- A partial execution of a program which gains
information about its semantics (e.g., control- flow, data-flow) without performing all the calculations
- Establish a relationship between the concrete
semantics and the abstract semantics
SLIDE 4
More Formally
SLIDE 5
Abstract Interpretation
- A methodology to derive sound static analysis
with varying precision
– Correct by construction – Generic – Easy to fine-tune
- Example
int a[1000]; for (i = 0; i < 1000; i++) { a[i] = … ; // 0 <= i <= 999 } a[i] = … ; // i = 1000; int a[1000]; for (i = 0; i < 1000; i++) { a[i] = … ; // 0 <= i <= 999 } a[i] = … ; // i = 1000; buffer overrun safe operation
SLIDE 6
Overview
- Start with a formal specification of the
program semantics (the concrete semantics)
- Construct abstract semantic equations w.r.t. a
parametric approximation scheme
- Use general algorithms to solve the abstract
semantic equations
- Try-and-test various instantiations of the
approximation scheme in order to find the best fit
SLIDE 7
SLIDE 8
SLIDE 9
SLIDE 10
SLIDE 11
General Idea
Abstract Semantics Collecting Semantics Partitioning Concrete Semantics Abstract Domain Abstract Domain Iterative Resolution Algorithms Tuners
SLIDE 12
SLIDE 13
SLIDE 14
SLIDE 15
SLIDE 16
SLIDE 17
SLIDE 18
SLIDE 19
SLIDE 20
SLIDE 21
SLIDE 22
SLIDE 23
SLIDE 24
SLIDE 25
SLIDE 26
SLIDE 27
SLIDE 28
SLIDE 29
SLIDE 30
SLIDE 31
SLIDE 32
SLIDE 33
SLIDE 34
Which Collecting Semantics?
- Buffer overrun, division by zero, arithmetic
- verflows: state properties
- Deadlocks, un-initialized variables: finite trace
properties
- Loop termination: finite and infinite trace
properties
SLIDE 35
SLIDE 36
SLIDE 37
SLIDE 38
SLIDE 39
SLIDE 40
Fixpoint Approximation
L1 L2 L2 L1 α γ α o F o γ F Theorem: lfp F ⊆ γ (lfp α o F o γ)
SLIDE 41
Abstracting the Collecting Semantics
- Find a Galois connection:
- Find a function: α o F o γ ≤ F#
(℘(Σ), ⊆) (Σ#, ≤) α γ Partitioning ➱ Abstract sets of environments
SLIDE 42
SLIDE 43
SLIDE 44
SLIDE 45
SLIDE 46
SLIDE 47
SLIDE 48
SLIDE 49
SLIDE 50
SLIDE 51
SLIDE 52
SLIDE 53
SLIDE 54
SLIDE 55
SLIDE 56
SLIDE 57
SLIDE 58
SLIDE 59
SLIDE 60
SLIDE 61
SLIDE 62
SLIDE 63
Widening and Narrowing
- Help the fixpoint iteration quickly converge
and stabilize
- Conceptually similar to join and meet in
dataflow analysis
SLIDE 64
SLIDE 65
SLIDE 66
SLIDE 67
SLIDE 68
SLIDE 69
SLIDE 70
SLIDE 71
SLIDE 72
SLIDE 73
SLIDE 74
SLIDE 75
SLIDE 76
SLIDE 77
SLIDE 78
SLIDE 79
SLIDE 80
SLIDE 81
SLIDE 82
SLIDE 83
SLIDE 84
SLIDE 85
SLIDE 86
SLIDE 87
SLIDE 88
SLIDE 89
SLIDE 90
SLIDE 91
SLIDE 92