{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,9,16]],"date-time":"2026-09-16T08:29:58Z","timestamp":1789547398716,"version":"build-2803163510"},"reference-count":31,"publisher":"Association for Computing Machinery (ACM)","issue":"ICFP","license":[{"start":{"date-parts":[[2024,8,15]],"date-time":"2024-08-15T00:00:00Z","timestamp":1723680000000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"funder":[{"name":"Hong Kong Research Grant Council","award":["17209821"],"award-info":[{"award-number":["17209821"]}]}],"content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["Proc. ACM Program. Lang."],"published-print":{"date-parts":[[2024,8,15]]},"abstract":"<jats:p>\n                    <jats:italic toggle=\"yes\">Bidirectional typing<\/jats:italic>\n                    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.\n                  <\/jats:p>\n                  <jats:p>\n                    In this paper we present a generalization of bidirectional typing called\n                    <jats:italic toggle=\"yes\">contextual typing<\/jats:italic>\n                    . In contextual typing not only known type information is propagated during typing, but also other known information about the\n                    <jats:italic toggle=\"yes\">surrounding context<\/jats:italic>\n                    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\n                    <jats:bold>Q<\/jats:bold>\n                    uantitative\n                    <jats:bold>T<\/jats:bold>\n                    ype\n                    <jats:bold>A<\/jats:bold>\n                    ssignment\n                    <jats:bold>S<\/jats:bold>\n                    ystems (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.\n                  <\/jats:p>","DOI":"10.1145\/3674655","type":"journal-article","created":{"date-parts":[[2024,8,15]],"date-time":"2024-08-15T12:49:04Z","timestamp":1723726144000},"page":"880-908","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":4,"title":["Contextual Typing"],"prefix":"10.1145","volume":"8","author":[{"ORCID":"https:\/\/orcid.org\/0009-0008-2165-3330","authenticated-orcid":false,"given":"Xu","family":"Xue","sequence":"first","affiliation":[{"name":"University of Hong Kong, Hong Kong, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-1846-7210","authenticated-orcid":false,"given":"Bruno C. d. S.","family":"Oliveira","sequence":"additional","affiliation":[{"name":"University of Hong Kong, Hong Kong, China"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"320","published-online":{"date-parts":[[2024,8,15]]},"reference":[{"key":"e_1_3_1_2_1","doi-asserted-by":"publisher","DOI":"10.2168\/LMCS-8(1:18)2012"},{"key":"e_1_3_1_3_1","doi-asserted-by":"publisher","DOI":"10.2307\/2273659"},{"key":"e_1_3_1_4_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-662-44202-9_11"},{"key":"e_1_3_1_5_1","doi-asserted-by":"publisher","DOI":"10.1093\/LOGCOM\/13.5.639"},{"key":"e_1_3_1_6_1","doi-asserted-by":"publisher","DOI":"10.1002\/MALQ.19810270205"},{"key":"e_1_3_1_7_1","doi-asserted-by":"publisher","DOI":"10.1016\/0167-6423(95)00021-6"},{"key":"e_1_3_1_8_1","doi-asserted-by":"publisher","DOI":"10.1145\/351240.351259"},{"key":"e_1_3_1_9_1","doi-asserted-by":"publisher","DOI":"10.1145\/3450952"},{"key":"e_1_3_1_10_1","doi-asserted-by":"publisher","DOI":"10.1145\/2500365.2500582"},{"key":"e_1_3_1_11_1","doi-asserted-by":"publisher","DOI":"10.1145\/964001.964025"},{"key":"e_1_3_1_12_1","doi-asserted-by":"publisher","DOI":"10.1017\/S0956796821000186"},{"key":"e_1_3_1_13_1","doi-asserted-by":"publisher","DOI":"10.1145\/3310232.3310233"},{"key":"e_1_3_1_14_1","doi-asserted-by":"publisher","DOI":"10.1145\/1411204.1411245"},{"key":"e_1_3_1_15_1","doi-asserted-by":"publisher","DOI":"10.3233\/FI-2010-304"},{"key":"e_1_3_1_16_1","doi-asserted-by":"publisher","DOI":"10.48550\/ARXIV.2203.01835"},{"key":"e_1_3_1_17_1","volume-title":"Towards a practical programming language based on dependent type theory","author":"Norell Ulf","year":"2007","unstructured":"UlfNorell. 2007. Towards a practical programming language based on dependent type theory. Vol. 32. Chalmers University of Technology."},{"key":"e_1_3_1_18_1","doi-asserted-by":"publisher","DOI":"10.1145\/360204.360207"},{"key":"e_1_3_1_19_1","doi-asserted-by":"publisher","DOI":"10.1145\/345099.345100"},{"key":"e_1_3_1_20_1","doi-asserted-by":"publisher","DOI":"10.1145\/2908080.2908093"},{"key":"e_1_3_1_21_1","doi-asserted-by":"publisher","DOI":"10.1145\/1111037.1111058"},{"key":"e_1_3_1_22_1","unstructured":"GarrelPottinger. 1980. A type assignment for the strongly normalizable \u03bb\u2013terms. To HB Curry: essays on combinatory logic lambda calculus and formalism(1980) 561\u2013577."},{"key":"e_1_3_1_23_1","doi-asserted-by":"publisher","DOI":"10.1007\/3-540-54415-1_70"},{"key":"e_1_3_1_24_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-1-4612-4118-8_9"},{"key":"e_1_3_1_25_1","doi-asserted-by":"publisher","DOI":"10.1145\/3571211"},{"key":"e_1_3_1_26_1","doi-asserted-by":"publisher","DOI":"10.1145\/3408971"},{"key":"e_1_3_1_27_1","doi-asserted-by":"publisher","DOI":"10.1145\/3192366.3192389"},{"key":"e_1_3_1_28_1","doi-asserted-by":"publisher","DOI":"10.1145\/292540.292560"},{"key":"e_1_3_1_29_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-319-89884-1_10"},{"key":"e_1_3_1_30_1","doi-asserted-by":"publisher","DOI":"10.5281\/zenodo.11429428"},{"key":"e_1_3_1_31_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-031-21037-2_8"},{"key":"e_1_3_1_32_1","doi-asserted-by":"publisher","DOI":"10.1145\/3341716"}],"container-title":["Proceedings of the ACM on Programming Languages"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3674655","content-type":"unspecified","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3674655","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,2,4]],"date-time":"2026-02-04T07:49:46Z","timestamp":1770191386000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3674655"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2024,8,15]]},"references-count":31,"journal-issue":{"issue":"ICFP","published-print":{"date-parts":[[2024,8,15]]}},"alternative-id":["10.1145\/3674655"],"URL":"https:\/\/doi.org\/10.1145\/3674655","relation":{},"ISSN":["2475-1421"],"issn-type":[{"value":"2475-1421","type":"electronic"}],"subject":[],"published":{"date-parts":[[2024,8,15]]},"assertion":[{"value":"2024-02-28","order":0,"name":"received","label":"Received","group":{"name":"publication_history","label":"Publication History"}},{"value":"2024-06-18","order":2,"name":"accepted","label":"Accepted","group":{"name":"publication_history","label":"Publication History"}},{"value":"2024-08-15","order":3,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}