1 / 24

Mechanizing Metatheory without Typing Contexts

Mechanizing Metatheory without Typing Contexts. Jonghyun Park, Jeongbong Seo, Sungwoo Park, Gyesik Lee* Pohang University of Science and Technology, Korea Hankyong National University, Korea*. TYPES 2011 September 10, 2011. Mechanizing Metatheory.

Télécharger la présentation

Mechanizing Metatheory without Typing Contexts

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Mechanizing Metatheory without Typing Contexts Jonghyun Park, Jeongbong Seo, Sungwoo Park, Gyesik Lee* Pohang University of Science and Technology, Korea Hankyong National University, Korea* TYPES 2011 September 10, 2011

  2. Mechanizing Metatheory • Formalizing metatheory using proof assistants • POPLmark Challenge for mechanizing System F<:

  3. Techniques for Facilitating Mechanization • Representing binders • de Bruijn indexes • locally named/nameless representation • free parameters and bound variables • nominal representation • higher-order abstract syntax • Quantifying variables • exists-fresh/for-all quantification • cofinite quantification • eliminates renaming lemmas

  4. Structural Lemmas • Due to the use of typing contexts • Examples • Often used without proofs in pencil-and-paper proofs • Must be proved in mechanized proofs • The whole development becomes more complex.

  5. Entailments vs Hypothetical Proofs • Entailment relations • syntactic representations of hypothetical proofs • display only hypotheses and conclusion • hide internal structures • Hypothetical proofs • no structural lemmas necessary • suitable for mechanized proofs

  6. Eliminating Typing Contexts • Use the locally nameless/named representation • bound variables: with binders • free parameters: without binders • Convert bindings in typing contexts to annotations of free parameters

  7. System F>: with Typing Contexts • Definitions • Judgments • Type safety

  8. System F>: without Typing Contexts • Definitions • annotate every type parameter with its supertype • annotate every term parameter with its type • Judgments

  9. Unbound Type Variables in Annotations? • Examples • Local closure • Substitutions (propagated into annotations) ) Source of all serious complications

  10. No Unbound Type Variables in Annotations 1. Local closure 2. Substitutions(no propagation) 3. Rules • Cf. Parameter substitution

  11. Simpler Lemmas • With typing contexts • In the proof, we need to show: • Without typing contexts

  12. No Need for Unusual Tricks • With typing contexts (renaming lemma) • need to show: • strengthening followed by weakening??? • No, because weakening itself requires renaming. • Without typing contexts: no such complication

  13. Type Safety

  14. If Unbound Type Variables in Annotations • Need two lemmas: • Impossible to prove

  15. Equivalence between the Two Systems • The proof is far from straightforward: • What is your view? 1. You need to prove the equivalence. 2. You don't need to prove the equivalence.

  16. Coq Developments for POPLmark (1A and 2A) • Representing binders • locally named/nameless • Quantifying variables • exists-fresh, cofinite • Consistent programming style

  17. Analysis of the Complexity • Eliminating typing contexts is more effective than the cofinite quantification.

  18. Related Work: PTSs with Explicit Contexts (Geuvers et al '10) • The key idea is the same: • distinguish between parameters and variables • annotate every parameter with its type • Variable substitutions are not propagated into annotations of parameters. • Main theorem: correspondence between the two type systems • Substantiates our work, and vice versa

  19. Conclusion • Three guidelines when eliminating typing contexts 1. all annotations of parameters are locally closed 2. do not propagate variable substitutions into annotations of parameters 3. typing rules generate parameters with locally closed annotations • A case study confirms the validity of the guidelines • System F extended with linear types (Mazurak et al '10) • Simple, yet as effective as cofinite quantification!

  20. http://pl.postech.ac.kr/poplmark/Thank you.

  21. Operational Semantics

  22. Equivalence between the Two Systems

More Related