A Simple Framework for Program Verification and its Mechanical Certification in Theorema
Tudor Jebelean M˘ ad˘ alina Era¸ scu
Research Institute for Symbolic Computation, Johannes Kepler University, Linz, Austria
October 2012
1/25
A Simple Framework for Program Verification and its Mechanical - - PowerPoint PPT Presentation
A Simple Framework for Program Verification and its Mechanical Certification in Theorema Tudor Jebelean M ad alina Era scu Research Institute for Symbolic Computation, Johannes Kepler University, Linz, Austria October 2012 1/25
Research Institute for Symbolic Computation, Johannes Kepler University, Linz, Austria
1/25
2/25
3/25
◮ constructing mathematical models (logical theories) ◮ defining and testing algorithms ◮ proving – for algorithm verification or synthesis
◮ notation – formula appearance ◮ inference rules ◮ proof presentation
4/25
5/25
6/25
◮ the program contains only valid constructs, ◮ variables are initialized, ◮ every program path contains a Return.
7/25
◮ (a ≥ 0) ∧ (b ≥ 0) ∧ (a = 0)
8/25
◮ (a ≥ 0) ∧ (b ≥ 0) ∧ (a = 0)∧
9/25
◮ (a ≥ 0) ∧ (b ≥ 0) ∧ (a = 0)∧
10/25
◮ (a ≥ 0) ∧ (b ≥ 0) ∧ (a = 0)∧
11/25
¯ x:IP
i=1 ◮ This is a logical formula at object level. ◮ This is the implicit definition of the function implemented by the
◮ This is the functional program equivalent to the imperative one.
¯ x
x0←¯ x}
12/25
◮ (a ≥ 0) ∧ (b ≥ 0) ∧ (a = 0)
13/25
◮ (a ≥ 0) ∧ (b ≥ 0) ∧ (a = 0)∧
14/25
◮ (a ≥ 0) ∧ (b ≥ 0) ∧ (a = 0)∧
◮ (a ≥ 0) ∧ (b ≥ 0) ∧ (a = 0)∧
◮ (a ≥ 0) ∧ (b ≥ 0) ∧ (a = 0)∧
15/25
◮ coherence (safety) conditions; ◮ functional conditions.
¯ x
x0←¯ x}
16/25
◮ coherence (safety) conditions; ◮ functional conditions.
16/25
a,b a≥0,b≥0
a,b a≥0,b≥0
17/25
¯ x:IPΘ[{¯
x0←¯ x}
¯ x:IPπ[¯
18/25
19/25
x:If ∧
x:If Q[x] ⇒ Of [x, S[x]]
x:If ¬Q[x] ⇒ ∀ y(Of [R[x], y] ⇒ O[x, C[x, y]])
x:If ∧
x:If π[x]
20/25
h ∃ G ∀ x
n:N(G[n+, x] = h[G[n, x]])
m:N ∃ H
n<mH[n+] = h[H[n]]
H ∀ m:N
n<mH[m][n+] = h[H[m][n]]
n:N
m≥n H[m][n] = H[n][n] (natural induction on n)
x ∃ g
n:Ng[n+] = h[g[n]]
21/25
x:If ∃ n:N (Q[Rn[x]] ∧
m<n¬Q[Rm[x]]).
22/25
f ∀ x:If ∧
m:N ∃ F ∀ x:If (M[x] ≤ m) ⇒
F ∀ m:N ∀ x:If (M[x] ≤ m) ⇒
x:If
m:N(m ≥ M[x]) ⇒ (F[m][x] = F[M[x]][n])
23/25
24/25
f !Σ[P])
25/25