1,451 research outputs found

    Subtyping in Java is a Fractal

    Full text link
    While developing their software, professional object-oriented (OO) software developers keep in their minds an image of the subtyping relation between types in their software. The goal of this paper is to present an observation about the graph of the subtyping relation in Java, namely the observation that, after the addition of generics---and of wildcards, in particular---to Java, the graph of the subtyping relation is no longer a simple directed-acyclic graph (DAG), as in pre-generics Java, but is rather a fractal. Further, this observation equally applies to other mainstream nominally-typed OO languages (such as C#, C++ and Scala) where generics and wildcards (or some other form of 'variance annotations') are standard features. Accordingly, the shape of the subtyping relation in these OO languages is more complex than a tree or a simple DAG, and indeed is also a fractal. Given the popularity of fractals, the fractal observation may help OO software developers keep a useful and intuitive mental image of their software's subtyping relation, even if it is a little more frightening, and more amazing one than before. With proper support from IDEs, the fractal observation can help OO developers in resolving type errors they may find in their code in lesser time, and with more confidence.Comment: 18 page

    Domain Theory for Modeling OOP: A Summary

    Full text link
    Domain theory is `a mathematical theory that serves as a foundation for the semantics of programming languages'. Domains form the basis of a theory of partial information, which extends the familiar notion of partial function to encompass a whole spectrum of "degrees of definedness", so as to model incremental higher-order computation (i.e., computing with infinite data values, such as functions defined over an infinite domain like the domain of integers, infinite trees, and such as objects of object-oriented programming). General considerations from recursion theory dictate that partial functions are unavoidable in any discussion of computability. Domain theory provides an appropriately abstract setting in which the notion of a partial function can be lifted and used to give meaning to higher types, recursive types, etc. NOOP is a domain-theoretic model of nominally-typed OOP. NOOP was used to prove the identification of inheritance and subtyping in mainstream nominally-typed OO programming languages and the validity of this identification. In this report we first present the definitions of basic domain theoretic notions and domain constructors used in the construction of NOOP, then we present the construction of a simple structural model of OOP called COOP as a step towards the construction of NOOP. Like the construction of NOOP, the construction of COOP uses earlier presented domain constructors.Comment: 15 page

    Towards Understanding Generics in Mainstream OOP

    Full text link
    This article reports on steps towards building a simple and accurate domain-theoretic model of generic nominally-typed OOP.Comment: 29 page

    An Overview of Nominal-Typing versus Structural-Typing in OOP

    Full text link
    NOOP is a mathematical model of nominally-typed OOP that proves the identification of inheritance and subtyping in mainstream nominally-typed OO programming languages and the validity of this identification. This report gives an overview of the main notions in OOP relevant to constructing a mathematical model of OOP such as NOOP. The emphasis in this report is on defining nominality, nominal typing and nominal subtyping of mainstream nominally-typed OO languages, and on contrasting the three notions with their counterparts in structurally-typed OO languages, i.e., with structurality, structural typing and structural subtyping, respectively. An additional appendix demonstrates these notions and other related notions, and the differences between them, using some simple code examples. A detailed, more technical comparison between nominal typing and structural typing in OOP is presented in other publications.Comment: 16 page

    A Comparison of NOOP to Structural Domain-Theoretic Models of OOP

    Full text link
    Mainstream object-oriented programming languages such as Java, C#, C++ and Scala are all almost entirely nominally-typed. NOOP is a recently developed domain-theoretic model of OOP that was designed to include full nominal information found in nominally-typed OOP. This paper compares NOOP to the most widely known domain-theoretic models of OOP, namely, the models developed by Cardelli and Cook, which were structurally-typed models. Leveraging the development of NOOP, the comparison presented in this paper provides a clear and precise mathematical account for the relation between nominal and structural OO type systems.Comment: 17 page

    Why Nominal-Typing Matters in OOP

    Full text link
    The statements `inheritance is not subtyping' and `mainstream OO languages unnecessarily place restrictions over inheritance' have rippled as mantras through the PL research community for years. Many mainstream OO developers and OO language designers however do not accept these statements. In \emph{nominally-typed} OO languages that these developers and language designers are dearly familiar with, inheritance simply is subtyping; and they believe OO type inheritance is an inherently nominal notion not a structural one. Nominally-typed OO languages are among the most used programming languages today. However, the value of nominal typing to mainstream OO developers, as a means for designing robust OO software, seems to be in wait for full appreciation among PL researchers--thereby perpetuating an unnecessary schism between many OO developers and language designers and many OO PL researchers, with each side discounting, if not even disregarding, the views of the other. In this essay we strengthen earlier efforts to demonstrate the semantic value of nominal typing by presenting a technical comparison between nominal OO type systems and structural OO type systems. Recently, a domain-theoretic model of nominally-typed OOP was compared to well-known models of structurally-typed OOP. Combined, these comparisons provide a clear and deep account for the relation between nominal and structural OO type systems that has not been presented before, and they help demonstrate the key value of nominal typing and nominal subtyping to OO developers and language designers. We believe a clearer understanding of the key semantic advantage of pure nominal OO typing over pure structural OO typing can help remedy the existing schism. We believe future foundational OO PL research, to further its relevance to mainstream OOP, should be based less on structural models of OOP and more on nominal ones instead.Comment: 19 pages. arXiv admin note: text overlap with arXiv:1603.0864

    Induction, Coinduction, and Fixed Points: A Concise Comparative Survey

    Full text link
    In this survey article (which hitherto is an ongoing work-in-progress) we present the formulation of the induction and coinduction principles using the language and conventions of each of order theory, set theory, programming languages' type theory, first-order logic, and category theory, for the purpose of examining some of the similarities and, more significantly, the dissimilarities between these various mathematical disciplines, and hence shed some light on the precise relation between these disciplines. Towards that end, in this article we discuss plenty of related concepts, such as fixed points, pre-fixed points, post-fixed points, inductive sets and types, coinductive sets and types, algebras and coalgebras. We conclude the survey by hinting at the possibility of a more abstract and unified treatment that uses concepts from category theory such as monads and comonads.Comment: 13 pages (split article into three articles

    Finitary-based Domain Theory in Coq: An Early Report

    Full text link
    In domain theory every finite computable object can be represented by a single mathematical object instead of a set of objects, using the notion of finitary-basis. In this article we report on our effort to formalize domain theory in Coq in terms of finitary-basis.Comment: 13 page

    Novel Uses of Category Theory in Modeling OOP

    Full text link
    An outline and summary of four new potential applications of category theory to OOP research are presented. These include (1) the use of operads to model Java subtyping, (2) the use of Yoneda's lemma and representable functors in the modeling of generic types in generic nominally-typed OOP, (3) using a combination of category presentations and cartesian closed categories to model structurally-typed OOP, and (4) the use of adjoint functors to model Java erasure.Comment: 8 page

    Object-Oriented Theorem Proving (OOTP): First Thoughts

    Full text link
    Automatic (i.e., computer-assisted) theorem proving (ATP) can come in many flavors. This document presents early steps in our effort towards defining object-oriented theorem proving (OOTP) as a new style of ATP. Traditional theorem proving (TTP) is the only well-known flavor of ATP so far. OOTP is a generalization of TTP. While TTP is strongly based on functional programming (FP), OOTP is strongly based on object-oriented programming (OOP) instead. We believe OOTP is a style of theorem proving that is no less powerful and no less natural than TTP and thus likely will be no less practically useful than TTP.Comment: 11 page
    • …
    corecore