Viewing λ -terms through Maps
Viewing λ-terms through Maps
Masahiko Sato
Kyoto University
Randy Pollack
Harvard University
Helmut Schwichtenberg
University of Munich
Takafumi Sakurai
Chiba University
Version of April 28, 2013
Viewing -terms through Maps Masahiko Sato Kyoto University Randy - - PowerPoint PPT Presentation
Viewing -terms through Maps Viewing -terms through Maps Masahiko Sato Kyoto University Randy Pollack Harvard University Helmut Schwichtenberg University of Munich Takafumi Sakurai Chiba University Version of April 28, 2013 Viewing
Viewing λ -terms through Maps
Version of April 28, 2013
Viewing λ -terms through Maps
Viewing λ -terms through Maps Motivation
◮ Eliminates nominal: needs extensionality and quotients.
◮ Eliminates McKinna and Pollack representation (from 1993).
◮ Eliminates pure de Bruijn.
◮ Eliminates locally nameless and Sato canonical representations.
Viewing λ -terms through Maps The Intuition
◮ Occurrences of x in (xz)(yz)
◮ Occurrences of z in (xz)(yz)
Viewing λ -terms through Maps The Intuition
◮
◮ We accept ✷ as a term. ◮
◮
◮
◮
◮ the informal term λz.(xz) is written as (0 1)\(x ✷) .
Viewing λ -terms through Maps The Intuition
◮ maps can only bind ✷ , ◮
◮ We will show how to bind names.
◮
◮
◮ position (1 0) (the red ✷ ) is free, ◮ substitute (✷ ✷) in that position, ◮ get (0 1)\((✷ ✷) ✷) which is not a term because 0 is not a
◮ The solution: identify maps 0 and (0 0) .
Viewing λ -terms through Maps The Intuition
◮ Binding information shared between binding occurrences and
◮ Substitution may require α -conversion of the base term.
◮ Binding information only at bound occurrences (indexes). ◮ At binding point, only λ to mark structure. ◮ Substitution may require de Bruijn lifting of the implanted term.
◮ Binding information only at binding occurrences (maps). ◮ At bound points, only ✷ to mark structure. ◮ No adjustment required for substitution.
Viewing λ -terms through Maps The Intuition
◮ The apparent quotients and partial functions are coded in HOL
◮ Correctness of the map representation is proved w.r.t. Nominal
◮ Independently, correctness of the map representation is proved
◮ Requires induction-recursion or induction-induction.
Viewing λ -terms through Maps Maps
Viewing λ -terms through Maps Maps
Viewing λ -terms through Maps Maps
◮
◮
Viewing λ -terms through Maps Lambda terms with maps Syntax and well formedness
◮
◮
◮
Viewing λ -terms through Maps Lambda terms with maps Syntax and well formedness
Viewing λ -terms through Maps Lambda terms with maps Hole filling
Viewing λ -terms through Maps Lambda terms with maps Use of parameters
◮
Viewing λ -terms through Maps Lambda terms with maps Use of parameters
◮ There are no name-freshness conditions on these equations.
Viewing λ -terms through Maps Lambda terms with maps Use of parameters
◮ When M = λz.M′ we must assume z ♯ (x, y, N, P) ◮ By equivariance, strengthened induction principle, . . .
◮ Using the equations of substitution and the IH. ◮ No need for fresh names to appy the equations of substitution.
Viewing λ -terms through Maps Λ : Raw λ -terms
◮
◮
Viewing λ -terms through Maps Λ : Raw λ -terms Working with Λ
◮ Messy proof, like any reasoning about Λ .
◮ . . . but the proof of correctness uses fresh names and
Viewing λ -terms through Maps Λ : Raw λ -terms Working with Λ
◮ (Existence) ∃L . K{x\J} → L . ◮ (Uniqueness and Congruence)
Viewing λ -terms through Maps Λ : Raw λ -terms Working with Λ
◮ A raw term K denotes an ideal term [
◮ (Recall the definition lam(x, M) := Mx\Mx .)
Viewing λ -terms through Maps Λ : Raw λ -terms Working with Λ
◮ Depends on α being identity in nominal.
Viewing λ -terms through Maps The βη -calculus
Viewing λ -terms through Maps The βη -calculus
Viewing λ -terms through Maps The βη -calculus
◮ . . . same abstraction on both sides of the relation. ◮ Rule β of parallel reduction does not have this property.
Viewing λ -terms through Maps The βη -calculus
Viewing λ -terms through Maps The βη -calculus
◮ Case for rule ξ , where M1 = λy. P : ◮ Must α -convert M1 so that y ♯ (x, N) , allowing substitution to go
◮ Requires equivariance and name-swapping: a well-known can of
◮ E.g. β rule in parallel reduction.
Viewing λ -terms through Maps The βη -calculus
◮ Consider our example above:
σ
?
◮ One by Steve Chong passes a map around as σ . ◮ One by James McKinna passes a number (of binders we are
Viewing λ -terms through Maps Conclusion
◮ Proved correct w.r.t. nominal terms (in Isabelle). ◮ Proved correct w.r.t. pure de Bruijn (in Minlog, not discussed
◮ Substitution lemma proved without renaming.
◮ Decide α -conversion without renaming. ◮ Substitution defined and studied. ◮ Relationship with map-terms proved.
◮ Some rules are pretty in this presentation. ◮ Work in progress: we do not yet have more elegant rule induction