作用域逻辑:扩展霍尔逻辑用于指针程序验证
Scope Logic: Extending Hoare Logic for Pointer Program Verification
摘要:
本文提出了一种扩展霍尔逻辑的指针程序验证方法。首先,对VDM使用的部分函数逻辑(LPF)进行扩展,以指定使用指针的存储器访问和复合类型的存储器布局。然后,本文介绍了数据检索函数(DRF)和内存作用域函数(MSF)的概念。人们可以定义DRF来从互连的具体数据对象中检索抽象值。DRF的对应MSF的定义可以从DRF的定义在语法上导出。这个MSF计算当DRF检索抽象值时访问的内存单元集。这个内存单元集称为抽象值的内存范围。最后,对Hoare逻辑中赋值语句的证明规则进行了修改,使之适用于指针。其基本思想是,只要其作用域中没有内存单元被重写,虚值就保持不变。另一个证明规则是为内存分配语句添加的。结果规则和控制流语句的规则略有修改。它们与霍尔逻辑中的原始版本基本相同。一个例子来显示这种逻辑的有效性。并给出了指针程序验证的一些技巧。
英文摘要:
This paper presents an extension to Hoare logic for pointer program verification. First, the Logic for Partial Function (LPF) used by VDM is extended to specify memory access using pointers and memory layout of composite types. Then, the concepts of data-retrieve functions (DRF) and memory-scope functions (MSF) are introduced in this paper. People can define DRFs to retrieve abstract values from interconnected concrete data objects. The definition of the corresponding MSF of a DRF can be derived syntactically from the definition of the DRF. This MSF computes the set of memory units accessed when the DRF retrieves an abstract value. This memory unit set is called the memory scope of the abstract value. Finally, the proof rule of assignment statements in Hoare's logic is modified to deal with pointers. The basic idea is that a virtual value keeps unmodified as long as no memory unit in its scope is over-written. Another proof rule is added for memory allocation statements. The consequence rule and the rules for control-flow statements are slightly modified. They are essentially same as their original version in Hoare logic. An example is presented to show the efficacy of this logic. We also give some heuristics on how to verify pointer programs.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。