File Download
  Links for fulltext
     (May Require Subscription)
Supplementary

Article: Making a Type Difference: Subtraction on Intersection Types as Generalized Record Operations

TitleMaking a Type Difference: Subtraction on Intersection Types as Generalized Record Operations
Authors
KeywordsFunctional languages
Object oriented languages
Type systems
Issue Date9-Jan-2023
PublisherACM
Citation
Proceedings of the ACM on Programming Languages, 2023, v. 7, n. POPL, p. 893-920 How to Cite?
Abstract

In programming languages with records, objects, or traits, it is common to have operators that allow dropping, updating or renaming some components. These operators are useful for programmers to explicitly deal with conflicts and override or update some components. While such operators have been studied for record types, little work has been done to generalize and study their theory for other types. 

This paper shows that, given subtyping and disjointness relations, we can specify and derive algorithmic implementations for a general type difference operator that works for other types, including function types, record types and intersection types. When defined in this way, the type difference algebra has many desired properties that are expected from a subtraction operator. Together with a generic merge operator, using type difference we can generalize many operations on records formalized in the literature. To illustrate the usefulness of type difference we create an intermediate calculus with a rich set of operators on expressions of arbitrary type, and demonstrate applications of these operators in CP, a prototype language for Compositional Programming. The semantics of the calculus is given by elaborating into a calculus with disjoint intersection types and a merge operator. We have implemented type difference and all the operators in the CP language. Moreover, all the calculi and related proofs are mechanically formalized in the Coq theorem prover.


Persistent Identifierhttp://hdl.handle.net/10722/339350

 

DC FieldValueLanguage
dc.contributor.authorXu, Han-
dc.contributor.authorHuang, Xuejing-
dc.contributor.authorDos Santos Oliveira, Bruno C-
dc.date.accessioned2024-03-11T10:35:54Z-
dc.date.available2024-03-11T10:35:54Z-
dc.date.issued2023-01-09-
dc.identifier.citationProceedings of the ACM on Programming Languages, 2023, v. 7, n. POPL, p. 893-920-
dc.identifier.urihttp://hdl.handle.net/10722/339350-
dc.description.abstract<p>In programming languages with records, objects, or traits, it is common to have operators that allow dropping, updating or renaming some components. These operators are useful for programmers to explicitly deal with conflicts and override or update some components. While such operators have been studied for record types, little work has been done to generalize and study their theory for other types. </p><p>This paper shows that, given subtyping and disjointness relations, we can specify and derive algorithmic implementations for a general type difference operator that works for other types, including function types, record types and intersection types. When defined in this way, the type difference algebra has many desired properties that are expected from a subtraction operator. Together with a generic <em>merge</em> operator, using type difference we can generalize many operations on records formalized in the literature. To illustrate the usefulness of type difference we create an intermediate calculus with a rich set of operators on expressions of arbitrary type, and demonstrate applications of these operators in <em>CP</em>, a prototype language for <em>Compositional Programming</em>. The semantics of the calculus is given by elaborating into a calculus with <em>disjoint intersection types</em> and a merge operator. We have implemented type difference and all the operators in the CP language. Moreover, all the calculi and related proofs are mechanically formalized in the Coq theorem prover.</p>-
dc.languageeng-
dc.publisherACM-
dc.relation.ispartofProceedings of the ACM on Programming Languages-
dc.rightsThis work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.-
dc.subjectFunctional languages-
dc.subjectObject oriented languages-
dc.subjectType systems-
dc.titleMaking a Type Difference: Subtraction on Intersection Types as Generalized Record Operations-
dc.typeArticle-
dc.description.naturepublished_or_final_version-
dc.identifier.doi10.1145/3571224-
dc.identifier.scopuseid_2-s2.0-85146556341-
dc.identifier.volume7-
dc.identifier.issuePOPL-
dc.identifier.spage893-
dc.identifier.epage920-
dc.identifier.eissn2475-1421-
dc.identifier.issnl2475-1421-

Export via OAI-PMH Interface in XML Formats


OR


Export to Other Non-XML Formats