Data Refinement with Low-Level Pointer Operations
We present a method for proving data refinement in the presence of low-level pointer operations, such as memory allocation and deallocation, and pointer arithmetic. Surprisingly, none of the existing methods for data refinement, including those specifically designed for pointers, are sound in the presence of low-level pointer operations. The reason is that the low-level pointer operations allow an additional potential for obtaining the information about the implementation details of the module: using memory allocation and pointer comparison, a client of a module can find out which cells are internally used by the module, even without dereferencing any pointers. The unsoundness of the existing methods comes from the failure of handling this potential. In the paper, we propose a novel method for proving data refinement, called power simulation, and show that power simulation is sound even with low-level pointer operations.
KeywordsPower Relation Free Cell Memory Allocation Admissibility Condition Forward Simulation
Unable to display preview. Download preview PDF.
- 6.He, J., Hoare, C.A.R., Sanders, J.W.: Data refinement refined. In: Robinet, B., Wilhelm, R. (eds.) ESOP 1986. LNCS, vol. 213, pp. 187–196. Springer, Heidelberg (1986)Google Scholar
- 8.Hogg, J.: Islands: Aliasing protection in object-oriented languages. In: OOPLA 1991, pp. 271–285. ACM Press, New York (1991)Google Scholar
- 13.Mijajlovic, I., Yang, H.: Data refinement with low-level pointer operations. Manuscript (2005), Available at http://ropas.snu.ac.kr/~hyang/paper/full-ps.ps
- 14.Naumann, D., Barnett, M.: Towards imperative modules: Reasoning about invariants and sharing of mutable state. In: LICS 2004, pp. 313–323. IEEE, Los Alamitos (2004)Google Scholar
- 16.Reddy, U.S.: Talk at MFPS 2000. Hokoken, New Jersey (2000)Google Scholar
- 18.Reynolds, J.C.: Separation logic: A logic for shared mutable data structures. In: LICS 2002, vol. 17, pp. 55–74. IEEE, Copenhagen (2002)Google Scholar