S4 modal sequent calculus as intermediate logic and intermediate language
Jean Caspar, Guillaume Munch-Maccagnoni

TL;DR
This paper explores the connection between continuation-based intermediate languages and intermediate logics, specifically using S4 modal logic to model program transformations and compiler optimizations.
Contribution
It introduces a three-kinded polarized sequent calculus for S4 and an operational machine model that separates heap and stack, linking logic and compiler design.
Findings
S4 modal logic models continuation-based intermediate languages.
A sequent calculus for S4 with polarisation is developed.
Stackability properties are studied within the modal logic framework.
Abstract
In this short paper, we advocate for the idea that continuation-based intermediate languages correspond to intermediate logics. The goal of intermediate languages is to serve as a basis for compiler intermediate representations, allowing to represent expressive program transformations for optimisation and compilation, while preserving the properties that make programs compilable efficiently in the first place, such as the "stackability" of continuations. Intermediate logics are logics between intuitionistic and classical logic in terms of provability. Second-class continuations used in CPS-based intermediate languages correspond to a classical modal logic S4 with the added restriction that implications may only return modal types. This indeed corresponds to an intermediate logic, owing to the G\"odel-McKinsey-Tarski theorem which states the intuitionistic nature of the modal fragment of…
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 · Logic, Reasoning, and Knowledge · Formal Methods in Verification
