Resolution as Intersection Subtyping via Modus Ponens

10/13/2020
by   Koar Marntirosian, et al.
0

Resolution and subtyping are two common mechanisms in programming languages. Resolution is used by features such as type classes or Scala-style implicits to synthesize values automatically from contextual type information. Subtyping is commonly used to automatically convert the type of a value into another compatible type. So far the two mechanisms have been considered independently of each other. This paper shows that, with a small extension, subtyping with intersection types can subsume resolution. This has three main consequences. Firstly, resolution does not need to be implemented as a separate mechanism. Secondly, the interaction between resolution and subtyping becomes apparent. Finally, the integration of resolution into subtyping enables first-class (implicit) environments. The extension that recovers the power of resolution via subtyping is the modus ponens rule of propositional logic. While it is easily added to declarative subtyping, significant care needs to be taken to retain desirable properties, such as transitivity and decidability of algorithmic subtyping, and coherence. To materialize these ideas we develop λ_i^𝖬𝖯, a calculus that extends a iprevious calculus with disjoint intersection types, and develop its metatheory in the Coq theorem prover.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
07/12/2019

Intersection Types for the Computational lambda-Calculus

We study polymorphic type assignment systems for untyped lambda-calculi ...
research
03/26/2018

The Delta-calculus: syntax and types

We present the Delta-calculus, an explicitly typed lambda-calculus with ...
research
02/15/2021

Sequence Types and Infinitary Semantics

We introduce a new representation of non-idempotent intersection types, ...
research
04/26/2022

Structural Rules and Algebraic Properties of Intersection Types

In this paper we define several notions of term expansion, used to defin...
research
05/12/2022

Direct Foundations for Compositional Programming

The recently proposed CP language adopts Compositional Programming: a ne...
research
04/23/2019

Intersection Types for Unboundedness Problems

Intersection types have been originally developed as an extension of sim...
research
12/19/2017

Mixin Composition Synthesis based on Intersection Types

We present a method for synthesizing compositions of mixins using type i...

Please sign up or login with your details

Forgot password? Click here to reset