SLIDE 1
Minimal logic for computable functionals
Helmut Schwichtenberg
Mathematisches Institut der Universit¨ at M¨ unchen
SLIDE 2 Motivation
Proof carrying code (Lee, Necula) Why? Proofs are machine checkable (easily) Need: “code carrying proofs” Prospects:
◮ Mathematics as a numerical language (Bishop) ◮ Program development by proof transformation (adapt to
special situations, computed function can change)
◮ Unexpected algorithms in classical proofs
Here: Unexpected algorithms even in (clever) constructive proofs: existence of normal forms in typed lambda calculus, using computability predicates (a.k.a. logical relations). Needed for a proper treatment: computability in higer types based
- n the Scott-Ershov partial continuous functionals
SLIDE 3 Motivation
Proof carrying code (Lee, Necula) Why? Proofs are machine checkable (easily) Need: “code carrying proofs” Prospects:
◮ Mathematics as a numerical language (Bishop) ◮ Program development by proof transformation (adapt to
special situations, computed function can change)
◮ Unexpected algorithms in classical proofs
Here: Unexpected algorithms even in (clever) constructive proofs: existence of normal forms in typed lambda calculus, using computability predicates (a.k.a. logical relations). Needed for a proper treatment: computability in higer types based
- n the Scott-Ershov partial continuous functionals
SLIDE 4 Motivation
Proof carrying code (Lee, Necula) Why? Proofs are machine checkable (easily) Need: “code carrying proofs” Prospects:
◮ Mathematics as a numerical language (Bishop) ◮ Program development by proof transformation (adapt to
special situations, computed function can change)
◮ Unexpected algorithms in classical proofs
Here: Unexpected algorithms even in (clever) constructive proofs: existence of normal forms in typed lambda calculus, using computability predicates (a.k.a. logical relations). Needed for a proper treatment: computability in higer types based
- n the Scott-Ershov partial continuous functionals
SLIDE 5 Motivation
Proof carrying code (Lee, Necula) Why? Proofs are machine checkable (easily) Need: “code carrying proofs” Prospects:
◮ Mathematics as a numerical language (Bishop) ◮ Program development by proof transformation (adapt to
special situations, computed function can change)
◮ Unexpected algorithms in classical proofs
Here: Unexpected algorithms even in (clever) constructive proofs: existence of normal forms in typed lambda calculus, using computability predicates (a.k.a. logical relations). Needed for a proper treatment: computability in higer types based
- n the Scott-Ershov partial continuous functionals
SLIDE 6 Formulas and their types
Formulas: P( r ) | A ∧ B | A → B | ∀xρA | ∃xρA. τ(A) := type of the program to be extracted from a proof of A, or := ε if A has no “computational content” (e.g. ∀n f (n) = 0). τ(P( r )) := ε (P a predicate constant) τ(∃xρA) :=
if τ(A) = ε ρ × τ(A)
τ(∀xρA) :=
if τ(A) = ε ρ ⇒ τ(A)
τ(A0 ∧ A1) :=
if τ(A1−i) = ε τ(A0) × τ(A1)
τ(A → B) := τ(B) if τ(A) = ε ε if τ(B) = ε τ(A) ⇒ τ(B)
SLIDE 7 Computational content of a proof
[ [M] ]: τ(A), for M : A derivation (natural deduction style, written as a λ-term), and τ(A) = ε. [ [uA] ] := xτ(A)
u
(xτ(A)
u
uniquely associated with uA) [ [λuAM] ] :=
[M] ] if τ(A) = ε λxτ(A)
u
[ [M] ]
[ [MA→BN] ] :=
[M] ] if τ(A) = ε [ [M] ][ [N] ]
[ [(λxρM)∀xA] ] := λxρ[ [M] ] [ [M∀xAr] ] := [ [M] ]r. [ [MA0
0 , MA1 1 ]
] and [ [MA0∧A1i] ] are define in a similar way. Also: extracted terms for induction, cases, ∃-axioms. For M : A where τ(A) = ε let [ [M] ] := ε (new symbol).
SLIDE 8 Realizability
r mr A, where r is a term of type τ(A) (or = ε). ε mr P( r ) = P( r ), r mr (∃xA) =
if τ(A) = ε r1 mr Ax[r0]
r mr (∀xA) =
if τ(A) = ε ∀x.rx mr A
r mr (A→B) = ε mr A → r mr B if τ(A) = ε ∀x.x mr A → ε mr B if τ(A)=ε= τ(B) ∀x.x mr A → rx mr B
r mr (A0∧A1) = ε mr A0 ∧ r mr A1 if τ(A0) = ε r mr A0 ∧ ε mr A1 if τ(A1) = ε r0 mr A0 ∧ r1 mr A1
SLIDE 9
Soundness
Let xu := ε if uA is an assumption variable with τ(A) = ε.
Theorem
If M is a derivation of a formula B, then there is a derivation µ(M) of [ [M] ] mr B from assumptions { xu mr C | uC ∈ FA(M) }.
Proof.
Induction on M.
SLIDE 10
Quantifiers without computational content
Problem: Redundant variables in extracted terms. Cure (Berger 1993): Add formulas ∀ncxA | ∃ncxA, with τ(∃ncxρA) := τ(A), τ(∀ncxρA) := τ(A). For ∃nc: existence introduction and elimination axioms: (∃nc)+
x,B :
∀ncx.B → ∃ncxB (∃nc)−
x,A,B : ∃ncxA → (∀ncx.A → B) → B
with x / ∈ FV(B) Uniformity axiom: ∀ncx∃yA → ∃y∀ncxA. Can define “nc-correct proof”, w.r.t. “computational variables”.
SLIDE 11
Information systems
Let A and B be information systems. Then the objects u of A → B are in bijective correspondence with the continuous functions f from |A| to |B|:
◮ For u : A → B define |u|: |A| → |B| by
|u|(z) := { b ∈ B | u(X, b) for some X ⊆fin z }.
◮ For f : |A| → |B| define ˆ
f : A → B by ˆ f (X, b) := b ∈ f (X). Moreover, f = |ˆ f | and u = |u|.
SLIDE 12 A universal information system
Cι := N → Λ Cρ⇒σ := Cρ → Cσ Cω :=
Cρ Have injections and projections inρ : |Cρ| → |Cω|, in−1
ρ : |Cω| → |Cρ|.
Every a ∈ |Cω| has the form inρ(u) for some u ∈ |Cρ|,
Call { inρ(u) | u ∈ |Cρ| } the ρ-part of |Cω|. Let Pρ(a) mean that a is in the ρ-part of |Cω|.
SLIDE 13 Administrative functions: ModIota, HatIota
Define ModIota: |Cω| → |N| → |Λ| by ModIota
ModIota
- inτ(u)
- (k) := ∅ for τ = ι, ModIota
- ∅
- (k) := ∅.
For g : |N| → |Λ| we have ˆ g ∈ |N → Λ| = |Cι|, hence inι(ˆ g) ∈ |Cω|. Define HatIota:
HatIota(g) := inι(ˆ g). for g : |N| → |Λ|, and := ∅ else. Then ModIota(HatIota(g)) = g.
SLIDE 14 Administrative functions: Mod, Hatρ,σ
Define Mod: |Cω| → |Cω| → |Cω| by Mod
- inρ⇒σ(u)
- := inσ ◦ |u| ◦ in−1
ρ ,
Mod
- inτ(u)
- (a) := ∅ for τ not of arrow form, and
Mod
Define Hatρ,σ :
Hatρ,σ(h) := inρ⇒σ(ˆ f ) for f := in−1
σ
- h ◦ inρ : |Cρ| → |Cσ|. Then
Mod(Hatρ,σ(h)) = inσ ◦ in−1
σ
ρ .
SLIDE 15
β-reduction, η-expansion
(λxr)s → rx[s] β-conversion, r → λx. rx η-expansion (x / ∈ FV(r)).
Definition
r is in β-normal form if no (inner) β-conversion is possible.
Definition
Let r be in β-normal form. r is in η-long normal form if no (inner) η-expansion is possible without creating a new β-convertible subterm.
SLIDE 16
β-reduction, η-expansion
(λxr)s → rx[s] β-conversion, r → λx. rx η-expansion (x / ∈ FV(r)).
Definition
r is in β-normal form if no (inner) β-conversion is possible.
Definition
Let r be in β-normal form. r is in η-long normal form if no (inner) η-expansion is possible without creating a new β-convertible subterm.
SLIDE 17
β-reduction, η-expansion
(λxr)s → rx[s] β-conversion, r → λx. rx η-expansion (x / ∈ FV(r)).
Definition
r is in β-normal form if no (inner) β-conversion is possible.
Definition
Let r be in β-normal form. r is in η-long normal form if no (inner) η-expansion is possible without creating a new β-convertible subterm.
SLIDE 18
Long normal forms
Terms in long normal form (i.e. normal w.r.t. β-reduction and η-expansion) are inductively defined by λxr | (xr1 . . . rn)ι.
Definition
Let r be in β-normal form. With lnf(r) we denote the result of maximally η-expanding r.
SLIDE 19
Long normal forms
Terms in long normal form (i.e. normal w.r.t. β-reduction and η-expansion) are inductively defined by λxr | (xr1 . . . rn)ι.
Definition
Let r be in β-normal form. With lnf(r) we denote the result of maximally η-expanding r.
SLIDE 20
Predicates
N(r, s) :⇔ for some term t, r → · · · → t β-normal, and lnf(t)=s A(r, s) :⇔ r = xr1 . . . rn and s = xs1 . . . sn with N(ri, si) for i = 1, . . . , n H(r, s) :⇔ r = (λx.t)u t and s = tx[u] t F(r, k) :⇔ every index of a variable free in r is < k Abbreviations: FN(r) := ∀k.F(r, k) → ∃s N(r, s), FA(r) := ∀k.F(r, k) → ∃s A(r, s).
SLIDE 21
Predicates
N(r, s) :⇔ for some term t, r → · · · → t β-normal, and lnf(t)=s A(r, s) :⇔ r = xr1 . . . rn and s = xs1 . . . sn with N(ri, si) for i = 1, . . . , n H(r, s) :⇔ r = (λx.t)u t and s = tx[u] t F(r, k) :⇔ every index of a variable free in r is < k Abbreviations: FN(r) := ∀k.F(r, k) → ∃s N(r, s), FA(r) := ∀k.F(r, k) → ∃s A(r, s).
SLIDE 22
Computability predicates
C ι(r) := FNι(r), C ρ⇒σ(r) := ∀ncs.C ρ(s) → C σ(rs). C ρ(r) must have computational content (because FN has). We will later make it explicit. We freely use properties of N, A, H, F as axioms, provided they have no computational content.
Example
(Ax1): F(r, k) → Nσ(rx, s) → Nρ⇒σ(r, λxρs).
SLIDE 23
Computability predicates
C ι(r) := FNι(r), C ρ⇒σ(r) := ∀ncs.C ρ(s) → C σ(rs). C ρ(r) must have computational content (because FN has). We will later make it explicit. We freely use properties of N, A, H, F as axioms, provided they have no computational content.
Example
(Ax1): F(r, k) → Nσ(rx, s) → Nρ⇒σ(r, λxρs).
SLIDE 24
Computability predicates
C ι(r) := FNι(r), C ρ⇒σ(r) := ∀ncs.C ρ(s) → C σ(rs). C ρ(r) must have computational content (because FN has). We will later make it explicit. We freely use properties of N, A, H, F as axioms, provided they have no computational content.
Example
(Ax1): F(r, k) → Nσ(rx, s) → Nρ⇒σ(r, λxρs).
SLIDE 25
Computability predicates
C ι(r) := FNι(r), C ρ⇒σ(r) := ∀ncs.C ρ(s) → C σ(rs). C ρ(r) must have computational content (because FN has). We will later make it explicit. We freely use properties of N, A, H, F as axioms, provided they have no computational content.
Example
(Ax1): F(r, k) → Nσ(rx, s) → Nρ⇒σ(r, λxρs).
SLIDE 26 Existence of normal forms
Lemma 1: (a) C ρ(r) → FNρ(r), (b) FAρ(r) → C ρ(r) Lemma 2: C ρ(r′) → H(r, r′) → C ρ(r) Lemma 3:
ρ(
s ) → C ρ(r[ s ]) NTheorem: ∃s Nρ(r, s)
SLIDE 27 Existence of normal forms
Lemma 1: (a) C ρ(r) → FNρ(r), (b) FAρ(r) → C ρ(r) Lemma 2: C ρ(r′) → H(r, r′) → C ρ(r) Lemma 3:
ρ(
s ) → C ρ(r[ s ]) NTheorem: ∃s Nρ(r, s)
SLIDE 28 Existence of normal forms
Lemma 1: (a) C ρ(r) → FNρ(r), (b) FAρ(r) → C ρ(r) Lemma 2: C ρ(r′) → H(r, r′) → C ρ(r) Lemma 3:
ρ(
s ) → C ρ(r[ s ]) NTheorem: ∃s Nρ(r, s)
SLIDE 29 Predicates
In our formalization, N, A and H are inductively defined by BetaNf(r, t) → EtaExpρ
AVar: ( ρ ⊢ xk : ρ) → Aρ
(writing xk for k), AApp: Aρ⇒σ
(r, r1) → ( ρ ⊢ s : ρ) → Nρ
- ρ(s, s1) → Aσ
- ρ(rs, r1s1),
H
s ]s, r[s, s ]
Abbreviations: F ρ
ρ ⊢ r : ρ) ∧ Lh( ρ ) ≤ k, FNρ
- ρ(r) := ∀k.F ρ
- ρ (r, k) → ∃s Nρ
- ρ(r, s),
FAρ
- ρ(r) := ∀k.F ρ
- ρ (r, k) → ∃s Aρ
- ρ(r, s),
SLIDE 30 Predicates
In our formalization, N, A and H are inductively defined by BetaNf(r, t) → EtaExpρ
AVar: ( ρ ⊢ xk : ρ) → Aρ
(writing xk for k), AApp: Aρ⇒σ
(r, r1) → ( ρ ⊢ s : ρ) → Nρ
- ρ(s, s1) → Aσ
- ρ(rs, r1s1),
H
s ]s, r[s, s ]
Abbreviations: F ρ
ρ ⊢ r : ρ) ∧ Lh( ρ ) ≤ k, FNρ
- ρ(r) := ∀k.F ρ
- ρ (r, k) → ∃s Nρ
- ρ(r, s),
FAρ
- ρ(r) := ∀k.F ρ
- ρ (r, k) → ∃s Aρ
- ρ(r, s),
SLIDE 31 Axioms
Usual logical axioms, and induction axioms for the free algebras involved (boole, nat, type, term). Write xk for k, and λxρ
k r for
λρr[1, . . . , k, 0].
(r, k) → Nσ
ρ,k,ρ)(rxk, s) → Nρ⇒σ
(r, λxρ
k s).
- Ax2. Aι
- ρ(r, s) → Nι
- ρ(r, s).
- Ax3. H(r, s) → Nρ
- ρ(s, t) → Nρ
- ρ(r, t).
- Ax4. H(r, s) → H(rt, st).
SLIDE 32 Axioms
Usual logical axioms, and induction axioms for the free algebras involved (boole, nat, type, term). Write xk for k, and λxρ
k r for
λρr[1, . . . , k, 0].
(r, k) → Nσ
ρ,k,ρ)(rxk, s) → Nρ⇒σ
(r, λxρ
k s).
- Ax2. Aι
- ρ(r, s) → Nι
- ρ(r, s).
- Ax3. H(r, s) → Nρ
- ρ(s, t) → Nρ
- ρ(r, t).
- Ax4. H(r, s) → H(rt, st).
SLIDE 33 Axioms
Usual logical axioms, and induction axioms for the free algebras involved (boole, nat, type, term). Write xk for k, and λxρ
k r for
λρr[1, . . . , k, 0].
(r, k) → Nσ
ρ,k,ρ)(rxk, s) → Nρ⇒σ
(r, λxρ
k s).
- Ax2. Aι
- ρ(r, s) → Nι
- ρ(r, s).
- Ax3. H(r, s) → Nρ
- ρ(s, t) → Nρ
- ρ(r, t).
- Ax4. H(r, s) → H(rt, st).
SLIDE 34 Axioms
Usual logical axioms, and induction axioms for the free algebras involved (boole, nat, type, term). Write xk for k, and λxρ
k r for
λρr[1, . . . , k, 0].
(r, k) → Nσ
ρ,k,ρ)(rxk, s) → Nρ⇒σ
(r, λxρ
k s).
- Ax2. Aι
- ρ(r, s) → Nι
- ρ(r, s).
- Ax3. H(r, s) → Nρ
- ρ(s, t) → Nρ
- ρ(r, t).
- Ax4. H(r, s) → H(rt, st).
SLIDE 35 Axioms
Usual logical axioms, and induction axioms for the free algebras involved (boole, nat, type, term). Write xk for k, and λxρ
k r for
λρr[1, . . . , k, 0].
(r, k) → Nσ
ρ,k,ρ)(rxk, s) → Nρ⇒σ
(r, λxρ
k s).
- Ax2. Aι
- ρ(r, s) → Nι
- ρ(r, s).
- Ax3. H(r, s) → Nρ
- ρ(s, t) → Nρ
- ρ(r, t).
- Ax4. H(r, s) → H(rt, st).
SLIDE 36 Axioms
Usual logical axioms, and induction axioms for the free algebras involved (boole, nat, type, term). Write xk for k, and λxρ
k r for
λρr[1, . . . , k, 0].
(r, k) → Nσ
ρ,k,ρ)(rxk, s) → Nρ⇒σ
(r, λxρ
k s).
- Ax2. Aι
- ρ(r, s) → Nι
- ρ(r, s).
- Ax3. H(r, s) → Nρ
- ρ(s, t) → Nρ
- ρ(r, t).
- Ax4. H(r, s) → H(rt, st).
SLIDE 37 Computability predicates with explicit realizers
¯ C ι
:= ( ρ ⊢ r : ι) ∧ Pι(a) ∧ ∀k.F ι
- ρ(r, k) → Nι
- ρ(r, ModIota(a, k)),
¯ C ρ⇒σ
(a, r) := ( ρ ⊢ r : ρ ⇒ σ) ∧ Pρ⇒σ(a) ∧ ∀ σ, b, s.¯ C ρ
σ(b, s) → ¯
C σ
σ(Mod(a, b), rs).
¯ C ρ
- ρ (a, r) has no computational content (because N hasn’t).
Then define the computability predicates by C ρ
C ρ
and prove (the ∀nc-closures of) their properties above.
SLIDE 38 Computability predicates with explicit realizers
¯ C ι
:= ( ρ ⊢ r : ι) ∧ Pι(a) ∧ ∀k.F ι
- ρ(r, k) → Nι
- ρ(r, ModIota(a, k)),
¯ C ρ⇒σ
(a, r) := ( ρ ⊢ r : ρ ⇒ σ) ∧ Pρ⇒σ(a) ∧ ∀ σ, b, s.¯ C ρ
σ(b, s) → ¯
C σ
σ(Mod(a, b), rs).
¯ C ρ
- ρ (a, r) has no computational content (because N hasn’t).
Then define the computability predicates by C ρ
C ρ
and prove (the ∀nc-closures of) their properties above.
SLIDE 39 Computability predicates with explicit realizers
¯ C ι
:= ( ρ ⊢ r : ι) ∧ Pι(a) ∧ ∀k.F ι
- ρ(r, k) → Nι
- ρ(r, ModIota(a, k)),
¯ C ρ⇒σ
(a, r) := ( ρ ⊢ r : ρ ⇒ σ) ∧ Pρ⇒σ(a) ∧ ∀ σ, b, s.¯ C ρ
σ(b, s) → ¯
C σ
σ(Mod(a, b), rs).
¯ C ρ
- ρ (a, r) has no computational content (because N hasn’t).
Then define the computability predicates by C ρ
C ρ
and prove (the ∀nc-closures of) their properties above.
SLIDE 40 Computability predicates
Lemma
C ι
:= ( ρ ⊢ r : ι) ∧ FNι
C ρ⇒σ
(r) := ( ρ ⊢ r : ρ ⇒ σ) ∧ ∀ncs, σ.C ρ
σ(s) → C σ
σ(rs).
The proof uses (AC) ∀x∃y A(x, y) → ∃f ∀x A(x, f (x)) (A(x, y) arbitrary), (IP) (A → ∃x B(x)) → ∃x.A → B(x), where τ(A) = ε, (UNC) ∀ncx∃yA(x, y) → ∃y∀ncxA(x, y), which are realized by identity functions.
SLIDE 41 Computability predicates
Lemma
C ι
:= ( ρ ⊢ r : ι) ∧ FNι
C ρ⇒σ
(r) := ( ρ ⊢ r : ρ ⇒ σ) ∧ ∀ncs, σ.C ρ
σ(s) → C σ
σ(rs).
The proof uses (AC) ∀x∃y A(x, y) → ∃f ∀x A(x, f (x)) (A(x, y) arbitrary), (IP) (A → ∃x B(x)) → ∃x.A → B(x), where τ(A) = ε, (UNC) ∀ncx∃yA(x, y) → ∃y∀ncxA(x, y), which are realized by identity functions.
SLIDE 42 Computability predicates
Lemma
C ι
:= ( ρ ⊢ r : ι) ∧ FNι
C ρ⇒σ
(r) := ( ρ ⊢ r : ρ ⇒ σ) ∧ ∀ncs, σ.C ρ
σ(s) → C σ
σ(rs).
The proof uses (AC) ∀x∃y A(x, y) → ∃f ∀x A(x, f (x)) (A(x, y) arbitrary), (IP) (A → ∃x B(x)) → ∃x.A → B(x), where τ(A) = ε, (UNC) ∀ncx∃yA(x, y) → ∃y∀ncxA(x, y), which are realized by identity functions.
SLIDE 43 Computability predicates
Lemma
C ι
:= ( ρ ⊢ r : ι) ∧ FNι
C ρ⇒σ
(r) := ( ρ ⊢ r : ρ ⇒ σ) ∧ ∀ncs, σ.C ρ
σ(s) → C σ
σ(rs).
The proof uses (AC) ∀x∃y A(x, y) → ∃f ∀x A(x, f (x)) (A(x, y) arbitrary), (IP) (A → ∃x B(x)) → ∃x.A → B(x), where τ(A) = ε, (UNC) ∀ncx∃yA(x, y) → ∃y∀ncxA(x, y), which are realized by identity functions.
SLIDE 44 Computability predicates
Lemma
C ι
:= ( ρ ⊢ r : ι) ∧ FNι
C ρ⇒σ
(r) := ( ρ ⊢ r : ρ ⇒ σ) ∧ ∀ncs, σ.C ρ
σ(s) → C σ
σ(rs).
The proof uses (AC) ∀x∃y A(x, y) → ∃f ∀x A(x, f (x)) (A(x, y) arbitrary), (IP) (A → ∃x B(x)) → ∃x.A → B(x), where τ(A) = ε, (UNC) ∀ncx∃yA(x, y) → ∃y∀ncxA(x, y), which are realized by identity functions.
SLIDE 45 Computability predicates
Lemma
C ι
:= ( ρ ⊢ r : ι) ∧ FNι
C ρ⇒σ
(r) := ( ρ ⊢ r : ρ ⇒ σ) ∧ ∀ncs, σ.C ρ
σ(s) → C σ
σ(rs).
The proof uses (AC) ∀x∃y A(x, y) → ∃f ∀x A(x, f (x)) (A(x, y) arbitrary), (IP) (A → ∃x B(x)) → ∃x.A → B(x), where τ(A) = ε, (UNC) ∀ncx∃yA(x, y) → ∃y∀ncxA(x, y), which are realized by identity functions.
SLIDE 46
Extracted term: lemma 1
(Rec type=>(omega=>nat=>term)@@((nat=>term)=>omega)) (ModIota@([g3]OmegaInIota(cACL g3))) ([rho3,rho4,p5,p6] ([a7,n8] Abs rho3 (Sub(left p6(Mod a7(right p5([n9]Var n8)))(Succ n8)) ((Var map Seq 1 n8):+:(Var 0):)))@ ([g7] Hat rho3 rho4 ((cAC omega omega) ([a9] (cUNC omega) ((cUNC omega)((cIP omega) (right p6([n10]g7 n10(left p5 a9 n10)))))))))
SLIDE 47 Lemma 1 ∼ reify & reflect
Disregarding administrative functions and translating via rho4 rho5 left p5 right p5 left p6 right p6 ρ σ ↓ρ ↑ρ ↓σ ↑σ gives ↓ρ : Cω → (N → Λ) (“reify”) ↑ρ : (N → Λ) → Cω (“reflect”), with the recursion equations ↓ι(r):=r, ↑ι(r):=r, ↓ρ⇒σ(a)(k):=λxρ
k .↓σ
k ))
↑ρ⇒σ(r)(b):=↑σ(r ↓ρ(b)).
SLIDE 48
Extracted term: lemma 3
(Rec term=>list type=>list omega=>omega) ([n3,rhos4](ListRef omega)n3) ([r3,r4,q5,q6,rhos7,as8] Mod(q5 rhos7 as8)(q6 rhos7 as8)) ([rho3,r4,q5,rhos6,as7] Hat rho3(Typ(rho3::rhos6)r4) ((cAC omega omega) ([a9](cUNC omega)((cUNC omega)((cIP omega) (q5(rho3::rhos6)(a9::as7)))))))
SLIDE 49 Lemma 3 ∼ evaluation
For cLemmaThree(r, ρ, a) write [ [r] ](xρ0
0 →a0,...,x ρk−1 k−1 →ak−1)
with k := Lh( ρ )
[r] ](
x→ a). Disregarding administrative functions gives
[ [xi] ](
x→ a)
= ai [ [rs] ](
x→ a)
= [ [r] ](
x→ a)[
[s] ](
x→ a)
[ [λxρ
k r]
](
x→ a)(b) = [
[r] ](
x,xρ
k →
a,b)
SLIDE 50
NThm ∼ normalization by evaluation
Extracted term: NThm: [rhos0,r1] left(cLemmaOne(Typ rhos0 r1)) (cLemmaThree r1 rhos0(cSCrsSeq rhos0 0)) Lh rhos0 Let ↑ denote the variable assignment xρ
k → ↑ρ(xk). Then
cNThm( ρ, r) computes the long normal form of r as ↓ρ([ [r] ]↑)(k) with k = Lh( ρ ). This is “normalization by evaluation”.
SLIDE 51
Conclusion
◮ Program extraction from proofs not only gives certified code
(“no logical errors”), but (in case of clever proofs) can even give unexpected new algorithms.
◮ Analyzing computability in finite types over the Scott-Ershov
partial continuous functionals can be indispensible for an appropriate formulation.
◮ Formalization of proofs involving the latter is necessary and
needs to be developed.
SLIDE 52
Conclusion
◮ Program extraction from proofs not only gives certified code
(“no logical errors”), but (in case of clever proofs) can even give unexpected new algorithms.
◮ Analyzing computability in finite types over the Scott-Ershov
partial continuous functionals can be indispensible for an appropriate formulation.
◮ Formalization of proofs involving the latter is necessary and
needs to be developed.
SLIDE 53
Conclusion
◮ Program extraction from proofs not only gives certified code
(“no logical errors”), but (in case of clever proofs) can even give unexpected new algorithms.
◮ Analyzing computability in finite types over the Scott-Ershov
partial continuous functionals can be indispensible for an appropriate formulation.
◮ Formalization of proofs involving the latter is necessary and
needs to be developed.