【24h】

High-Level Separation Logic for Low-Level Code

机译:底层代码的高层分离逻辑

获取原文

摘要

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.
机译:分离逻辑是用于推理处理指针的结构化命令式程序的强大工具。但是,将其应用于非结构化,底层语言(例如汇编语言或机器代码)仍然具有挑战性。在本文中,我们描述了为此目的而量身定制的分离逻辑,该逻辑已应用于x86机器代码程序。该逻辑是根据机器状态的断言逻辑构建的,我们在该逻辑上构造了一个规范逻辑,该逻辑封装了帧和步索引的用法。 Hoare三元组的传统概念不适用于将代码和数据混合在一起且程序通常无法运行到完整的非结构化机器代码,因此,我们仅采用带有前提条件的规范的连续通过样式。然而,规范逻辑提供的原始类型范围包括高阶框架连接词,新颖的只读框架连接词和后来的模态,支持定义派生形式以支持结构化编程样式推理。通常情况下,Hoare三元组的标准规则被推导为引理。此外,我们对作用域汇编语言标签的编码使我们能够给出强大的汇编语言“宏”的定义和证明规则,例如while循环,条件和过程。我们已将该框架应用于完全在Coq证明助手中构建的顺序x86机器代码模型,包括基于计算反射的策略支持。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号