Safe Modification of Pointer Programs in Refinement Calculus
This paper discusses stepwise refinement of pointer programs in the framework of refinement calculus. We augment the underlying logic with formulas of separation logic and then introduce a pair of new predicate transformers, called separating assertion and separating assumption. The new predicate transformers are derived from separating conjunction and separating implication, which are fundamental logical connectives in separation logic. They represent primitive forms of heap allocation/deallocation operators and the basic pointer statements can be specified by means of them. We derive several refinement laws that are useful for stepwise refinement and demonstrate the use of the laws in the context of correctness preserving transformations that are intended for improved memory usage.
The formal development is carried out in the framework of higher-order logic and is based on Back and Preoteasa’s axiomatization of state space and its extension to the heap storage [BP05, Pre06]. All the results have been implemented and verified in the theorem prover PVS.
KeywordsPointer Program Separation Logic Predicate Transformer Local Scope Refinement Calculus
Unable to display preview. Download preview PDF.
- [BFP03]Back, R.-J., Fan, X., Preoteasa, V.: Reasoning about pointers in refinement calculus. In: 10th Asia-Pacific Software Engineering Conference (APSEC 2003), pp. 425–434 (2003)Google Scholar
- [BvW98]Back, R.-J., von Wright, J.: Graduate Texts in Computer Science. In: Refinement Calculus: A Systematic Introduction, Springer, Heidelberg (1998)Google Scholar
- [COY07]Calcagno, C., O’Hearn, P.W., Yang, H.: Local action and abstract separation logic. In: 22nd IEEE Symposium on Logic in Computer Science (LICS 2002), pp. 366–378. IEEE Computer Society, Los Alamitos (2007)Google Scholar
- [Gro00]Groves, L.J.: Evolutionary Software Development in the Refinement Calculus. PhD thesis, Victoria University of Wellington (2000)Google Scholar
- [LvW97]Laibinis, L., von Wright, J.:Context handling in the refinement calculus framework. Technical Report 118, TUCS Technical Report (1997)Google Scholar
- [SRSC01]Shankar, N., Rushby, J.M., Stringer-Calvert, D.W.J.: PVS Language Reference. Computer Science Laboratory, SRI International (November 2001), http://pvs.csl.sri.com/