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

Supplementary
-
Citations:
- Scopus: 0
- Appears in Collections:
Article: Contextual Typing
| Title | Contextual Typing |
|---|---|
| Authors | |
| Keywords | Bidirectional Typing Type Inference |
| Issue Date | 15-Aug-2024 |
| Publisher | Association for Computing Machinery (ACM) |
| Citation | Proceedings of the ACM on Programming Languages, 2024, v. 8, n. ICFP How to Cite? |
| Abstract | Bidirectional typing is a simple, lightweight approach to type inference that propagates known type information during typing, and can scale up to many different type systems and features. It typically only requires a reasonable amount of annotations and eliminates the need for many obvious annotations. Nonetheless the power of inference is still limited, and complications arise in the presence of more complex features. In this paper we present a generalization of bidirectional typing called contextual typing. In contextual typing not only known type information is propagated during typing, but also other known information about the surrounding context of a term. This information can be of various forms, such as other terms or record labels. Due to this richer notion of contextual information, less annotations are needed, while the approach remains lightweight and scalable. For type systems with subtyping, contextual typing subsumption is also more expressive than subsumption with bidirectional typing, since partially known contextual information can be exploited. To aid specifying type systems with contextual typing, we introduce Quantitative Type Assignment Systems (QTASs). A QTAS quantifies the amount of type information that a term needs in order to type check using counters. Thus, a counter in a QTAS generalizes modes in traditional bidirectional typing, which can only model an all (checking mode) or nothing (inference mode) approach. QTASs enable precise guidelines for annotatability of contextual type systems formalized as a theorem. We illustrate contextual typing first on a simply typed lambda calculus, and then on a richer calculus with subtyping, intersection types, records and overloading. All the metatheory is formalized in the Agda theorem prover. |
| Persistent Identifier | http://hdl.handle.net/10722/361840 |
| ISSN | 2023 Impact Factor: 2.2 2023 SCImago Journal Rankings: 1.242 |
| DC Field | Value | Language |
|---|---|---|
| dc.contributor.author | Xue, Xu | - |
| dc.contributor.author | Dos Santos Oliveira, Bruno Cesar | - |
| dc.date.accessioned | 2025-09-17T00:30:59Z | - |
| dc.date.available | 2025-09-17T00:30:59Z | - |
| dc.date.issued | 2024-08-15 | - |
| dc.identifier.citation | Proceedings of the ACM on Programming Languages, 2024, v. 8, n. ICFP | - |
| dc.identifier.issn | 2475-1421 | - |
| dc.identifier.uri | http://hdl.handle.net/10722/361840 | - |
| dc.description.abstract | <p>Bidirectional typing is a simple, lightweight approach to type inference that propagates known type information during typing, and can scale up to many different type systems and features. It typically only requires a reasonable amount of annotations and eliminates the need for many obvious annotations. Nonetheless the power of inference is still limited, and complications arise in the presence of more complex features. In this paper we present a generalization of bidirectional typing called contextual typing. In contextual typing not only known type information is propagated during typing, but also other known information about the surrounding context of a term. This information can be of various forms, such as other terms or record labels. Due to this richer notion of contextual information, less annotations are needed, while the approach remains lightweight and scalable. For type systems with subtyping, contextual typing subsumption is also more expressive than subsumption with bidirectional typing, since partially known contextual information can be exploited. To aid specifying type systems with contextual typing, we introduce Quantitative Type Assignment Systems (QTASs). A QTAS quantifies the amount of type information that a term needs in order to type check using counters. Thus, a counter in a QTAS generalizes modes in traditional bidirectional typing, which can only model an all (checking mode) or nothing (inference mode) approach. QTASs enable precise guidelines for annotatability of contextual type systems formalized as a theorem. We illustrate contextual typing first on a simply typed lambda calculus, and then on a richer calculus with subtyping, intersection types, records and overloading. All the metatheory is formalized in the Agda theorem prover.</p> | - |
| 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 | Type Inference | - |
| dc.title | Contextual Typing | - |
| dc.type | Article | - |
| dc.description.nature | published_or_final_version | - |
| dc.identifier.doi | 10.1145/3674655 | - |
| dc.identifier.scopus | eid_2-s2.0-85201678947 | - |
| dc.identifier.volume | 8 | - |
| dc.identifier.issue | ICFP | - |
| dc.identifier.eissn | 2475-1421 | - |
| dc.identifier.issnl | 2475-1421 | - |
