Answer-Type Modification without Tears: Prompt-Passing Style Translation for Typed Delimited-Control Operators
Ikuo Kobori, Yukiyoshi Kameyama, Oleg Kiselyov

TL;DR
This paper introduces a typed translation method for delimited-control operators with answer-type modification, enabling their use in standard languages without altering the type system, and provides optimized and implementation strategies.
Contribution
It presents a novel typed translation of ATM-enabled delimited-control operators into multi-prompt shift/reset, including an optimized version and a type-safe implementation in tagless-final style.
Findings
The translation preserves typing for the target language.
The optimized translation reduces prompt generation to necessary cases.
Implementation in tagless-final style maintains type safety.
Abstract
The salient feature of delimited-control operators is their ability to modify answer types during computation. The feature, answer-type modification (ATM for short), allows one to express various interesting programs such as typed printf compactly and nicely, while it makes it difficult to embed these operators in standard functional languages. In this paper, we present a typed translation of delimited-control operators shift and reset with ATM into a familiar language with multi-prompt shift and reset without ATM, which lets us use ATM in standard languages without modifying the type system. Our translation generalizes Kiselyov's direct-style implementation of typed printf, which uses two prompts to emulate the modification of answer types, and passes them during computation. We prove that our translation preserves typing. As the naive prompt-passing style translation generates and…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsLogic, programming, and type systems · Formal Methods in Verification · Logic, Reasoning, and Knowledge
