ACM SIGPLAN Notices · 2013 · 10 citations · 22 references
ComputingComputer EngineeringComputer ScienceComputer ArchitectureFormal MethodsProgramming LanguagesHoare LogicSpecification LanguagesAssembly Language ProgrammingContinuation-passing StyleHoare TriplesIndexingSeparation LogicSpecification Logic
Separation logic is a powerful tool for reasoning about structured, imperative programs that manipulate pointers. However, its application to unstructured, lower-level languages such as assembly language or machine code remains challenging. In this paper we describe a separation logic tailored for this purpose that we have applied to x86 machine-code programs. The logic is built from an assertion logic on machine states over which we construct a specification logic that encapsulates uses of frames and step indexing. The traditional notion of Hoare triple is not applicable directly to unstructured machine code, where code and data are mixed together and programs do not in general run to completion, so instead we adopt a continuation-passing style of specification with preconditions alone. Nevertheless, the range of primitives provided by the specification logic, which include a higher-order frame connective, a novel read-only frame connective, and a 'later' modality, support the definition of derived forms to support structured-programming-style reasoning for common cases, in which standard rules for Hoare triples are derived as lemmas. Furthermore, our encoding of scoped assembly-language labels lets us give definitions and proof rules for powerful assembly-language 'macros' such as while loops, conditionals and procedures. We have applied the framework to a model of sequential x86 machine code built entirely within the Coq proof assistant, including tactic support based on computational reflection.
22
From system F to typed assembly language
Greg Morrisett, David Walker, Karl Crary et al. · ACM Transactions on Programming Languages and Systems · 1999 · 587 citations · Full text
Permission accounting in separation logic
Richard Bornat, Cristiano Calcagno, Peter W. O’Hearn et al. · 2005 · 370 citations
Local Action and Abstract Separation Logic
Cristiano Calcagno, Peter W. O’Hearn, Hongseok Yang · 2007 · 262 citations
Separation and information hiding
Peter W. O’Hearn, Hongseok Yang, John Reynolds · 2004 · 235 citations