Refinement-Based Game Semantics for Certified Abstraction Layers∗

Refinement-Based Game Semantics for Certified Abstraction Layers∗

Refinement-Based Game Semantics for Certified Abstraction Layers∗ Jérémie Koenig Zhong Shao Yale University Yale University [email protected] [email protected] Abstract ACM Reference Format: Formal methods have advanced to the point where the func- Jérémie Koenig and Zhong Shao. 2020. Refinement-Based Game tional correctness of various large system components has Semantics for Certified Abstraction Layers. In Proceedings of the 35th Annual ACM/IEEE Symposium on Logic in Computer Science been mechanically verified. However, the diversity of seman- (LICS ’20), July 8–11, 2020, Saarbrücken, Germany. ACM, New York, tic models used across projects makes it difficult to connect NY, USA, 15 pages. https://doi.org/10.1145/3373718.3394799 these component to build larger certified systems. Given this, we seek to embed these models and proofs into a general- purpose framework where they could interact. We believe that a synthesis of game semantics, the refinement calculus, 1 Introduction and algebraic effects can provide such a framework. Certified software [43] is software accompanied by mecha- To combine game semantics and refinement, we replace nized, machine-checkable proofs of correctness. To construct the downset completion typically used to construct strategies a certified program, we must not only write its code ina from posets of plays. Using the free completely distributive given programming language, but also formally specify its completion, we construct strategy specifications equipped intended behavior and construct, using specialized tools, evi- with arbitrary angelic and demonic choices and ordered by dence that the program indeed conforms to the specification. a generalization of alternating refinement. This provides a novel approach to nondeterminism in game semantics. 1.1 Certified systems at scale Connecting algebraic effects and game semantics, we in- The past decade has seen an explosion in the scope and scale terpret effect signatures as games and define two categories of practical software verification. Researchers have been of effect signatures and strategy specifications. The resulting able to produce certified compilers [30], program logics [8], models are sufficient to represent the behaviors of a variety operating system kernels [22, 28], file systems [15] and more, of low-level components, including the certified abstraction often introducing new techniques and mathematical models. layers used to verify the operating system kernel CertiKOS. In this context, there has been increasing interest in making these components interoperable and combining them—and CCS Concepts: • Theory of computation ! Logic and their proofs of correctness—into larger certified systems. verification; Program specifications; Program verifica- This is exemplified by the DeepSpec project [9], which tion; • Software and its engineering ! Formal soft- seeks to connect various components specified and verified ware verification; Functionality; Abstraction, model- in the Coq proof assistant. The key idea behind DeepSpec ing and modularity. is to interpret specifications as interfaces between compo- Keywords: certified abstraction layers; dual nondetermin- nents. When a component providing a certain interface has ism; game semantics; strategy specification; program refine- been verified, client components can rely on this for their ment; interaction specification; algebraic effects own proofs of correctness. Standardizing this process would ∗Minor revision published by the authors on June 24, 2020 make it possible to construct large-scale certified systems by assembling off-the-shelf certified components. Permission to make digital or hard copies of all or part of this work for To an extent, these principles are already demonstrated personal or classroom use is granted without fee provided that copies in the structure of the certified C compiler CompCert [30], 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 where the semantics of intermediate languages serve as inter- for components of this work owned by others than the author(s) must mediate specifications for each compilation pass. The correct- be honored. Abstracting with credit is permitted. To copy otherwise, or ness of each pass is established by proving that the behavior republish, to post on servers or to redistribute to lists, requires prior specific of its target program refines that of its source program. As permission and/or a fee. Request permissions from [email protected]. passes are composed to obtain the overall C-to-assembly LICS ’20, July 8–11, 2020, Saarbrücken, Germany compiler, the correctness proofs are composed as well to © 2020 Copyright held by the owner/author(s). Publication rights licensed to ACM. construct a correctness proof for the whole compiler. The ACM ISBN 978-1-4503-7104-9/20/07...$15.00 final theorem does not mention the intermediate programs https://doi.org/10.1145/3373718.3394799 or language semantics, so that a user only needs to trust the LICS ’20, July 8–11, 2020, Saarbrücken, Germany Jérémie Koenig and Zhong Shao accuracy of the C and assembly semantics, and the soundness makes this approach broadly applicable, and the typed as- of the proof assistant. pect of the resulting models makes it ideal to the task of Building on this precedent, the CertiKOS verification ef- describing the behavior of heterogeneous systems. fort [22–24] divided the kernel into several dozen abstraction However, the generality of game models often translates to layers which were then specified and verified individually. a fair amount of complexity, which imposes a high barrier to Layer specifications provide an abstract view of a layer’s entry for practitioners and makes them difficult to formalize functionality, hiding the procedural details and low-level in a proof assistant. While more restricted, the framework data representations involved in its implementation. Client of algebraic effects [40] is sufficient for many modeling tasks, code can be verified in terms of this abstract view in order fits within the well-known monadic approach to effectful to build higher-level layers. Certified layers with compatible and interactive computations, and can be adapted into a interfaces can then be chained together in the way passes particularly simple version of game semantics. Along these of a compiler can be composed when the target language of lines, interaction trees [46] have been developed for use in one corresponds to the source language of the other. and across several DeepSpec projects. Finally, while game models have been proposed for a wide 1.2 Semantic models for verification variety of programming languages, there has been compara- tively less focus on specifications and correctness properties. While this approach is compelling, there are difficulties asso- By contrast, the general approach of stepwise refinement sug- ciated with extending it to build larger-scale certified systems gests a uniform treatment of programs, specifications and by connecting disparate certified components. A key aspect their relationships. It has been studied extensively in the enabling composition in CompCert and CertiKOS is the uni- context of predicate transformer semantics [20] and in the formity of the models underlying their language semantics framework known as the refinement calculus [11]. and correctness proofs. By contrast, across projects there exist a great diversity of semantic models and verification techniques. This makes it difficult to formulate interface spec- 1.4 Contributions ifications to connect specific components, let alone devising Our central claim is that a synthesis of game semantics, al- a general system to express such interfaces. gebraic effects, and the refinement calculus can be usedto Worse yet, this diversity is not simply a historical accident. construct a hierarchy of semantic models suitable for con- The semantic models used in the context of individual verifi- structing large-scale, heterogeneous certified systems. To cation projects are often carefully chosen to make the verifi- provide evidence for this claim, we outline general tech- cation task tractable. The semantic model used in CompCert niques which can realize this synthesis and demonstrate alone has changed multiple times, addressing new require- their use in the context of certified abstraction layers: ments and techniques that were introduced alongside new compiler features and optimizations [31]. Given the difficulty • We adapt the work of Morris and Tyrrell [35, 36], of verification, preserving this flexibility is essential. which extends the refinement calculus to the level of Then, to make it possible to link components verified terms by using free completely distributive completions using a variety of paradigms, we need to identify a model of posets, to investigate dual nondeterminism in the expressive enough to embed the semantics, specifications context of game semantics and construct completely and correctness proofs of a variety of paradigms. distributive lattices of strategy specifications, partially ordered under a form of alternating refinement [7]. • In §3, we define a version of the free monad on an effect 1.3 General models for system behaviors signature which incorporates dual nondeterminism Fortunately, there is a wealth of semantics research to draw and refinement. The result can be used to formulate from when attempting to design models for this task. a theory

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    15 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us