File Download
  Links for fulltext
     (May Require Subscription)
Supplementary

Article: Type-directed operational semantics for gradual typing

TitleType-directed operational semantics for gradual typing
Authors
Issue Date26-Sep-2024
PublisherCambridge University Press
Citation
Journal of Functional Programming, 2024, v. 34 How to Cite?
AbstractThe semantics of gradually typed languages is typically given indirectly via an elaboration into a cast calculus. This contrasts with more conventional formulations of programming language semantics, where the semantics of a language is given directly using, for instance, an operational semantics. This paper presents a new approach to give the semantics of gradually typed languages directly. We use a recently proposed variant of small-step operational semantics called type-directed operational semantics (TDOS). In a TDOS, type annotations become operationally relevant and can affect the result of a program. In the context of a gradually typed language, type annotations are used to trigger type-based conversions on values. We illustrate how to employ a TDOS on gradually typed languages using two calculi. The first calculus, called λBg, is inspired by the semantics of the blame calculus, but it has implicit type conversions, enabling it to be used as a gradually typed language. The second calculus, called λe, explores an eager semantics for gradually typed languages using a TDOS. For both calculi, type safety is proved. For the λBg calculus, we also present a variant with blame labels and illustrate how the TDOS can also deal with such an important feature of gradually typed languages. We also show that the semantics of λBg with blame labels is sound and complete with respect to the semantics of the blame calculus, and that both calculi come with a gradual guarantee. All the results have been formalized in the Coq theorem prover.
Persistent Identifierhttp://hdl.handle.net/10722/361915
ISSN
2023 Impact Factor: 1.1
2023 SCImago Journal Rankings: 0.484

 

DC FieldValueLanguage
dc.contributor.authorYe, Wenjia-
dc.contributor.authorDos Santos Oliveira, Bruno Cesar-
dc.date.accessioned2025-09-17T00:32:00Z-
dc.date.available2025-09-17T00:32:00Z-
dc.date.issued2024-09-26-
dc.identifier.citationJournal of Functional Programming, 2024, v. 34-
dc.identifier.issn0956-7968-
dc.identifier.urihttp://hdl.handle.net/10722/361915-
dc.description.abstractThe semantics of gradually typed languages is typically given indirectly via an elaboration into a cast calculus. This contrasts with more conventional formulations of programming language semantics, where the semantics of a language is given directly using, for instance, an operational semantics. This paper presents a new approach to give the semantics of gradually typed languages directly. We use a recently proposed variant of small-step operational semantics called type-directed operational semantics (TDOS). In a TDOS, type annotations become operationally relevant and can affect the result of a program. In the context of a gradually typed language, type annotations are used to trigger type-based conversions on values. We illustrate how to employ a TDOS on gradually typed languages using two calculi. The first calculus, called λB<sup>g</sup>, is inspired by the semantics of the blame calculus, but it has implicit type conversions, enabling it to be used as a gradually typed language. The second calculus, called λe, explores an eager semantics for gradually typed languages using a TDOS. For both calculi, type safety is proved. For the λB<sup>g</sup> calculus, we also present a variant with blame labels and illustrate how the TDOS can also deal with such an important feature of gradually typed languages. We also show that the semantics of λB<sup>g</sup> with blame labels is sound and complete with respect to the semantics of the blame calculus, and that both calculi come with a gradual guarantee. All the results have been formalized in the Coq theorem prover.-
dc.languageeng-
dc.publisherCambridge University Press-
dc.relation.ispartofJournal of Functional Programming-
dc.rightsThis work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.-
dc.titleType-directed operational semantics for gradual typing-
dc.typeArticle-
dc.description.naturepublished_or_final_version-
dc.identifier.doi10.1017/S0956796824000078-
dc.identifier.scopuseid_2-s2.0-105003632046-
dc.identifier.volume34-
dc.identifier.eissn1469-7653-
dc.identifier.issnl0956-7968-

Export via OAI-PMH Interface in XML Formats


OR


Export to Other Non-XML Formats