Pure Subtype Systems: a Type Theory for Extensible Software

Total Page:16

File Type:pdf, Size:1020Kb

Pure Subtype Systems: a Type Theory for Extensible Software Pure Subtype Systems: A Type Theory for Extensible Software DeLesley Hutchins I V N E R U S E I T H Y T O H F G E R D I N B U Doctor of Philosophy Laboratory for Foundations of Computer Science School of Informatics University of Edinburgh 2009 Abstract This thesis presents a novel approach to type theory called “pure subtype systems”, and a core calculus called DEEP which is based on that approach. DEEP is capable of modeling a number of interesting language techniques that have been proposed in the literature, including mixin modules, virtual classes, feature-oriented programming, and partial evaluation. The design of DEEP was motivated by two well-known problems: “the expression problem”, and “the tag elimination problem.” The expression problem is concerned with the design of an interpreter that is extensible, and requires an advanced module system. The tag elimination problem is concerned with the design of an interpreter that is efficient, and requires an advanced partial evaluator. We present a solution in DEEP that solves both problems simultaneously, which has never been done before. These two problems serve as an “acid test” for advanced type theories, because they make heavy demands on the static type system. Our solution in DEEP makes use of the following capabilities. (1) Virtual types are type definitions within a module that can be extended by clients of the module. (2) Type definitions may be mutually recursive. (3) Higher-order subtyping and bounded quantification are used to represent partial information about types. (4) Dependent types and singleton types provide increased type precision. The combination of recursive types, virtual types, dependent types, higher-order subtyping, and bounded quantification is highly non-trivial. We introduce “pure sub- type systems” as a way of managing this complexity. Pure subtype systems eliminate the distinction between types and objects; every term can behave as either a type or an object depending on context. A subtype relation is defined over all terms, and sub- typing, rather than typing, forms the basis of the theory. We show that higher-order subtyping is strong enough to completely subsume the traditional type relation, and we provide practical algorithms for type checking and for finding minimal types. The cost of using pure subtype systems lies in the complexity of the meta-theory. Unfortunately, we are unable to establish some basic meta-theoretic properties, such as type safety and transitivity elimination, although we have made some progress towards these goals. We formulate the subtype relation as an abstract reduction system, and we show that the type theory is sound if the reduction system is confluent. We can prove that reductions are locally confluent, but a proof of global confluence remains elusive. In summary, pure subtype systems represent a new and interesting approach to type theory. This thesis describes the basic properties of pure subtype systems, and provides concrete examples of how they can be applied. The Deep calculus demon- strates that our approach has a number of real-world practical applications in areas that have proved to be quite difficult for traditional type theories to handle. However, the ultimate soundness of the technique remains an open question. iii Acknowledgements I would first of all like to thank my supervisor, Philip Wadler, for all the help that he has given me during my time here at the University of Edinburgh. Phil was not always convinced that my approach to type theory was the right one to take, and his initial skepticism has turned out to be well-founded in many respects. However, he was willing to give me the freedom to pursue my own path, and make my own discoveries and mistakes. Yet Phil did not just leave to my own devices; he was always there to discuss my ideas, read my drafts, send me pointers to seminars, talks, and related work, and offer suggestions for improvement. I am very grateful for his input. I would also like to thank the two examiners for my thesis, David Aspinall and Joe Wells, for taking the time to go through this entire document with a fine-toothed comb. David and Joe have really helped me to improve the thesis, by pointing out everything from minor corrections to major clarifications. In addition, I would like to thank Dave Robertson, my second supervisor, for his help and support. Dave was always there to provide encouragement, advice, and a sympathetic ear. My heartfelt thanks go out too to Bob Praus and Steve Coy of MZA Associates Corporation. I was employed by MZA before starting my PhD, and many of the ideas in this thesis were inspired by work that I initially did for the company. When I de- cided to pursue those ideas further in grad school, MZA generously offered to fund my research. Without their financial support, this work would never have been possible. As with any scientist, I have been encouraged and supported by many people in the research community in which I work. Don Batory proofread drafts of several pa- pers and offered many suggestions. William Cook championed my first major publi- cation at OOPSLA. Sven Apel worked with me as a coauthor on applications of the DEEP calculus. Conor McBride sat down with me to explain the mysterious world of dependently-typed pattern matching. Benjamin Pierce was there to answer several questions on the more subtle aspects of subtyping. Vincent Van Oostrom helped me work through the confluence proofs at the core of System lC. Randy Pollack helped me with my proof techniques, and mechanically verified some of my proofs. I’m sure that there are others that I have forgotten to mention; my thanks go out to them as well. In addition, I would like to thank my mother for being there for me during my studies. She was the one who initially suggested that I go back to school, and then was shocked when I announced that I would be moving across the Atlantic to pursue a degree in Scotland. But she saved my mail for me, stored my possessions, and spoke to me across the miles with a friendly voice and encouraging words in phone and e-mail. Last but not certainly not least, I offer grateful thanks to my wife, Laura, who has been my constant companion throughout my PhD. We met within days of my arrival in Edinburgh, fell in love, got engaged, and then got married, in what was almost a storybook romance. She has helped motivate me when I needed it, propped me up when I was down, and has shared both my triumphs and my disappointments. Her love and commitment has kept me going; I couldn’t have done this without her. iv Declaration I declare that this thesis was composed by myself, that the work contained herein is my own except where explicitly stated otherwise in the text, and that this work has not been submitted for any other degree or professional qualification except as specified. (DeLesley Hutchins) v Table of Contents 1 Introduction 1 1.1 A tale of two problems . 1 1.1.1 Pure subtype systems . 3 1.2 The expression problem . 4 1.2.1 The expression problem: OO style . 5 1.2.2 The expression problem: functional programming style . 6 1.2.3 The solution: late-binding for types . 7 1.2.4 The solution: functional programming style . 9 1.2.5 Type system requirements . 10 1.3 Doman specific languages and tag-elimination . 11 1.3.1 Performance and optimization . 12 1.3.2 Partial evaluation . 13 1.3.3 The tag-elimination problem . 13 1.3.4 Well-typed interpreters . 15 1.4 Putting it together: the DSL expression problem . 15 1.5 Pure subtype systems . 16 1.6 Types and Objects . 17 1.6.1 Symmetry . 17 1.6.2 Dependent types . 19 1.6.3 Modules . 20 1.6.4 Classes and Prototypes . 21 1.7 Subtyping . 22 1.7.1 Subtyping: a substitute for typing . 23 1.7.2 Interpretation of types and objects . 24 1.7.3 A spectrum of type information . 25 1.7.4 Combining typing and partial evaluation . 26 1.8 Outline of thesis . 26 1.8.1 Outline of individual chapters . 27 2 Pure Subtype Systems 29 2.1 Introduction . 29 w 2.2 Comparison to System F≤ and Pure Type Systems . 31 2.2.1 Deconstructing the typing judgment . 32 2.2.2 Bounded quantification and Top-types . 33 2.3 System lC ................................ 35 2.3.1 Subtyping . 37 vii 2.3.2 Well-formedness . 38 2.3.3 Example: 3 ≤ Nat ....................... 38 2.3.4 Adding Universes . 39 2.4 Embeddings of other languages into System lC . 40 2.4.1 Embedding of System F≤ ................... 41 2.4.2 Symmetry in theories: an analogy with physics . 44 2.4.3 Embedding of l∗, the pure type system with ∗ : ∗ . 46 2.4.4 Logical consistency and Girard’s paradox . 48 2.4.5 Impredicativity . 49 2.5 Type Safety . 50 2.5.1 Basic meta-theoretic properties . 50 2.5.2 The easy part of type safety . 52 2.5.3 The trouble with transitivity . 54 2.5.4 Transitivity elimination . 55 2.6 Algorithmic Subtyping . 56 2.6.1 Transitivity and Confluence . 59 2.6.2 Subtyping as a syntactic relation . 62 2.6.3 Conditional rewrite systems . 63 2.6.4 Basic meta-theory of algorithmic subtyping . 65 2.6.5 Equivalence of declarative and algorithmic subtyping. 67 2.7 Confluence and commutativity . 70 2.7.1 An overview of confluence properties and proofs .
Recommended publications
  • Structured Recursion for Non-Uniform Data-Types
    Structured recursion for non-uniform data-types by Paul Alexander Blampied, B.Sc. Thesis submitted to the University of Nottingham for the degree of Doctor of Philosophy, March 2000 Contents Acknowledgements .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 1 Chapter 1. Introduction .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 2 1.1. Non-uniform data-types .. .. .. .. .. .. .. .. .. .. .. .. 3 1.2. Program calculation .. .. .. .. .. .. .. .. .. .. .. .. .. 10 1.3. Maps and folds in Squiggol .. .. .. .. .. .. .. .. .. .. .. 11 1.4. Related work .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 14 1.5. Purpose and contributions of this thesis .. .. .. .. .. .. .. 15 Chapter 2. Categorical data-types .. .. .. .. .. .. .. .. .. .. .. .. 18 2.1. Notation .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 19 2.2. Data-types as initial algebras .. .. .. .. .. .. .. .. .. .. 21 2.3. Parameterized data-types .. .. .. .. .. .. .. .. .. .. .. 29 2.4. Calculation properties of catamorphisms .. .. .. .. .. .. .. 33 2.5. Existence of initial algebras .. .. .. .. .. .. .. .. .. .. .. 37 2.6. Algebraic data-types in functional programming .. .. .. .. 57 2.7. Chapter summary .. .. .. .. .. .. .. .. .. .. .. .. .. 61 Chapter 3. Folding in functor categories .. .. .. .. .. .. .. .. .. .. 62 3.1. Natural transformations and functor categories .. .. .. .. .. 63 3.2. Initial algebras in functor categories .. .. .. .. .. .. .. .. 68 3.3. Examples and non-examples .. .. .. .. .. .. .. .. .. .. 77 3.4. Existence of initial algebras in functor categories .. .. .. .. 82 3.5.
    [Show full text]
  • First Class Overloading Via Insersection Type Parameters⋆
    First Class Overloading via Insersection Type Parameters? Elton Cardoso2, Carlos Camar~ao1, and Lucilia Figueiredo2 1 Universidade Federal de Minas Gerais, [email protected] 2 Universidade Federal de Ouro Preto [email protected], [email protected] Abstract The Hindley-Milner type system imposes the restriction that function parameters must have monomorphic types. Lifting this restric- tion and providing system F “first class" polymorphism is clearly desir- able, but comes with the difficulty that inference of types for system F is undecidable. More practical type systems incorporating types of higher- rank have recently been proposed, that rely on system F but require type annotations for the definition of functions with polymorphic type parameters. However, these type annotations inevitably disallow some possible uses of higher-rank functions. To avoid this problem and to pro- mote code reuse, we explore using intersection types for specifying the types of function parameters that are used polymorphically inside the function body, allowing a flexible use of such functions, on applications to both polymorphic or overloaded arguments. 1 Introduction The Hindley-Milner type system [9] (HM) has been successfuly used as the basis for type systems of modern functional programming languages, such as Haskell [23] and ML [20]. This is due to its remarkable properties that a compiler can in- fer the principal type for any language expression, without any help from the programmer, and the type inference algorithm [5] is relatively simple. This is achieved, however, by imposing some restrictions, a major one being that func- tion parameters must have monomorphic types. For example, the following definition is not allowed in the HM type system: foo g = (g [True,False], g ['a','b','c']) Since parameter g is used with distinct types in the function's body (being applied to both a list of booleans and a list of characters), its type cannot be monomorphic, and this definition of foo cannot thus be typed in HM.
    [Show full text]
  • Disjoint Polymorphism
    Disjoint Polymorphism João Alpuim, Bruno C. d. S. Oliveira, and Zhiyuan Shi The University of Hong Kong {alpuim,bruno,zyshi}@cs.hku.hk Abstract. The combination of intersection types, a merge operator and parametric polymorphism enables important applications for program- ming. However, such combination makes it hard to achieve the desirable property of a coherent semantics: all valid reductions for the same expres- sion should have the same value. Recent work proposed disjoint inter- sections types as a means to ensure coherence in a simply typed setting. However, the addition of parametric polymorphism was not studied. This paper presents Fi: a calculus with disjoint intersection types, a vari- ant of parametric polymorphism and a merge operator. Fi is both type- safe and coherent. The key difficulty in adding polymorphism is that, when a type variable occurs in an intersection type, it is not statically known whether the instantiated type will be disjoint to other compo- nents of the intersection. To address this problem we propose disjoint polymorphism: a constrained form of parametric polymorphism, which allows disjointness constraints for type variables. With disjoint polymor- phism the calculus remains very flexible in terms of programs that can be written, while retaining coherence. 1 Introduction Intersection types [20,43] are a popular language feature for modern languages, such as Microsoft’s TypeScript [4], Redhat’s Ceylon [1], Facebook’s Flow [3] and Scala [37]. In those languages a typical use of intersection types, which has been known for a long time [19], is to model the subtyping aspects of OO-style multiple inheritance.
    [Show full text]
  • Polymorphic Intersection Type Assignment for Rewrite Systems with Abstraction and -Rule Extended Abstract
    Polymorphic Intersection Type Assignment for Rewrite Systems with Abstraction and -rule Extended Abstract Steffen van Bakel , Franco Barbanera , and Maribel Fernandez´ Department of Computing, Imperial College, 180 Queen’s Gate, London SW7 2BZ. [email protected] Dipartimento di Matematica, Universita` degli Studi di Catania, Viale A. Doria 6, 95125 Catania, Italia. [email protected] LIENS (CNRS URA 8548), Ecole Normale Superieure,´ 45, rue d’Ulm, 75005 Paris, France. [email protected] Abstract. We define two type assignment systems for first-order rewriting ex- tended with application, -abstraction, and -reduction (TRS ). The types used in these systems are a combination of ( -free) intersection and polymorphic types. The first system is the general one, for which we prove a subject reduction theorem and show that all typeable terms are strongly normalisable. The second is a decidable subsystem of the first, by restricting types to Rank 2. For this sys- tem we define, using an extended notion of unification, a notion of principal type, and show that type assignment is decidable. Introduction The combination of -calculus (LC) and term rewriting systems (TRS) has attracted attention not only from the area of programming language design, but also from the rapidly evolving field of theorem provers. It is well-known by now that type disciplines provide an environment in which rewrite rules and -reduction can be combined with- out loss of their useful properties. This is supported by a number of results for a broad range of type systems [11, 12, 20, 7, 8, 5]. In this paper we study the combination of LC and TRS as a basis for the design of a programming language.
    [Show full text]
  • Binary Search Trees
    Introduction Recursive data types Binary Trees Binary Search Trees Organizing information Sum-of-Product data types Theory of Programming Languages Computer Science Department Wellesley College Introduction Recursive data types Binary Trees Binary Search Trees Table of contents Introduction Recursive data types Binary Trees Binary Search Trees Introduction Recursive data types Binary Trees Binary Search Trees Sum-of-product data types Every general-purpose programming language must allow the • processing of values with different structure that are nevertheless considered to have the same “type”. For example, in the processing of simple geometric figures, we • want a notion of a “figure type” that includes circles with a radius, rectangles with a width and height, and triangles with three sides: The name in the oval is a tag that indicates which kind of • figure the value is, and the branches leading down from the oval indicate the components of the value. Such types are known as sum-of-product data types because they consist of a sum of tagged types, each of which holds on to a product of components. Introduction Recursive data types Binary Trees Binary Search Trees Declaring the new figure type in Ocaml In Ocaml we can declare a new figure type that represents these sorts of geometric figures as follows: type figure = Circ of float (* radius *) | Rect of float * float (* width, height *) | Tri of float * float * float (* side1, side2, side3 *) Such a declaration is known as a data type declaration. It consists of a series of |-separated clauses of the form constructor-name of component-types, where constructor-name must be capitalized.
    [Show full text]
  • Recursive Type Generativity
    Recursive Type Generativity Derek Dreyer Toyota Technological Institute at Chicago [email protected] Abstract 1. Introduction Existential types provide a simple and elegant foundation for un- Recursive modules are one of the most frequently requested exten- derstanding generative abstract data types, of the kind supported by sions to the ML languages. After all, the ability to have cyclic de- the Standard ML module system. However, in attempting to extend pendencies between different files is a feature that is commonplace ML with support for recursive modules, we have found that the tra- in mainstream languages like C and Java. To the novice program- ditional existential account of type generativity does not work well mer especially, it seems very strange that the ML module system in the presence of mutually recursive module definitions. The key should provide such powerful mechanisms for data abstraction and problem is that, in recursive modules, one may wish to define an code reuse as functors and translucent signatures, and yet not allow abstract type in a context where a name for the type already exists, mutually recursive functions and data types to be broken into sepa- but the existential type mechanism does not allow one to do so. rate modules. Certainly, for simple examples of recursive modules, We propose a novel account of recursive type generativity that it is difficult to convincingly argue why ML could not be extended resolves this problem. The basic idea is to separate the act of gener- in some ad hoc way to allow them. However, when one considers ating a name for an abstract type from the act of defining its under- the semantics of a general recursive module mechanism, one runs lying representation.
    [Show full text]
  • Cross-Platform Language Design
    Cross-Platform Language Design THIS IS A TEMPORARY TITLE PAGE It will be replaced for the final print by a version provided by the service academique. Thèse n. 1234 2011 présentée le 11 Juin 2018 à la Faculté Informatique et Communications Laboratoire de Méthodes de Programmation 1 programme doctoral en Informatique et Communications École Polytechnique Fédérale de Lausanne pour l’obtention du grade de Docteur ès Sciences par Sébastien Doeraene acceptée sur proposition du jury: Prof James Larus, président du jury Prof Martin Odersky, directeur de thèse Prof Edouard Bugnion, rapporteur Dr Andreas Rossberg, rapporteur Prof Peter Van Roy, rapporteur Lausanne, EPFL, 2018 It is better to repent a sin than regret the loss of a pleasure. — Oscar Wilde Acknowledgments Although there is only one name written in a large font on the front page, there are many people without which this thesis would never have happened, or would not have been quite the same. Five years is a long time, during which I had the privilege to work, discuss, sing, learn and have fun with many people. I am afraid to make a list, for I am sure I will forget some. Nevertheless, I will try my best. First, I would like to thank my advisor, Martin Odersky, for giving me the opportunity to fulfill a dream, that of being part of the design and development team of my favorite programming language. Many thanks for letting me explore the design of Scala.js in my own way, while at the same time always being there when I needed him.
    [Show full text]
  • Blossom: a Language Built to Grow
    Macalester College DigitalCommons@Macalester College Mathematics, Statistics, and Computer Science Honors Projects Mathematics, Statistics, and Computer Science 4-26-2016 Blossom: A Language Built to Grow Jeffrey Lyman Macalester College Follow this and additional works at: https://digitalcommons.macalester.edu/mathcs_honors Part of the Computer Sciences Commons, Mathematics Commons, and the Statistics and Probability Commons Recommended Citation Lyman, Jeffrey, "Blossom: A Language Built to Grow" (2016). Mathematics, Statistics, and Computer Science Honors Projects. 45. https://digitalcommons.macalester.edu/mathcs_honors/45 This Honors Project - Open Access is brought to you for free and open access by the Mathematics, Statistics, and Computer Science at DigitalCommons@Macalester College. It has been accepted for inclusion in Mathematics, Statistics, and Computer Science Honors Projects by an authorized administrator of DigitalCommons@Macalester College. For more information, please contact [email protected]. In Memory of Daniel Schanus Macalester College Department of Mathematics, Statistics, and Computer Science Blossom A Language Built to Grow Jeffrey Lyman April 26, 2016 Advisor Libby Shoop Readers Paul Cantrell, Brett Jackson, Libby Shoop Contents 1 Introduction 4 1.1 Blossom . .4 2 Theoretic Basis 6 2.1 The Potential of Types . .6 2.2 Type basics . .6 2.3 Subtyping . .7 2.4 Duck Typing . .8 2.5 Hindley Milner Typing . .9 2.6 Typeclasses . 10 2.7 Type Level Operators . 11 2.8 Dependent types . 11 2.9 Hoare Types . 12 2.10 Success Types . 13 2.11 Gradual Typing . 14 2.12 Synthesis . 14 3 Language Description 16 3.1 Design goals . 16 3.2 Type System . 17 3.3 Hello World .
    [Show full text]
  • Rank 2 Type Systems and Recursive De Nitions
    Rank 2 typ e systems and recursive de nitions Technical Memorandum MIT/LCS/TM{531 Trevor Jim Lab oratory for Computer Science Massachusetts Institute of Technology August 1995; revised Novemb er 1995 Abstract We demonstrate an equivalence b etween the rank 2 fragments of the p olymorphic lamb da calculus System F and the intersection typ e dis- cipline: exactly the same terms are typable in each system. An imme- diate consequence is that typability in the rank 2 intersection system is DEXPTIME-complete. Weintro duce a rank 2 system combining intersections and p olymorphism, and prove that it typ es exactly the same terms as the other rank 2 systems. The combined system sug- gests a new rule for typing recursive de nitions. The result is a rank 2 typ e system with decidable typ e inference that can typ e some inter- esting examples of p olymorphic recursion. Finally,we discuss some applications of the typ e system in data representation optimizations suchasunboxing and overloading. Keywords: Rank 2 typ es, intersection typ es, p olymorphic recursion, boxing/unboxing, overloading. 1 Intro duction In the past decade, Milner's typ e inference algorithm for ML has b ecome phenomenally successful. As the basis of p opular programming languages like Standard ML and Haskell, Milner's algorithm is the preferred metho d of typ e inference among language implementors. And in the theoretical 545 Technology Square, Cambridge, MA 02139, [email protected]. Supp orted by NSF grants CCR{9113196 and CCR{9417382, and ONR Contract N00014{92{J{1310.
    [Show full text]
  • Data Structures Are Ways to Organize Data (Informa- Tion). Examples
    CPSC 211 Data Structures & Implementations (c) Texas A&M University [ 1 ] What are Data Structures? Data structures are ways to organize data (informa- tion). Examples: simple variables — primitive types objects — collection of data items of various types arrays — collection of data items of the same type, stored contiguously linked lists — sequence of data items, each one points to the next one Typically, algorithms go with the data structures to manipulate the data (e.g., the methods of a class). This course will cover some more complicated data structures: how to implement them efficiently what they are good for CPSC 211 Data Structures & Implementations (c) Texas A&M University [ 2 ] Abstract Data Types An abstract data type (ADT) defines a state of an object and operations that act on the object, possibly changing the state. Similar to a Java class. This course will cover specifications of several common ADTs pros and cons of different implementations of the ADTs (e.g., array or linked list? sorted or unsorted?) how the ADT can be used to solve other problems CPSC 211 Data Structures & Implementations (c) Texas A&M University [ 3 ] Specific ADTs The ADTs to be studied (and some sample applica- tions) are: stack evaluate arithmetic expressions queue simulate complex systems, such as traffic general list AI systems, including the LISP language tree simple and fast sorting table database applications, with quick look-up CPSC 211 Data Structures & Implementations (c) Texas A&M University [ 4 ] How Does C Fit In? Although data structures are universal (can be imple- mented in any programming language), this course will use Java and C: non-object-oriented parts of Java are based on C C is not object-oriented We will learn how to gain the advantages of data ab- straction and modularity in C, by using self-discipline to achieve what Java forces you to do.
    [Show full text]
  • A Facet-Oriented Modelling
    A Facet-oriented modelling JUAN DE LARA, Universidad Autónoma de Madrid (Spain) ESTHER GUERRA, Universidad Autónoma de Madrid (Spain) JÖRG KIENZLE, McGill University (Canada) Models are the central assets in model-driven engineering (MDE), as they are actively used in all phases of software development. Models are built using metamodel-based languages, and so, objects in models are typed by a metamodel class. This typing is static, established at creation time, and cannot be changed later. Therefore, objects in MDE are closed and fixed with respect to the class they conform to, the fields they have, and the wellformedness constraints they must comply with. This hampers many MDE activities, like the reuse of model-related artefacts such as transformations, the opportunistic or dynamic combination of metamodels, or the dynamic reconfiguration of models. To alleviate this rigidity, we propose making model objects open so that they can acquire or drop so-called facets. These contribute with a type, fields and constraints to the objects holding them. Facets are defined by regular metamodels, hence being a lightweight extension of standard metamodelling. Facet metamodels may declare usage interfaces, as well as laws that govern the assignment of facets to objects (or classes). This paper describes our proposal, reporting on a theory, analysis techniques and an implementation. The benefits of the approach are validated on the basis of five case studies dealing with annotation models, transformation reuse, multi-view modelling, multi-level modelling and language product lines. Categories and Subject Descriptors: [Software and its engineering]: Model-driven software engineering; Domain specific languages; Design languages; Software design engineering Additional Key Words and Phrases: Metamodelling, Flexible Modelling, Role-Based Modelling, METADEPTH ACM Reference Format: Juan de Lara, Esther Guerra, Jörg Kienzle.
    [Show full text]
  • Approximations, Fibrations and Intersection Type Systems
    Approximations, Fibrations and Intersection Type Systems Damiano Mazza*, Luc Pellissier† & Pierre Vial‡ June 16, 2017 Introduction The discovery of linear logic [7] has introduced the notionof linearity in computer science and proof theory. A remarkable fact of linear logic lies in its approximation theorem, stating that an arbitrary proof (not necessarily linear, that is, using its premisses any number of times) can be approximated arbitrarily well by a linear proof. This notion of approximation has then been explored in different directions [4, 10,14]. Approximations are known to be related to relational models, which in turn are related to intersection types [2, 12, 13]. In this work, we investigate approximations in the “type-systems as functors” perspective pioneered by [11]. After recasting fundamental properties of type systems, such as subject reduction and expansion in this framework, we give an intersection type system framework for linear logic, whose derivations are simply-typed approximations. Any calculus that translates meaningfully to linear logic is then endowed by a intersection type system, computed by pulling back one of these intersection type systems for linear logic, and which inherit its properties. All standard intersection type systems (idempotent, such as in [6, 1] or not, such as in [3]) for call-by-name and call-by-value λ-calculus, characterizing weak, strong, and head normalization, fit in this picture, thus justifying the equation: Simply-typed approximations = intersection types derivations. We moreover obtain new type systems, by considering other translations and reductions. 1 What is a type system? The starting point of this research is the work of [11].
    [Show full text]