File Download
Links for fulltext
(May Require Subscription)
- Publisher Website: 10.1145/3689782
- Scopus: eid_2-s2.0-85206892260
- Find via

Supplementary
-
Citations:
- Scopus: 0
- Appears in Collections:
Article: Imperative Compositional Programming: Type Sound Distributive Intersection Subtyping with References via Bidirectional Typing
| Title | Imperative Compositional Programming: Type Sound Distributive Intersection Subtyping with References via Bidirectional Typing |
|---|---|
| Authors | |
| Keywords | Bidirectional Typing Compositional Programming Distributive Subtyping Intersection Types Mutable References Type Soundness |
| Issue Date | 8-Oct-2024 |
| Publisher | Association for Computing Machinery (ACM) |
| Citation | Proceedings of the ACM on Programming Languages, 2024, v. 8, n. OOPSLA2 How to Cite? |
| Abstract | Compositional programming is a programming paradigm that emphasizes modularity and is implemented in the CP programming language. The foundations for compositional programming are based on a purely functional variant of System F with intersection types, called Fi+, which includes distributivity rules for subtyping. This paper shows how to extend compositional programming and CP with mutable references, enabling a modular, imperative compositional programming style. A technical obstacle solved in our work is the interaction between distributive intersection subtyping and mutable references. Davies and Pfenning [2000] studied this problem in standard formulations of intersection type systems and argued that, when combined with references, distributive subtyping rules lead to type unsoundness. To recover type soundness, they proposed dropping distributivity rules in subtyping. CP cannot adopt this solution, since it fundamentally relies on distributivity for modularity. Therefore, we revisit the problem and show that, by adopting bidirectional typing, a more lightweight and type sound restriction is possible: we can simply restrict the typing rule for references. This solution retains distributivity and an unrestricted intersection introduction rule. We present a first calculus, based on Davies and Pfenning's work, which illustrates the generality of our solution. Then we present an extension of Fi+ with references, which adopts our restriction and enables imperative compositional programming. We implement an extension of CP with references and show how to model a modular live-variable analysis in CP. Both calculi and their proofs are formalized in the Coq proof assistant. |
| Persistent Identifier | http://hdl.handle.net/10722/361882 |
| ISSN | 2023 Impact Factor: 2.2 2023 SCImago Journal Rankings: 1.242 |
| DC Field | Value | Language |
|---|---|---|
| dc.contributor.author | Ye, Wenjia | - |
| dc.contributor.author | Sun, Yaozhu | - |
| dc.contributor.author | Dos Santos Oliveira, Bruno Cesar | - |
| dc.date.accessioned | 2025-09-17T00:31:34Z | - |
| dc.date.available | 2025-09-17T00:31:34Z | - |
| dc.date.issued | 2024-10-08 | - |
| dc.identifier.citation | Proceedings of the ACM on Programming Languages, 2024, v. 8, n. OOPSLA2 | - |
| dc.identifier.issn | 2475-1421 | - |
| dc.identifier.uri | http://hdl.handle.net/10722/361882 | - |
| dc.description.abstract | Compositional programming is a programming paradigm that emphasizes modularity and is implemented in the CP programming language. The foundations for compositional programming are based on a purely functional variant of System F with intersection types, called Fi+, which includes distributivity rules for subtyping. This paper shows how to extend compositional programming and CP with mutable references, enabling a modular, imperative compositional programming style. A technical obstacle solved in our work is the interaction between distributive intersection subtyping and mutable references. Davies and Pfenning [2000] studied this problem in standard formulations of intersection type systems and argued that, when combined with references, distributive subtyping rules lead to type unsoundness. To recover type soundness, they proposed dropping distributivity rules in subtyping. CP cannot adopt this solution, since it fundamentally relies on distributivity for modularity. Therefore, we revisit the problem and show that, by adopting bidirectional typing, a more lightweight and type sound restriction is possible: we can simply restrict the typing rule for references. This solution retains distributivity and an unrestricted intersection introduction rule. We present a first calculus, based on Davies and Pfenning's work, which illustrates the generality of our solution. Then we present an extension of Fi+ with references, which adopts our restriction and enables imperative compositional programming. We implement an extension of CP with references and show how to model a modular live-variable analysis in CP. Both calculi and their proofs are formalized in the Coq proof assistant. | - |
| dc.language | eng | - |
| dc.publisher | Association for Computing Machinery (ACM) | - |
| dc.relation.ispartof | Proceedings of the ACM on Programming Languages | - |
| dc.rights | This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. | - |
| dc.subject | Bidirectional Typing | - |
| dc.subject | Compositional Programming | - |
| dc.subject | Distributive Subtyping | - |
| dc.subject | Intersection Types | - |
| dc.subject | Mutable References | - |
| dc.subject | Type Soundness | - |
| dc.title | Imperative Compositional Programming: Type Sound Distributive Intersection Subtyping with References via Bidirectional Typing | - |
| dc.type | Article | - |
| dc.description.nature | published_or_final_version | - |
| dc.identifier.doi | 10.1145/3689782 | - |
| dc.identifier.scopus | eid_2-s2.0-85206892260 | - |
| dc.identifier.volume | 8 | - |
| dc.identifier.issue | OOPSLA2 | - |
| dc.identifier.eissn | 2475-1421 | - |
| dc.identifier.issnl | 2475-1421 | - |
