35 research outputs found

    Principal types for object-oriented languages

    Get PDF
    Object-oriented languages can he translated into a lambda-calculus with records. Therefore, type inference for record languages is one aspect of the yet unsolved problem of inferring types for object-oriented languages. In order to obtain the necessary flexibility for such a type system, we can either introduce a general subtyping notion or use extensible record types. Subtyping, especially in combination with imperative features, poses many hard problems. Therefore, the second approach is promising. The problem is that, in previous type inference systems that used extensible record types, principal types could not be inferred. We have found that, for an object-oriented language where classes are not first-class citizens, we could greatly simplify the underlying record language. We show that, for our simple record language, there exists a type inference algorithm that infers principal types

    Cumulative subject index Volumes 90–95

    Get PDF

    Denotational Semantics for Subtyping Between Recursive Types

    Get PDF
    Inheritance in the form of subtyping is considered in the framework of a polymorphic type discipline with records, variants, and recursive types. We give a denotational semantics based on the paradigm that interprets subtyping as explicit coercion. The main technical result gives a coherent interpretation for a strong rule for deriving inheritances between recursive types

    Principal types for object-oriented languages

    Get PDF
    Object-oriented languages can he translated into a lambda-calculus with records. Therefore, type inference for record languages is one aspect of the yet unsolved problem of inferring types for object-oriented languages. In order to obtain the necessary flexibility for such a type system, we can either introduce a general subtyping notion or use extensible record types. Subtyping, especially in combination with imperative features, poses many hard problems. Therefore, the second approach is promising. The problem is that, in previous type inference systems that used extensible record types, principal types could not be inferred. We have found that, for an object-oriented language where classes are not first-class citizens, we could greatly simplify the underlying record language. We show that, for our simple record language, there exists a type inference algorithm that infers principal types

    Mixin Composition Synthesis Based on Intersection Types

    Get PDF
    We present a method for synthesizing compositions of mixins using type inhabitation in intersection types. First, recursively defined classes and mixins, which are functions over classes, are expressed as terms in a lambda calculus with records. Intersection types with records and record-merge are used to assign meaningful types to these terms without resorting to recursive types. Second, typed terms are translated to a repository of typed combinators. We show a relation between record types with record-merge and intersection types with constructors. This relation is used to prove soundness and partial completeness of the translation with respect to mixin composition synthesis. Furthermore, we demonstrate how a translated repository and goal type can be used as input to an existing framework for composition synthesis in bounded combinatory logic via type inhabitation. The computed result corresponds to a mixin composition typed by the goal type

    On Generalized Records and Spatial Conjunction in Role Logic

    Full text link
    We have previously introduced role logic as a notation for describing properties of relational structures in shape analysis, databases and knowledge bases. A natural fragment of role logic corresponds to two-variable logic with counting and is therefore decidable. We show how to use role logic to describe open and closed records, as well the dual of records, inverse records. We observe that the spatial conjunction operation of separation logic naturally models record concatenation. Moreover, we show how to eliminate the spatial conjunction of formulas of quantifier depth one in first-order logic with counting. As a result, allowing spatial conjunction of formulas of quantifier depth one preserves the decidability of two-variable logic with counting. This result applies to two-variable role logic fragment as well. The resulting logic smoothly integrates type system and predicate calculus notation and can be viewed as a natural generalization of the notation for constraints arising in role analysis and similar shape analysis approaches.Comment: 30 pages. A version appears in SAS 200

    Computing With Coercions

    Get PDF
    This paper relates two views of the operational semantics of a language with multiple inheritance. It is shown that the introduction of explicit coercions as an interpretation for the implicit coercion of inheritance does not affect the evaluation of a program in an essential way. The result is proved by semantic means using a denotational model and a computational adequacy result to relate the operational and denotational semantics

    Type Inference for Records in a Natural Extension of ML

    Get PDF
    We describe an extension of ML with records where inheritance is given by ML generic polymorphism. All operations on records introduced by Wand in [Wan87] are supported, in particular the unrestricted extension of a field, and other operations such as renaming of fields are added. The solution relies on both an extension of ML, where the language of types is sorted and considered modulo equations [Rem9Ob], and on a record extension of types [Rem9Oc]. The solution is simple and modular and the type inference algorithm is efficient in practice

    Mixin Composition Synthesis based on Intersection Types

    Full text link
    We present a method for synthesizing compositions of mixins using type inhabitation in intersection types. First, recursively defined classes and mixins, which are functions over classes, are expressed as terms in a lambda calculus with records. Intersection types with records and record-merge are used to assign meaningful types to these terms without resorting to recursive types. Second, typed terms are translated to a repository of typed combinators. We show a relation between record types with record-merge and intersection types with constructors. This relation is used to prove soundness and partial completeness of the translation with respect to mixin composition synthesis. Furthermore, we demonstrate how a translated repository and goal type can be used as input to an existing framework for composition synthesis in bounded combinatory logic via type inhabitation. The computed result is a class typed by the goal type and generated by a mixin composition applied to an existing class
    corecore