Mechanizing Metatheory without Typing Contexts TYPES 2011 September 10, 2011 Jonghyun Park, Jeongbong Seo, Sungwoo Park, Gyesik Lee* Pohang University.

Slides:



Advertisements
Similar presentations
Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Advertisements

Types and Programming Languages Lecture 7 Simon Gay Department of Computing Science University of Glasgow 2006/07.
Substitution & Evaluation Order cos 441 David Walker.
SLD-resolution Introduction Most general unifiers SLD-resolution
Certified Typechecking in Foundational Certified Code Systems Susmit Sarkar Carnegie Mellon University.
Constraint Semantics for Abstract Read Permissions 28 th July 2014, FTfJP, Uppsala John Tang Boyland (UW-Milwaukee/ETH Zurich) Peter Müller, Malte Schwerhoff,
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
Artificial Intelligence
Formal Semantics of Programming Languages 虞慧群 Topic 5: Axiomatic Semantics.
Semantics Syntax Lunch: Strongly-typed term representations in Coq Andrew Kennedy Microsoft Research Cambridge TexPoint fonts used in EMF. Read the TexPoint.
CLF: A Concurrent Logical Framework David Walker Princeton (with I. Cervesato, F. Pfenning, K. Watkins)
Advanced Formal Methods Lecture 6: Isabelle - HOL Mads Dam KTH/CSC Course 2D1453, Material from L. Paulson.
Some Thoughts on Data Representation 47th IETF AAAarch Research Group David Spence Merit Network, Inc.
Lecture 19 Exam: Tuesday June14 4-6pm Overview. Disclaimer The following is a only study guide. You need to know all the material treated in class.
Exam #3 is Friday. It will consist of proofs, plus symbolizations in predicate logic.
Parametric Polymorphism COS 441 Princeton University Fall 2004.
Twelf: The Quintessential Proof Assistant for Language Metatheory Karl Crary Carnegie Mellon University Joint work with Robert Harper and Michael Ashley-Rollman.
All rights reservedL. Manevitz Lecture 41 Artificial Intelligence Logic L. Manevitz.
POPLmark 1A in Cinic Evan Austin, Aaron Stump, and Edwin Westbrook 1.
Strict Bidirectional Type Checking Adam Chlipala, Leaf Petersen, and Robert Harper.
Logical Properties of CPS Transforms Deepak Garg Fall, 2004.
Chair of Software Engineering 1 Concurrent Object-Oriented Programming Arnaud Bailly, Bertrand Meyer and Volkan Arslan.
Administrative stuff On Thursday, we will start class at 11:10, and finish at 11:55 This means that each project will get a 10 minute presentation + 5.
Lecture 19 Exam: Tuesday June15 4-6pm Overview. General Remarks Expect more questions than before that test your knowledge of the material. (rather then.
1 Ivan Lanese Computer Science Department University of Bologna Italy Concurrent and located synchronizations in π-calculus.
1 Explicit Contexts in LF Karl Crary Carnegie Mellon University Workshop on Mechanized Metatheory, 9/21/06.
Proof by Deduction. Deductions and Formal Proofs A deduction is a sequence of logic statements, each of which is known or assumed to be true A formal.
Mechanized Metatheory for User- Defined Type Extensions Dan Marino, Brian Chin, Todd Millstein UCLA Gang Tan Boston College Robert J. Simmons, David Walker.
Objective: You will learn how to convert a decimal to a percent and vice versa by applying your knowledge of how to name a decimal number.
A Theory of Hygienic Macros PhD Thesis Proposal David Herman.
Knowledge and Tree-Edits in Learnable Entailment Proofs Asher Stern, Amnon Lotan, Shachar Mirkin, Eyal Shnarch, Lili Kotlerman, Jonathan Berant and Ido.
A Modal Language for the Safety of Mobile Values (work in progress) SNU 4/7/2006 박성우 Sungwoo Park POSTECH.
Typed Lambda Calculus Chapter 9 Benjamin Pierce Types and Programming Languages.
Chapter Twenty-ThreeModern Programming Languages1 Formal Semantics.
Verification and Validation in the Context of Domain-Specific Modelling Janne Merilinna.
A Theory of Hygienic Macros David Herman, Mitchell Wand Northeastern University.
1 Knowledge Representation. 2 Definitions Knowledge Base Knowledge Base A set of representations of facts about the world. A set of representations of.
A Locally Nameless Theory of Objects 1.Introduction:  -calculus and De Bruijn notation 2.locally nameless technique 3.formalization in Isabelle and proofs.
Formal Semantics Chapter Twenty-ThreeModern Programming Languages, 2nd ed.1.
Type Safety Kangwon National University 임현승 Programming Languages.
Logic in Computer Science - Overview Sep 1, 2009 박성우.
1 Formal Semantics. 2 Why formalize? ML is tricky, particularly in corner cases generalizable type variables? polymorphic references? exceptions? Some.
ASPfun: A Distributed Object Calculus and its Formalization in Isabelle Work realized in collaboration with Florian Kammüller and Henry Sudhof (Technische.
1 Finite Model Theory Lecture 3 Ehrenfeucht-Fraisse Games.
Non-interference in Constructive Authorization Logic Deepak Garg and Frank Pfenning Carnegie Mellon University.
Implementing a Dependently Typed λ -Calculus Ali Assaf Abbie Desrosiers Alexandre Tomberg.
CS 285- Discrete Mathematics Lecture 4. Section 1.3 Predicate logic Predicate logic is an extension of propositional logic that permits concisely reasoning.
Lesson 3 Formalizing and Implementing Pure Lambda Calculus 1/15/02 Chapters 5.3, 6, 7.
CSSE501 Object-Oriented Development. Chapter 10: Subclasses and Subtypes  In this chapter we will explore the relationships between the two concepts.
A Mechanized Model of the Theory of Objects 1.Functional  -calculus in Isabelle 2.Confluence Proof in Isabelle 3.Ongoing Work, Applications, Conclusion.
Faithful mapping of model classes to mathematical structures Ádám Darvas ETH Zürich Switzerland Peter Müller Microsoft Research Redmond, WA, USA SAVCBS.
A Theory of Hygienic Macros David Herman Northeastern University.
CSE-321 Programming Languages Abstract Machine E POSTECH May 1, 2006 박성우.
PPL Syntax & Formal Semantics Lecture Notes: Chapter 2.
Towards a Semantic Model for Java Wildcards Sophia Drossopoulou Mariangiola Dezani-Ciancaglini Imperial College London Università di Torino Italy Nicholas.
Advanced Science and Technology Letters Vol.41 (Mechanical Engineering 2013), pp Two Recent Approaches.
1 A Certified Type-Preserving Compiler from Lambda Calculus to Assembly Language Adam Chlipala University of California, Berkeley An experiment with variable.
Mostly-Automated Verification of Low-Level Programs in Computational Separation Logic Adam Chlipala Harvard University PLDI 2011.
1 Interactive Computer Theorem Proving CS294-9 November 30, 2006 Adam Chlipala UC Berkeley Lecture 14: Twelf.
Comparing Universes and Existential Ownership Types Nicholas Cameron Werner Dietl ETH Zurich Victoria University of Wellington.
Comp 411 Principles of Programming Languages Lecture 3 Parsing
Generic Programming and Proving for Programming Language Metatheory
Formal Logic CSC 333.
CS 611: Lecture 9 More Lambda Calculus: Recursion, Scope, and Substitution September 17, 1999 Cornell University Computer Science Department Andrew Myers.
A Verified Compiler for an Impure Functional Language
Engineering Aspects of Formal Metatheory
CHAPTER 2 Context-Free Languages
Background In his classic 1972 paper on definitional interpreters, John Reynolds introduced two key techniques: Continuation-passing style - Makes.
CS 611: Lecture 10 More Lambda Calculus September 20, 1999
CS 611: Lecture 10 More Lambda Calculus September 20, 1999
Presentation transcript:

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

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!

Thank you.

21 Operational Semantics

22

23

24 Equivalence between the Two Systems