Blom Stefan, Huisman Marieke
University of Twente, Enschede, The Netherlands.
Int J Softw Tools Technol Transf. 2015;17(6):757-781. doi: 10.1007/s10009-015-0372-3. Epub 2015 Mar 31.
This paper discusses static verification of programs that have been specified using separation logic with magic wands. Magic wands are used to specify in separation logic, i.e., if missing resources are provided, a magic wand allows one to exchange these for the completed resources. One of the applications of the magic wand operator is to describe loop invariants for algorithms that traverse a data structure, such as the imperative version of the (Challenge 3 from the VerifyThis@FM2012 Program Verification Competition), which is the motivating example for our work. Most separation logic-based static verification tools do not provide support for magic wands, possibly because validity of formulas containing the magic wand is, by itself, undecidable. To avoid this problem, in our approach the program annotator has to provide a for the magic wand, thus circumventing undecidability due to the use of magic wands. A witness is an object that encodes both instructions for the permission exchange that is specified by the magic wand and the extra resources needed during that exchange. We show how this witness information is used to encode a specification with magic wands as a specification without magic wands. Concretely, this approach is used in the VerCors tool set: annotated Java programs are encoded as Chalice programs. Chalice then further translates the program to BoogiePL, where appropriate proof obligations are generated. Besides our encoding of magic wands, we also discuss the encoding of other aspects of annotated Java programs into Chalice, and in particular, the encoding of abstract predicates with permission parameters. We illustrate our approach on the tree delete algorithm, and on the verification of an iterator of a linked list.
本文讨论了使用带魔杖的分离逻辑指定的程序的静态验证。魔杖用于在分离逻辑中进行指定,即,如果提供了缺失的资源,魔杖允许将这些资源交换为完整的资源。魔杖运算符的应用之一是描述遍历数据结构的算法的循环不变式,例如imperative版本的(VerifyThis@FM2012程序验证竞赛中的挑战3),这是我们工作的激励示例。大多数基于分离逻辑的静态验证工具不支持魔杖,可能是因为包含魔杖的公式的有效性本身是不可判定的。为了避免这个问题,在我们的方法中,程序注释器必须为魔杖提供一个见证,从而规避由于使用魔杖而导致的不可判定性。见证是一个对象,它对魔杖指定的权限交换指令以及该交换过程中所需的额外资源进行编码。我们展示了如何使用这个见证信息将带有魔杖的规范编码为不带有魔杖的规范。具体来说,这种方法用于VerCors工具集:带注释的Java程序被编码为Chalice程序。然后Chalice将程序进一步翻译成BoogiePL,并在其中生成适当的证明义务。除了我们对魔杖的编码,我们还讨论了将带注释的Java程序的其他方面编码到Chalice中的方法,特别是带有权限参数的抽象谓词的编码。我们在树删除算法以及链表迭代器的验证上说明了我们的方法。