Verifikation von C-Programmen
Vorlesung 6 vom 04.12.2014: Abstract Interpretation
Christoph Lüth
Universität Bremen
Wintersemester 2014/15
Galois-Connections
Let L,M be lattices and
α:L→M γ :M →L
with α, γ monotone, thenhL, α, γ,Mi is a Galois connection if
γ.αwλl.l (1)
α.γ vλm.m (2)
Example of a Galois Connection
L=hP(Z),⊆i M =hInterval,vi γZI([a,b]) ={z ∈Z|a≤z ≤b}
αZI(Z) =
( ⊥ Z =∅ [inf(Z),sup(Z)] otherwise
Constructing Galois Connections
Let hL, α, β,Mi be a Galois connection, andS be a set. Then (i) S→L,S →M are lattices with functions ordered pointwise:
f vg ←→ ∀s.f svg s
(ii) hS →L, α0, γ0,S →Mi is a Galois connection with α0(f) =α.f
γ0(g) =γ.g
Generalised Monotone Framework
A Generalised Monotone Frameworkis given by
I a latticeL=hL,vi
I a finite flowF ⊆Lab×Lab
I a finite set of extremal labelsE vLab
I an extremal labelι∈Lab
I mappingsf fromlab(F) toL×Land lab(E) toL This gives a set of constraints
A◦(l)wG{A.(l0)|(l0,l)∈F} tιlE (3)
Correctness
Let R be a correctness relation R⊆V ×L, andhL, α, γ,Mi be a Galois connection, then we can construct a correctness relation S ⊆V ×M by
v S m←→v Rγ(m)
On the other hand, if B,M is a Generalised Monotone Framework, and hL, α, γ,Mi is a Galois connection, then a solution to the constraintsBv is a solution toAv.
This means: we can transfer the correctness problem from Lto M and solve it there.
An Example
The analysis SS is given by the latticeP(State),vand given a statement S∗:
I flow(S∗)
I extremal labels areE ={init(S∗)}
I the transfer functions (for Σ⊆State):
flSS(Σ) ={σ[x 7→ A[[a]]σ]|σ∈Σ} if [x:=a]l is inS∗
flSS(Σ) = Σ if [skip]l is inS∗
flSS(Σ) = Σ if [b]l is inS∗
Now use the Galois connection hP(State), αZI, γZI,Intervali to construct a monotone framework with hInterval,vi, with in particular
What’s Missing?
I Fixpoints: Widening and narrowing.