English

Resolution as Intersection Subtyping via Modus Ponens

Programming Languages 2020-10-19 v2 Logic in Computer Science

Abstract

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 λiMP\lambda_i^{\mathsf{MP}}, a calculus that extends a iprevious calculus with disjoint intersection types, and develop its metatheory in the Coq theorem prover.

Keywords

Cite

@article{arxiv.2010.06216,
  title  = {Resolution as Intersection Subtyping via Modus Ponens},
  author = {Koar Marntirosian and Tom Schrijvers and Bruno C. d. S. Oliveira and Georgios Karachalias},
  journal= {arXiv preprint arXiv:2010.06216},
  year   = {2020}
}

Comments

43 pages, 20 figures; typos corrected, link to artifact added

R2 v1 2026-06-23T19:18:10.609Z