160 likes | 256 Views
Roadmap to Atsushi Ohori’s “ A Simple Semantics for ML Polymorphism ”. Bill Harrison. ML polymorphism. Can apply polymorphic term for any type a. Know what it denotes at any instance…. …from the semantics of simply-typed - calculus. Ohori’s idea: simple semantics.
E N D
Roadmap to Atsushi Ohori’s“A Simple Semantics for ML Polymorphism” Bill Harrison
ML polymorphism Can apply polymorphic term for any type a Know what it denotes at any instance… …from the semantics of simply-typed -calculus
Ohori’s idea: simple semantics Starting from the semantics of STLC: …extend it to ML-like languages from simply-typed -calculus semantics
Simple vs ? • An alternative [DamasMilner82] is to model type quantifiers with type abstraction as in System F[Girard,Reynolds] • However, this has drawbacks as the denotational semantics of System F is, well, hairy[GirardLafontTaylor]
Semantics of Core-ML Semantics of Ground Core-ML Semantics Simply-typed T Overview of Ohori’s approach Introduce two languages • Core-ML: polymorphic, implicitly-typed -calculus • T: simply & explicitly-typed -calculus with “textbook” denotational • semantics …and define Core-ML in terms of T
Today • Core-ML: syntactic matters • T: its syntax & semantics • In terms of frame models • Relating Core-ML to T • “Roadmap’’ handout contains the technical minutiae of the paper • Laid out in a more logical manner • Ohori’s paper is rich with material I won’t discuss today: • Comparisons with [Milner78,DamasMilner82], full abstraction, extensions to recursive terms & datatypes
Core-ML types Types & Type Schemes Type assignments Type assignment schemes Substitutions
Core-ML terms Raw terms Typings any ground judgment derivable in: Core-ML terms are typing schemes
Type system Note the different “” T terms Preterms explicit typing
Denotational semantics of T This is a completely conventional, “textbook” semantics
Relating Core-ML to T Translation from Core-ML typings to T …with the following coherence property: * Consequence of Theorem 6, Section 3.2, of Ohori89
Just two more auxiliary definitions (I promise) The set of admissible type assignments under is E.g., The set of types associated with a term is: N.b.,
Denotational Semantics of Core-ML Terms: Typings:
Conclusions • Simple & intuitive: make a polymorphic term denote the set of its ground instance denotations • Avoids the pitfalls of “backwards” explanations: ML polymorphism is simpler than System F, so its semantics should be simpler