An Executable Specification of Typing Rules for Extensible Records based on Row Polymorphism

07/25/2017
by   Ki Yung Ahn, et al.
0

Type inference is an application domain that is a natural fit for logic programming (LP). LP systems natively support unification, which serves as a basic building block of typical type inference algorithms. In particular, polymorphic type inference in the Hindley--Milner type system (HM) can be succinctly specified and executed in Prolog. In our previous work, we have demonstrated that more advanced features of parametric polymorphism beyond HM, such as type-constructor polymorphism and kind polymorphism, can be similarly specified in Prolog. Here, we demonstrate a specification for records, which is one of the most widely supported compound data structures in real-world programming languages, and discuss the advantages and limitations of Prolog as a specification language for type systems. Record types are specified as order-irrelevant collections of named fields mapped to their corresponding types. In addition, an open-ended collection is used to support row polymorphism for record types to be extensible.

READ FULL TEXT

page 1

page 2

research
08/13/2021

An ML-style record calculus with extensible records

In this work, we develop a polymorphic record calculus with extensible r...
research
07/17/2023

Generic Programming with Extensible Data Types; Or, Making Ad Hoc Extensible Data Types Less Ad Hoc

We present a novel approach to generic programming over extensible data ...
research
08/14/2021

Data Type Inference for Logic Programming

In this paper we present a new static data type inference algorithm for ...
research
10/18/2019

Gradual Typing for Extensibility by Rows

This work studies gradual typing for row types and row polymorphism. Key...
research
04/17/2023

Structural Subtyping as Parametric Polymorphism

Structural subtyping and parametric polymorphism provide a similar kind ...
research
11/12/2019

Kind Inference for Datatypes: Technical Supplement

In recent years, languages like Haskell have seen a dramatic surge of ne...
research
03/03/2022

Implicit Polarized F: local type inference for impredicativity

System F, the polymorphic lambda calculus, features the principle of imp...

Please sign up or login with your details

Forgot password? Click here to reset