From Big-Step to Small-Step Semantics and Back with Interpreter Specialisation
John P. Gallagher (Roskilde University, Denmark, IMDEA Software, Institute, Spain), Manuel Hermenegildo (IMDEA Software Institute, Spain),, Bishoksan Kafle (IMDEA Software Institute, Spain), Maximiliano Klemen (IMDEA, Software Institute, Spain)

TL;DR
This paper explores translating imperative programs between big-step and small-step semantics using constrained Horn clauses and interpreter specialization, enabling flexible semantic representations and program analysis.
Contribution
It introduces a method to convert between big-step and small-step semantics via interpreter specialization and program transformation, demonstrating this on a subset of C.
Findings
Successful translation between big-step and small-step semantics
Use of partial evaluation to optimize and clarify program representations
Application of Tarjan's algorithm for path computation in program analysis
Abstract
We investigate representations of imperative programs as constrained Horn clauses. Starting from operational semantics transition rules, we proceed by writing interpreters as constrained Horn clause programs directly encoding the rules. We then specialise an interpreter with respect to a given source program to achieve a compilation of the source language to Horn clauses (an instance of the first Futamura projection). The process is described in detail for an interpreter for a subset of C, directly encoding the rules of big-step operational semantics for C. A similar translation based on small-step semantics could be carried out, but we show an approach to obtaining a small-step representation using a linear interpreter for big-step Horn clauses. This interpreter is again specialised to achieve the translation from big-step to small-step style. The linear small-step program can be…
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.
