Introduction System F < : Formalization Conclusion A weak HOAS approach to the POPLmark Challenge Alberto Ciaffaglione Ivan Scagnetto Universit` a di Udine, Italia Dipartimento di Matematica e Informatica { alberto.ciaffaglione,ivan.scagnetto } @uniud.it LSFA 2012 - 7th Workshop on Logical and Semantic Frameworks, with Applications Rio de Janeiro, Brasil - September 29-30, 2012 Alberto Ciaffaglione, Ivan Scagnetto A weak HOAS approach to the POPLmark Challenge
Introduction System F < : Formalization Conclusion Outline Introduction 1 System F < : 2 Formalization 3 Conclusion 4 Alberto Ciaffaglione, Ivan Scagnetto A weak HOAS approach to the POPLmark Challenge
Introduction System F < : Formalization Conclusion The POPLmark Challenge Alberto Ciaffaglione, Ivan Scagnetto A weak HOAS approach to the POPLmark Challenge
Introduction System F < : Formalization Conclusion The POPLmark Challenge Formal proofs about programming language metatheory/semantics long and tedious management of the details small mistakes or missed subtle cases harmful Alberto Ciaffaglione, Ivan Scagnetto A weak HOAS approach to the POPLmark Challenge
Introduction System F < : Formalization Conclusion The POPLmark Challenge Formal proofs about programming language metatheory/semantics long and tedious management of the details small mistakes or missed subtle cases harmful Automated proof assistants may help, with potential benefits reusing the work keeping definitions and proofs consistent ensuring a firm relationship between theory and implementation Alberto Ciaffaglione, Ivan Scagnetto A weak HOAS approach to the POPLmark Challenge
Introduction System F < : Formalization Conclusion The POPLmark Challenge Formal proofs about programming language metatheory/semantics long and tedious management of the details small mistakes or missed subtle cases harmful Automated proof assistants may help, with potential benefits reusing the work keeping definitions and proofs consistent ensuring a firm relationship between theory and implementation A framework and a set of problems for measuring the progress framework System F < : : polymorphic (second-order) λ -calculus problems variable binding, complex recursion and induction, definition and proof reuse, experimentation of generated sample programs Alberto Ciaffaglione, Ivan Scagnetto A weak HOAS approach to the POPLmark Challenge
Introduction System F < : Formalization Conclusion Our contribute Alberto Ciaffaglione, Ivan Scagnetto A weak HOAS approach to the POPLmark Challenge
Introduction System F < : Formalization Conclusion Our contribute System F < : ’s type language (variable binding, complex induction) Alberto Ciaffaglione, Ivan Scagnetto A weak HOAS approach to the POPLmark Challenge
Introduction System F < : Formalization Conclusion Our contribute System F < : ’s type language (variable binding, complex induction) logical frameworks based on type theory (LFs): the Calculus of Inductive Constructions , and its Coq implementation Alberto Ciaffaglione, Ivan Scagnetto A weak HOAS approach to the POPLmark Challenge
Introduction System F < : Formalization Conclusion Our contribute System F < : ’s type language (variable binding, complex induction) logical frameworks based on type theory (LFs): the Calculus of Inductive Constructions , and its Coq implementation management of inductively-defined structures with binders Alberto Ciaffaglione, Ivan Scagnetto A weak HOAS approach to the POPLmark Challenge
Introduction System F < : Formalization Conclusion Our contribute System F < : ’s type language (variable binding, complex induction) logical frameworks based on type theory (LFs): the Calculus of Inductive Constructions , and its Coq implementation management of inductively-defined structures with binders Higher-Order Abstract Syntax (HOAS) Alberto Ciaffaglione, Ivan Scagnetto A weak HOAS approach to the POPLmark Challenge
Introduction System F < : Formalization Conclusion Our contribute System F < : ’s type language (variable binding, complex induction) logical frameworks based on type theory (LFs): the Calculus of Inductive Constructions , and its Coq implementation management of inductively-defined structures with binders Higher-Order Abstract Syntax (HOAS) weak HOAS (second-order term constructors that take as arguments functions over a parametric type of variables) Alberto Ciaffaglione, Ivan Scagnetto A weak HOAS approach to the POPLmark Challenge
Introduction System F < : Formalization Conclusion Our contribute System F < : ’s type language (variable binding, complex induction) logical frameworks based on type theory (LFs): the Calculus of Inductive Constructions , and its Coq implementation management of inductively-defined structures with binders Higher-Order Abstract Syntax (HOAS) weak HOAS (second-order term constructors that take as arguments functions over a parametric type of variables) the Theory of Contexts Alberto Ciaffaglione, Ivan Scagnetto A weak HOAS approach to the POPLmark Challenge
Introduction System F < : Formalization Conclusion Our contribute System F < : ’s type language (variable binding, complex induction) logical frameworks based on type theory (LFs): the Calculus of Inductive Constructions , and its Coq implementation management of inductively-defined structures with binders Higher-Order Abstract Syntax (HOAS) weak HOAS (second-order term constructors that take as arguments functions over a parametric type of variables) the Theory of Contexts we prove the first (of the three) task(s) of the Challenge: transitivity (and narrowing) of algorithmic subtyping Alberto Ciaffaglione, Ivan Scagnetto A weak HOAS approach to the POPLmark Challenge
Introduction System F < : Formalization Conclusion The (pure) type language Alberto Ciaffaglione, Ivan Scagnetto A weak HOAS approach to the POPLmark Challenge
Introduction System F < : Formalization Conclusion The (pure) type language Syntax of types: Type : S , T ::= X type variable Top maximal type S → T function type ∀ X < : S . T universal type Alberto Ciaffaglione, Ivan Scagnetto A weak HOAS approach to the POPLmark Challenge
Introduction System F < : Formalization Conclusion The (pure) type language Syntax of types: Type : S , T ::= X type variable Top maximal type S → T function type ∀ X < : S . T universal type Syntax of type environments: Γ , Γ ′ Env : ::= ∅ empty type environment Γ ′ , X < : T type variable binding (with scoping discipline) Alberto Ciaffaglione, Ivan Scagnetto A weak HOAS approach to the POPLmark Challenge
Introduction System F < : Formalization Conclusion Algorithmic subtyping (for well-scoped types) Alberto Ciaffaglione, Ivan Scagnetto A weak HOAS approach to the POPLmark Challenge
Introduction System F < : Formalization Conclusion Algorithmic subtyping (for well-scoped types) Subtyping: Γ ⊢ S < : Top ( Top ) Γ ⊢ X < : X ( Refl ) X < : U ∈ Γ Γ ⊢ U < : T ( Trans ) Γ ⊢ X < : T Γ ⊢ T 1 < : S 1 Γ ⊢ S 2 < : T 2 ( Arr ) Γ ⊢ S 1 → S 2 < : T 1 → T 2 Γ ⊢ T 1 < : S 1 Γ , X < : T 1 ⊢ S 2 < : T 2 ( All ) Γ ⊢ ∀ X < : S 1 . S 2 < : ∀ X < : T 1 . T 2 Alberto Ciaffaglione, Ivan Scagnetto A weak HOAS approach to the POPLmark Challenge
Introduction System F < : Formalization Conclusion Algorithmic subtyping (for well-scoped types) Subtyping: Γ ⊢ S < : Top ( Top ) Γ ⊢ X < : X ( Refl ) X < : U ∈ Γ Γ ⊢ U < : T ( Trans ) Γ ⊢ X < : T Γ ⊢ T 1 < : S 1 Γ ⊢ S 2 < : T 2 ( Arr ) Γ ⊢ S 1 → S 2 < : T 1 → T 2 Γ ⊢ T 1 < : S 1 Γ , X < : T 1 ⊢ S 2 < : T 2 ( All ) Γ ⊢ ∀ X < : S 1 . S 2 < : ∀ X < : T 1 . T 2 Proposition 1 (Transitivity and Narrowing) Γ ⊢ S < : Q ∧ Γ ⊢ Q < : T ⇒ Γ ⊢ S < : T Γ , X < : Q , ∆ ⊢ M < : N ∧ Γ ⊢ P < : Q ⇒ Γ , X < : P , ∆ ⊢ M < : N Proof: By (outer) induction on Q . Alberto Ciaffaglione, Ivan Scagnetto A weak HOAS approach to the POPLmark Challenge
Introduction System F < : Formalization Conclusion Transitivity and Narrowing Alberto Ciaffaglione, Ivan Scagnetto A weak HOAS approach to the POPLmark Challenge
Introduction System F < : Formalization Conclusion Transitivity and Narrowing Transitivity: by inner induction on the derivation Γ ⊢ S < : Q . . . . . . . . . . . . Γ ⊢ Q 1 < : S 1 Γ , X < : Q 1 ⊢ S 2 < : Q 2 Γ ⊢ T 1 < : Q 1 Γ , X < : T 1 ⊢ Q 2 < : T 2 Γ ⊢ ∀ X < : S 1 . S 2 < : ∀ X < : Q 1 . Q 2 Γ ⊢ ∀ X < : Q 1 . Q 2 < : ∀ X < : T 1 . T 2 To conclude (via the (All) rule): Alberto Ciaffaglione, Ivan Scagnetto A weak HOAS approach to the POPLmark Challenge
Introduction System F < : Formalization Conclusion Transitivity and Narrowing Transitivity: by inner induction on the derivation Γ ⊢ S < : Q . . . . . . . . . . . . Γ ⊢ Q 1 < : S 1 Γ , X < : Q 1 ⊢ S 2 < : Q 2 Γ ⊢ T 1 < : Q 1 Γ , X < : T 1 ⊢ Q 2 < : T 2 Γ ⊢ ∀ X < : S 1 . S 2 < : ∀ X < : Q 1 . Q 2 Γ ⊢ ∀ X < : Q 1 . Q 2 < : ∀ X < : T 1 . T 2 To conclude (via the (All) rule): Γ ⊢ T 1 < : S 1 1 Alberto Ciaffaglione, Ivan Scagnetto A weak HOAS approach to the POPLmark Challenge
Recommend
More recommend