Automatic verification of pointer programs using monadic second-order logic
- 1 May 1997
- proceedings article
- Published by Association for Computing Machinery (ACM)
- Vol. 32 (5), 226-234
- https://doi.org/10.1145/258915.258936
Abstract
We present a technique for automatic verification of pointer programs based on a decision procedure for the monadic second-order logic on finite strings.We are concerned with a while-fragment of Pascal, which includes recursively-defined pointer structures but excludes pointer arithmetic.We define a logic of stores with interesting basic predicates such as pointer equality, tests for nil pointers, and garbage cells, as well as reachability along pointers.We present a complete decision procedure for Hoare triples based on this logic over loop-free code. Combined with explicit loop invariants, the decision procedure allows us to answer surprisingly detailed questions about small but non-trivial programs. If a program fails to satisfy a certain property, then we can automatically supply an initial store that provides a counterexample.Our technique had been fully and efficiently implemented for linear linked lists, and it extends in principle to tree structures. The resulting system can be used to verify extensive properties of smaller pointer programs and could be particularly useful in a teaching environment.Keywords
This publication has 13 references indexed in Scilit:
- Alias analysis of pointers in Pascal and Fortran 90: dependence analysis between pointer referencesActa Informatica, 1996
- Solving shape-analysis problems in languages with destructive updatingPublished by Association for Computing Machinery (ACM) ,1996
- Is it a tree, a DAG, or a cyclic graph? A shape analysis for heap-directed pointers in CPublished by Association for Computing Machinery (ACM) ,1996
- Semantic models and abstract interpretation techniques for inductive data structures and pointersPublished by Association for Computing Machinery (ACM) ,1995
- LCLintPublished by Association for Computing Machinery (ACM) ,1994
- Interprocedural may-alias analysis for pointersPublished by Association for Computing Machinery (ACM) ,1994
- Graph typesPublished by Association for Computing Machinery (ACM) ,1993
- Inferring the equivalence of functional programs that mutate dataTheoretical Computer Science, 1992
- A safe approximate algorithm for interprocedural aliasingPublished by Association for Computing Machinery (ACM) ,1992
- Parallelizing programs with recursive data structuresIEEE Transactions on Parallel and Distributed Systems, 1990