O L R I A T I O N Z A N M
I I I I I I I I
2 1 4 8 1 1 1 2 4 8 = 1 4 2 1 8 1 1 2 4 8
2 1 4 8 1 4 2 8 1 1 1 4 2 1 8 1 8 1 4 2 8 1 1 2 4 1 1 2 4 8 1 4 8 1 2 normalized 8 2 4 1 1 4 1 2 1 8 2 1 8 1 4 1 8 1 2 4 4 2 1 8 1
Consistency Γ ⊢ M ≡ N : A Completeness Type-checking Unification O (…many others) Normalization
x λ x.M M(N) A → B ⟨ M, N ⟩ fst(M) snd(M) A × B inl(M) inr(M) case(x.M; y.N; O) A + B ◇ abort(M) ⊥ ⊤
( λ x.M) N ≡ M[N/x] fst ⟨ M, N ⟩ ≡ M snd ⟨ M, N ⟩ ≡ N case(x.M; y.N; inl(O)) ≡ M[O/x] case(x.M; y.N; inr(O)) ≡ N[O/y]
( λ x.M) N ↦ M[N/x] fst ⟨ M, N ⟩ ↦ M snd ⟨ M, N ⟩ ↦ N case(x.M; y.N; inl(O)) ↦ M[O/x] M M' case(x.M; y.N; inr(O)) ↦ N[O/y] β rules λ x.fst ⟨ x,x ⟩ ≡ λ x.x : A → A
◇ fst(x) inl( ◇ ) x(y)(z) λ x.x x inl( λ x. ◇ ) case(…; x)
F ≡ λ x.F(x) : A → B both sides are stuck! P ≡ ⟨ fst(P),snd(P) ⟩ : A × B M ≡ ◇ : ⊤ η -expansion
Normalization normal By Evaluation forms η reify stuck all terms terms β eval
( λ x.M)N ( λ x.M)N steps 1 step ( λ x.M')N {x.M}N steps steps ( λ x.M')N' {x.M}N' 1 step 1 step M'[N'/x] M[N'/x] steps steps … …
normal all r e i forms f y terms η special λ x.M domain {x.M} e v a l β
reify normal domain l a v e forms 0 1 2 3 all terms x:A, y:B, z:C ⊢ λ w.w(y) A, B, C ⊢ λ 3(1) 2 De Bruijn levels : from the le x:A, y:B, z:C ⊢ λ w.w(y) 0 A, B, C ⊢ λ 0(2) Trick: use a di ff erent scheme in the domain De Bruijn indices : from the right
CUBICAL …, p:Path _.A (M;N) ⊢ p@0 ≡ M : A …, p:Path _.A (M;N) ⊢ p@1 ≡ N : A …, p:Path _.A (M;N) ⊢ p@i : A …, p:Path _.A (M;N), i=0 ⊢ p@i ≡ M : A …, p:Path _.A (M;N), i=1 ⊢ p@i ≡ N : A … ⊢ loop i : S1 …, i=0 ⊢ loop i ≡ base : S1 …, i=1 ⊢ loop i ≡ base : S1
Normalization by Evaluation β -reduction + η -expansion Hereditary Substitution alternative method TODO: Cubical Type Theory
Recommend
More recommend