形状图逻辑的定理证明.docVIP

  • 3
  • 0
  • 约3.01万字
  • 约 25页
  • 2016-11-02 发布于天津
  • 举报
形状图逻辑的定理证明

形状图理论的定理证明及其在指针程序验证中的应用 (中国科学技术大学 计算机科学与技术学院,安徽 合肥 230026??) (中国科学技术大学 苏州研究院软件安全实验室,江苏 苏州215123) 摘要:我们提出一种直接把形状图作为程序中指针断言的形状图逻辑。它是Hoare逻辑的一种扩展,可用于对操作易变数据结构的指针程序的分析和验证。 形状图逻辑、形状分析、程序验证、自动定理证明、循环不变式的推断 1、引言consists of using a formal version of mathematical reasoning about software systems, usually using theorem proving software such as interactive theorem provers Isabelle/HOL[6] or Coq[7], or SMT(Satisfiability Modulo Theories) solver Z3[8]。 基于逻辑推理的形式验证方法对自动定理证明有较高的期待。首先,定理证明在程序验证中无处不用。大到验证条件的证明和循环不变式的推断,小到下标变量的别名判断和array bound checking,都需要或可以使用定理证明。其次,需要各种领域专用逻辑的定理证明器。普通程序的代码可能涉及多种数据类型,操作系统的代码可能依赖于硬件特性,为完成对这些程序的验证,需要面向各种数据类型和硬件特性的领域专用逻辑及其定理证明器。第三,需要定理证明器能处理各种理论的组合。例如面向数组类型的array logic,它由index logic和element logic组成。对于操作数组的程序的验证,定理证明器要能证明这两种逻辑相应理论(可能还包括等式理论和未解释函数理论)的组合理论上的定理。组合理论问题的复杂在于:即使两个理论分别可判定,它们的组合理论未必可判定。数组理论就是这样的一个例子。The Nelson-Oppen framework[9] allows generic combinations of quantifier-free theories, and has been used in implementations of combinations of theories using a SAT solver. The verification of programs that dynamically allocate memory and manipulate them using pointers (i.e. heap-manipulating programs ) are very difficult. 首先,表达程序性质的函数前后条件尤其是循环不变式难以给出。因为它们需要talk about所操作的数据结构的结构性质(often requiring quantifications and reachability predicates),还有在数据结构各节点上的数据的性质,而这些性质的描述可能紧紧依赖于数据结构的结构性质,例如二叉排序树、AVL树和红黑树。其次,这类程序的验证条件难以证明。因为some form of universal quantification over all nodes of a data structure usually appears in verification conditions,this immediately rules out classical combinations of theories, like the Nelson-Oppen scheme[9], which caters only to quantifier-free theories。除了量词以及理论组合外,验证条件的证明可能还要用到数据结构的归纳理论。例如,对于一般情况下用左子树的最右叶节点来代替根节点的删除二叉排序树根节点的函数,要证明结果仍然是二叉排序树,需要用到两个性质:左子树上的任何值一定小于右子树上的所有值,左子树上最右叶节点的值大于左子树上其他任何值。它们都是二叉排序树的归纳性质,不是基于演绎推理的定理证明器从二叉排序树的归纳定义可以证明的。 Most research on program logics for verification of heap-manipulating programs can be divided into two categories: logic for manual/semi-automatic reasoning and completely automated reasoni

文档评论(0)

1亿VIP精品文档

相关文档