English

Type System for Four Delimited Control Operators

Programming Languages 2023-05-05 v1

Abstract

The operational behavior of control operators has been studied comprehensively in the past few decades, but type systems of control operators have not. There are distinct type systems for shift, control, and shift0 without any relationship between them, and there has not been a type system that directly corresponds to control0. This paper remedies this situation by giving a uniform type system for all the four control operators. Following Danvy and Filinski's approach, we derive a monomorphic type system from the CPS interpreter that defines the operational semantics of the four control operators. By implementing the typed CPS interpreter in Agda, we show that the CPS translation preserves types and that the calculus with all the four control operators is terminating. Furthermore, we show the relationship between our type system and the previous type systems for shift, control, and shift0.

Cite

@article{arxiv.2305.02852,
  title  = {Type System for Four Delimited Control Operators},
  author = {Chiaki Ishio and Kenichi Asai},
  journal= {arXiv preprint arXiv:2305.02852},
  year   = {2023}
}

Comments

The implementation is accessible from https://github.com/chiaki-i/type4d

R2 v1 2026-06-28T10:25:42.270Z