Verifikation von C-Programmen
Vorlesung 6 vom 04.12.2014: Abstract Interpretation
Christoph Lüth Universität Bremen Wintersemester 2014/15
11.12.2014 1 [8]
Galois-Connections
LetL,Mbe lattices and
α:L→M γ:M→L
withα, γmonotone, thenhL, α, γ,Miis a Galois connection if
γ.αwλl.l (1)
α.γvλm.m (2)
2 [8]
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
3 [8]
Constructing Galois Connections
LethL, α, β,Mibe a Galois connection, andSbe a set. Then (i) S→L,S→Mare lattices with functions ordered pointwise:
f vg ←→ ∀s.f svg s
(ii)hS→L, α0, γ0,S→Miis a Galois connection with α0(f) =α.f γ0(g) =γ.g
4 [8]
Generalised Monotone Framework
AGeneralised Monotone Frameworkis given by I a latticeL=hL,vi
I a finite flowF⊆Lab×Lab I a finite set of extremal labelsEvLab I an extremal labelι∈Lab
I mappingsf fromlab(F) toL×Landlab(E) toL This gives a set ofconstraints
A◦(l)wG
{A.(l0)|(l0,l)∈F} tιlE (3)
A.(l)wfl(A◦(l)) (4)
5 [8]
Correctness
LetRbe a correctness relationR⊆V×L, andhL, α, γ,Mibe a Galois connection, then we can construct a correctness relationS⊆V×Mby
v S m←→v Rγ(m)
On the other hand, ifB,Mis a Generalised Monotone Framework, and hL, α, γ,Miis a Galois connection, then a solution to the constraintsBv is a solution toAv.
This means: we can transfer the correctness problem fromLtoMand solve it there.
6 [8]
An Example
The analysisSSis given by the latticeP(State),vand given a statementS∗:
I flow(S∗)
I extremal labels areE={init(S∗)}
I the transfer functions (for Σ⊆State):
flSS(Σ) ={σ[x7→ A[[a]]σ]|σ∈Σ} if [x:=a]lis inS∗
flSS(Σ) = Σ if [skip]lis inS∗
flSS(Σ) = Σ if [b]lis inS∗
Now use the Galois connectionhP(State), αZI, γZI,Intervalito construct a monotone framework withhInterval,vi, with in particular
glIS(σ) =σ[x7→[i,j]] if [x:=a]linS∗, and [i,j] =αZI(A[[a]](γZI(σ)))
7 [8]
What’s Missing?
I Fixpoints: Widening and narrowing.
8 [8]