Chapter

Computer Aided Verification

Volume 8044 of the series Lecture Notes in Computer Science pp 756-772

Effectively-Propositional Reasoning about Reachability in Linked Data Structures

  • Shachar ItzhakyAffiliated withTel Aviv University
  • , Anindya BanerjeeAffiliated withIMDEA Software Institute
  • , Neil ImmermanAffiliated withUniversity of Massachusetts
  • , Aleksandar NanevskiAffiliated withIMDEA Software Institute
  • , Mooly SagivAffiliated withTel Aviv University

* Final gross prices may vary according to local VAT.

Get Access

Abstract

This paper proposes a novel method of harnessing existing SAT solvers to verify reachability properties of programs that manipulate linked-list data structures. Such properties are essential for proving program termination, correctness of data structure invariants, and other safety properties. Our solution is complete, i.e., a SAT solver produces a counterexample whenever a program does not satisfy its specification. This result is surprising since even first-order theorem provers usually cannot deal with reachability in a complete way, because doing so requires reasoning about transitive closure.

Our result is based on the following ideas: (1) Programmers must write assertions in a restricted logic without quantifier alternation or function symbols. (2) The correctness of many programs can be expressed in such restricted logics, although we explain the tradeoffs. (3) Recent results in descriptive complexity can be utilized to show that every program that manipulates potentially cyclic, singly- and doubly-linked lists and that is annotated with assertions written in this restricted logic, can be verified with a SAT solver.

We implemented a tool atop Z3 and used it to show the correctness of several linked list programs.