skip to main content
research-article
Open access

Skeletal semantics and their interpretations

Published: 02 January 2019 Publication History

Abstract

The development of mechanised language specification based on structured operational semantics, with applications to verified compilers and sound program analysis, requires huge effort. General theory and frameworks have been proposed to help with this effort. However, none of this work provides a systematic way of developing concrete and abstract semantics, connected together by a general consistency result. We introduce a skeletal semantics of a language, where each skeleton describes the complete semantic behaviour of a language construct. We define a general notion of interpretation, which provides a systematic and language-independent way of deriving semantic judgements from the skeletal semantics. We explore four generic interpretations: a simple well-formedness interpretation; a concrete interpretation; an abstract interpretation; and a constraint generator for flow-sensitive analysis. We prove general consistency results between interpretations, depending only on simple language-dependent lemmas. We illustrate our ideas using a simple While language.

Supplementary Material

WEBM File (a44-schmitt.webm)

References

[1]
Sandrine Blazy and Xavier Leroy. 2009. Mechanized semantics for the Clight subset of the C language. Journal of Automated Reasoning 43, 3 (2009), 263–288.
[2]
Martin Bodin, Arthur Charguéraud, Daniele Filaretti, Philippa Gardner, Sergio Maffeis, Daiva Naudziuniene, Alan Schmitt, and Gareth Smith. 2014. A Trusted Mechanised JavaScript Specification. In Proc. of the 41st ACM Symposium on Principles of Programming Languages ((POPL 2014)) . ACM, 87–100.
[3]
Martin Bodin, Thomas Jensen, and Alan Schmitt. 2015. Certified Abstract Interpretation with Pretty-Big-Step Semantics. In Proc. of the 2015 ACM Conference on Certified Programs and Proofs (CPP’15) . ACM, 29–40.
[4]
David Cachera, Thomas Jensen, David Pichardie, and Vlad Rusu. 2005. Extracting a data flow analyser in constructive logic. Theoretical Computer Science 342, 1 (2005), 56–78.
[5]
Arthur Charguéraud. 2013. Pretty-big-step Semantics. In European Symposium on Programming (ESOP’13). Springer LNCS vol. 7792, 41–60.
[6]
Martin Churchill, Peter D Mosses, Neil Sculthorpe, and Paolo Torrini. 2015. Reusable Components of Semantic Specifications. In Transactions on Aspect-Oriented Software Development XII. Springer, 132–179.
[7]
Patrick Cousot. 1999. The Calculational Design of a Generic Abstract Interpreter. In Calculational System Design. NATO ASI Series F. IOS Press, Amsterdam.
[8]
Patrick Cousot and Radhia Cousot. 1977. Abstract Interpretation: A unified lattice model for static analysis of programs by construction of approximations of fixpoints. In Proc. of 4th ACM Symposium on Principles of Programming Languages (POPL ’77) . ACM, 238–252.
[9]
Andrei Ştefănescu, Daejun Park, Shijiao Yuwen, Yilong Li, and Grigore Roşu. 2016. Semantics-Based Program Verifiers for All Languages. In Proc. of the 31th Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA’16) . ACM, 74–91.
[10]
Thomas Dinsdale-Young, Lars Birkedal, Philippa Gardner, Matthew Parkinson, and Hongseok Yang. 2013. Views: Compositional Reasoning for Concurrent Programs. In Proc. of the 40th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’13) . ACM, 287–300.
[11]
ECMA. 2018. ECMAScript 2018 Language Specification (ECMA-262, 9th edition). (June 2018). https://www. ecma-international.org/ecma-262/9.0/index.html
[12]
Philippa Gardner, Sergio Maffeis, and Gareth Smith. 2012. Towards a Program Logic for JavaScript. ACM SIGPLAN Notices 47, 1 (2012), 31–44.
[13]
Robert Harper, Furio Honsell, and Gordon D. Plotkin. 1987. A Framework for Defining Logics. In Proc. of the Symposium on Logic in Computer Science (LICS ’87) . 194–204.
[14]
Jacques-Henri Jourdan, Vincent Laporte, Sandrine Blazy, Xavier Leroy, and David Pichardie. 2015. A Formally-Verified C Static Analyzer. In Proc. of the 42nd ACM Symposium on Principles of Programming Languages (POPL ’15). ACM, 247–259.
[15]
Ralf Jung, Robbert Krebbers, Jacques-Henri Jourdan, Aleš Bizjak, Lars Birkedal, and Derek Dreyer. 2017. Iris from the Ground Up. Submitted to JFP (2017).
[16]
Sven Keidel, Casper Bach Poulsen, and Sebastian Erdweg. 2018. Compositional Soundness Proofs of Abstract Interpreters. Proc. ACM Program. Lang. 2, ICFP, Article 72 (July 2018), 26 pages.
[17]
Gerwin Klein and Tobias Nipkow. 2002. Verified Bytecode Verifiers. Theoretical Computer Science 298, 3 (2002), 583–626.
[18]
Ramana Kumar, Magnus O. Myreen, Michael Norrish, and Scott Owens. 2014. CakeML: a verified implementation of ML. In Proc. of 41st Annual ACM Symposium on Principles of Programming Languages, POPL ’14 . 179–192.
[19]
Xavier Leroy. 2006. Formal certification of a compiler back-end, or: programming a compiler with a proof assistant. In Proc/ of 33rd ACM Symposium on Principles of Programming Languages (POPL’06) . ACM, 42–54.
[20]
Liyi Li and Elsa L. Gunter. 2018. IsaK: A Complete Semantics of K. Technical Report. Computer Science, Univ. of Illinois Urbana-Champaign.
[21]
Sergio Maffeis, John C. Mitchell, and Ankur Taly. 2008. An Operational Semantics for JavaScript. In Proc. of APLAS’08 (LNCS), Vol. 5356. 307–325.
[22]
Jan Midtgaard and Thomas Jensen. 2008. A Calculational Approach to Control-Flow Analysis by Abstract Interpretation. In Proc. of 15th Static Analysis Symposium (SAS’08) . Springer LNCS vol. 5079, 347–362.
[23]
Peter D. Mosses. 1992. Action Semantics. Cambridge University Press.
[24]
Dominic P. Mulligan, Scott Owens, Kathryn E. Gray, Tom Ridge, and Peter Sewell. 2014. Lem: Reusable Engineering of Real-world Semantics. In Proc. of the 19th ACM SIGPLAN International Conference on Functional Programming (ICFP ’14). ACM, 175–188.
[25]
Flemming Nielson, Hanne R. Nielson, and Chris Hankin. 1999. Principles of Program Analysis. Springer-Verlag.
[26]
Michael Norrish. 1998. C formalised in HOL. Technical Report UCAM-CL-TR-453. University of Cambridge, Computer Laboratory.
[27]
Scott Owens. 2008. A Sound Semantics for OCamllight. In Proc. of 17th European Symposium on Programming, ESOP 2008. Springer LNCS vol. 4960, 1–15.
[28]
Jens Palsberg. 1995. Closure Analysis in Constraint Form. ACM Transactions on Programming Languages and Systems (TOPLAS) 17, 1 (1995), 47–62.
[29]
Frank Pfenning and Carsten Schürmann. 1999. System Description: Twelf - A Meta-Logical Framework for Deductive Systems. In Proc. of 16th International Conference on Automated Deduction (CADE-16). 202–206.
[30]
Gordon Plotkin. 1981. A Structural Approach to Operational Semantics. Technical Report FN-19. DAIMI, Aarhus University.
[31]
Grigore Roşu. 2017. Matching Logic. Logical Methods in Computer Science 13, 4 (2017), 1–61.
[32]
Grigore Roşu and Traian Florin Şerbănuţă. 2010. An Overview of the K Semantic Framework. Journal of Logic and Algebraic Programming 79, 6 (2010), 397–434.
[33]
David A. Schmidt. 1995. Natural-semantics-based Abstract Interpretation (preliminary version). In Proc. of 3rd Static Analysis Symposium (SAS’95) . Springer LNCS vol. 983, 1–18.
[34]
David A. Schmidt. 1997a. Abstract Interpretation in the Operational Semantics Hierarchy. BRICS Report Series 4, 2 (1997).
[35]
David A. Schmidt. 1997b. Abstract Interpretation of Small-Step Semantics. In Proc. 5th LOMAPS Workshop on Analysis and Verification of Multiple-Agent Languages . Springer LNCS vol. 1192, 76–99.
[36]
Peter Sewell, Francesco Zappa Nardelli, Scott Owens, Gilles Peskine, Thomas Ridge, Susmit Sarkar, and Rok Strniša. 2010. Ott: Effective Tool Support for the Working Semanticist. Journal of Functional Programming 20, 1 (2010), 71–122.
[37]
Daniele Turi and Gordon Plotkin. 1997. Towards a Mathematical Operational Semantics. In Proc. of 12th Annual IEEE Symposium on Logic in Computer Science (LICS’97) . IEEE, 280–291.
[38]
Tarmo Uustalu. 2013. Coinductive Big-Step Semantics for Concurrency. In Proceedings 6th Workshop on Programming Language Approaches to Concurrency and Communication-cEntric Software, PLACES 2013, Rome, Italy, 23rd March 2013. (EPTCS), Nobuko Yoshida and Wim Vanderbauwhede (Eds.), Vol. 137. 63–78.
[39]
David Van Horn and Matthew Might. 2010. Abstracting Abstract Machines. In Proc. of ACM 2010 Int. Conf. on Functional Programming (ICFP’10) . ACM, 51–62.
[40]
David Van Horn and Matthew Might. 2011. Abstracting Abstract Machines: A Systematic Approach to Higher-order Program Analysis. Commun. ACM 54, 9 (2011), 101–109.

Cited By

View all

Index Terms

  1. Skeletal semantics and their interpretations

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image Proceedings of the ACM on Programming Languages
    Proceedings of the ACM on Programming Languages  Volume 3, Issue POPL
    January 2019
    2275 pages
    EISSN:2475-1421
    DOI:10.1145/3302515
    Issue’s Table of Contents
    This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs International 4.0 License.

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 02 January 2019
    Published in PACMPL Volume 3, Issue POPL

    Permissions

    Request permissions for this article.

    Check for updates

    Badges

    Author Tags

    1. abstract interpretation
    2. programming language
    3. semantics

    Qualifiers

    • Research-article

    Funding Sources

    • EPSRC
    • ANR

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)146
    • Downloads (Last 6 weeks)34
    Reflects downloads up to 05 Jan 2025

    Other Metrics

    Citations

    Cited By

    View all

    View Options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Login options

    Full Access

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media