From Small-Step Semantics to Big-Step Semantics, Automatically
Small-step semantics and big-step semantics are two styles for operationally defining the meaning of programming languages. Small-step semantics are given as a relation between program configurations that denotes one computational step; big-step semantics are given as a relation directly associating to each program configuration the corresponding final configuration. Small-step semantics are useful for making precise reasonings about programs, but reasoning in big-step semantics is easier and more intuitive. When both small-step and big-step semantics are needed for the same language, a proof of the fact that the two semantics are equivalent should also be provided in order to trust that they both define the same language. We show that the big-step semantics can be automatically obtained from the small-step semantics when the small-step semantics are given by inference rules satisfying certain assumptions that we identify. The transformation that we propose is very simple and we show that when the identified assumptions are met, it is sound and complete in the sense that the two semantics are equivalent. For a strict subset of the identified assumptions, we show that the resulting big-step semantics is sound but not necessarily complete. We discuss our transformation on a number of examples.
KeywordsProgramming Language Inference Rule Operational Semantic Lambda Calculus Sanity Check
Unable to display preview. Download preview PDF.
- 1.Strachey, C.: Towards a formal semantics. In: Formal Language Description Languages for Computer Programming, pp. 198–220. North-Holland (1966)Google Scholar
- 4.Plotkin, G.D.: A structural approach to operational semantics. Technical Report DAIMI FN-19, University of Aarhus (1981)Google Scholar
- 17.Danvy, O.: Defunctionalized interpreters for programming languages. In: ICFP 2008, pp. 131–142. ACM, New York (2008)Google Scholar
- 20.Danvy, O., Johannsen, J., Zerny, I.: A walk in the semantic park. In: Khoo, S.C., Siek, J.G. (eds.) PEPM, pp. 1–12. ACM (2011)Google Scholar
- 21.Groote, J.F., Mousavi, M., Reniers, M.A.: A hierarchy of SOS rule formats. In: Proceedings of SOS 2005, Lisboa, Portugal. ENTCS, Elsevier (2005)Google Scholar
- 22.Aceto, L., Fokkink, W., Verhoef, C.: Structural operational semantics. In: Handbook of Process Algebra, pp. 197–292. Elsevier (1999)Google Scholar
- 23.Uustalu, T.: Coinductive big-step semantics for concurrency. In: Vanderbauwhede, W., Yoshida, N. (eds.) Proceedings of PLACES 2013. EPTCS (2013) (to appear)Google Scholar