skip to main content
10.1145/3551357.3551384acmotherconferencesArticle/Chapter ViewAbstractPublication PagesppdpConference Proceedingsconference-collections
research-article

Certified Derivation of Small-Step From Big-Step Skeletal Semantics

Published: 20 September 2022 Publication History

Abstract

We present an automatic translation of a skeletal semantics written in big-step style into an equivalent structural operational semantics. This translation is implemented on top of the Necro tool, which lets us automatically generate an OCaml interpreter for the small step semantics and a Coq mechanization of both semantics. We prove the framework correct in two ways: we provide a paper proof of the core of the transformation, and we generate Coq certification scripts alongside the transformation. We illustrate the approach using a simple imperative language and show how it scales to larger languages.

References

[1]
2021. ECMAScript language specification. Standard ECMA-262. https://262.ecma-international.org/
[2]
Mads Sig Ager, Dariusz Biernacki, Olivier Danvy, and Jan Midtgaard. 2003. A functional correspondence between evaluators and abstract machines. In Proceedings of the 5th International ACM SIGPLAN Conference on Principles and Practice of Declarative Programming, 27-29 August 2003, Uppsala, Sweden. ACM, 8–19. https://doi.org/10.1145/888251.888254
[3]
Guillaume Ambal, Sergueï Lenglet, and Alan Schmitt. 2022. Certified abstract machines for skeletal semantics. In CPP ’22: 11th ACM SIGPLAN International Conference on Certified Programs and Proofs, Philadelphia, PA, USA, January 17 - 18, 2022, Andrei Popescu and Steve Zdancewic (Eds.). ACM, 55–67. https://doi.org/10.1145/3497775.3503676
[4]
Guillaume Ambal, Sergueï Lenglet, and Alan Schmitt. 2022. Certified Derivation of Small-Step From Big-Step Skeletal Semantics. Implementation available at https://gitlab.inria.fr/skeletons/necro/-/tree/PPDP2022.
[5]
Martin Bodin, Philippa Gardner, Thomas Jensen, and Alan Schmitt. 2019. Skeletal semantics and their interpretations. PACMPL 3, POPL (2019), 44:1–44:31. https://doi.org/10.1145/3290357
[6]
Arthur Charguéraud. 2013. Pretty-big-step semantics. In Proceedings of the 22nd European Symposium on Programming (ESOP 2013). Springer, 41–60.
[7]
Ştefan Ciobâcă. 2013. From Small-Step Semantics to Big-Step Semantics, Automatically. In Integrated Formal Methods, 10th International Conference, IFM 2013, Turku, Finland, June 10-14, 2013. Proceedings(Lecture Notes in Computer Science, Vol. 7940), Einar Broch Johnsen and Luigia Petre (Eds.). Springer, 347–361. https://doi.org/10.1007/978-3-642-38613-8_24
[8]
The Coq Development Team. 2020. The Coq Proof Assistant Reference Manual, version 8.11. http://coq.inria.fr
[9]
Nathanaël Courant, Enzo Crance, and Alan Schmitt. 2019. Necro: Animating Skeletons. In ML 2019. Berlin, Germany.
[10]
Olivier Danvy. 2004. A Rational Deconstruction of Landin’s SECD Machine. In Implementation and Application of Functional Languages, 16th International Workshop, IFL 2004, Lübeck, Germany, September 8-10, 2004, Revised Selected Papers(Lecture Notes in Computer Science, Vol. 3474), Clemens Grelck, Frank Huch, Greg Michaelson, and Philip W. Trinder (Eds.). Springer, 52–71. https://doi.org/10.1007/11431664_4
[11]
Olivier Danvy. 2005. From Reduction-based to Reduction-free Normalization. Electron. Notes Theor. Comput. Sci. 124, 2 (2005), 79–100. https://doi.org/10.1016/j.entcs.2005.01.007
[12]
Olivier Danvy, Jacob Johannsen, and Ian Zerny. 2011. A walk in the semantic park. In Proceedings of the 2011 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation, PEPM 2011, Austin, TX, USA, January 24-25, 2011, Siau-Cheng Khooand Jeremy G. Siek (Eds.). ACM, 1–12. https://doi.org/10.1145/1929501.1929503
[13]
Cornelis Huizing, Ron Koymans, and Ruurd Kuiper. 2010. A Small Step for Mankind. In Concurrency, Compositionality, and Correctness, Essays in Honor of Willem-Paul de Roever(Lecture Notes in Computer Science, Vol. 5930), Dennis Dams, Ulrich Hannemann, and Martin Steffen (Eds.). Springer, 66–73. https://doi.org/10.1007/978-3-642-11512-7_5
[14]
Gilles Kahn. 1987. Natural Semantics. In STACS 87, 4th Annual Symposium on Theoretical Aspects of Computer Science, Passau, Germany, February 19-21, 1987, Proceedings(Lecture Notes in Computer Science, Vol. 247), Franz-Josef Brandenburg, Guy Vidal-Naquet, and Martin Wirsing (Eds.). Springer, 22–39. https://doi.org/10.1007/BFb0039592
[15]
P. J. Landin. 1964. The Mechanical Evaluation of Expressions. Comput. J. 6, 4 (1964), 308–320. https://doi.org/10.1093/comjnl/6.4.308
[16]
Xavier Leroy. 2009. Formal verification of a realistic compiler. CACM 52, 7 (2009), 107–115.
[17]
Xavier Leroy, Damien Doligez, Alain Frisch, Jacques Garrigue, Didier Rémy, and Jérôme Vouillon. 2020. The OCaml system release 4.10. Inria. https://caml.inria.fr/pub/docs/manual-ocaml/
[18]
Xavier Leroy and Hervé Grall. 2009. Coinductive big-step operational semantics. Inf. Comput. 207, 2 (2009), 284–304. https://doi.org/10.1016/j.ic.2007.12.004
[19]
Robin Milner, Robert Harper, David MacQueen, and Tofte Mads. 1997. The Definition of Standard ML, Revised Edition.
[20]
Dominic P. Mulligan, Scott Owens, Kathryn E. Gray, Tom Ridge, and Peter Sewell. 2014. Lem: reusable engineering of real-world semantics. In Proceedings of the 19th ACM SIGPLAN international conference on Functional programming, Gothenburg, Sweden, September 1-3, 2014, Johan Jeuringand Manuel M. T. Chakravarty (Eds.). ACM, 175–188. https://doi.org/10.1145/2628136.2628143
[21]
Hanne Riis Nielson and Flemming Nielson. 1992. Semantics with applications - a formal introduction. Wiley.
[22]
Gordon D. Plotkin. 2004. A structural approach to operational semantics. Journal of Logic and Algebraic Programming 60-61 (2004), 17–139.
[23]
Casper Bach Poulsen and Peter D. Mosses. 2014. Deriving Pretty-Big-Step Semantics from Small-Step Semantics. In Programming Languages and Systems - 23rd European Symposium on Programming, ESOP 2014, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2014, Grenoble, France, April 5-13, 2014, Proceedings(Lecture Notes in Computer Science, Vol. 8410), Zhong Shao (Ed.). Springer, 270–289. https://doi.org/10.1007/978-3-642-54833-8_15
[24]
Casper Bach Poulsen and Peter D. Mosses. 2017. Flag-based big-step semantics. J. Log. Algebraic Methods Program. 88 (2017), 174–190. https://doi.org/10.1016/j.jlamp.2016.05.001
[25]
Traian-Florin Serbanuta, Andrei Arusoaie, David Lazar, Chucky Ellison, Dorel Lucanu, and Grigore Rosu. 2014. The K Primer (version 3.3). Electron. Notes Theor. Comput. Sci. 304 (2014), 57–80. https://doi.org/10.1016/j.entcs.2014.05.003
[26]
Peter Sewell, Francesco Zappa Nardelli, Scott Owens, Gilles Peskine, Thomas Ridge, Susmit Sarkar, and Rok Strnisa. 2010. Ott: Effective tool support for the working semanticist. J. Funct. Program. 20, 1 (2010), 71–122. https://doi.org/10.1017/S0956796809990293
[27]
Ferdinand Vesely and Kathleen Fisher. 2019. One Step at a Time - A Functional Derivation of Small-Step Evaluators from Big-Step Counterparts. In Programming Languages and Systems - 28th European Symposium on Programming, ESOP 2019, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2019, Prague, Czech Republic, April 6-11, 2019, Proceedings(Lecture Notes in Computer Science, Vol. 11423), Luís Caires (Ed.). Springer, 205–231. https://doi.org/10.1007/978-3-030-17184-1_8
[28]
Andrew K. Wright and Matthias Felleisen. 1994. A Syntactic Approach to Type Soundness. Information and Computation 115, 1 (1994), 38–94. https://doi.org/10.1006/inco.1994.1093

Cited By

View all

Index Terms

  1. Certified Derivation of Small-Step From Big-Step Skeletal Semantics

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Other conferences
    PPDP '22: Proceedings of the 24th International Symposium on Principles and Practice of Declarative Programming
    September 2022
    187 pages
    ISBN:9781450397032
    DOI:10.1145/3551357
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 20 September 2022

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. Big-Step
    2. Operational Semantics
    3. Small-Step

    Qualifiers

    • Research-article
    • Research
    • Refereed limited

    Conference

    PPDP 2022

    Acceptance Rates

    Overall Acceptance Rate 230 of 486 submissions, 47%

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)13
    • Downloads (Last 6 weeks)1
    Reflects downloads up to 06 Jan 2025

    Other Metrics

    Citations

    Cited By

    View all

    View Options

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    HTML Format

    View this article in HTML Format.

    HTML Format

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media