Abstract
Proof-Carrying Code brings two big challenges to the research field of programming languages. One is to seek more expressive logics or type systems to specify or reason about the properties of low-level or high-level programs. The other is to study the technology of certifying compilation in which the compiler generates proofs for programs with annotations. This paper presents our progress in the above two aspects. A pointer logic was designed for PointerC (a C-like programming language) in our research. As an extension of Hoare logic, our pointer logic expresses the change of pointer information for each statement in its inference rules to support program verification. Meanwhile, based on the ideas from CAP (Certified Assembly Programming) and SCAP (Stack-based Certified Assembly Programming), a reasoning framework was built to verify the properties of object code in a Hoare style. And a certifying compiler prototype for PointerC was implemented based on this framework.
The main contribution of this paper is the design of the pointer logic and the implementation of the certifying compiler prototype. In our certifying compiler, the source language contains rich pointer types and operations and also supports dynamic storage allocation and deallocation.
Similar content being viewed by others
References
Necula G C. Proof-carrying code. In: Proceedings of the 24th ACM SIGPLAN-SIGACT symposium on Principles of programming languages. New York: ACM Press, 1997, 106–119
Morrisett J G, Walker D, Crary K, et al. From system F to typed assembly language. In: Proceedings of the 25th ACM SIGPLAN-SIGACT symposium on Principles of programming languages. New York: ACM Press, 1998, 85–97
Mandelbaum Y, Walker D, Harper R. An effective theory of type refinements. In: Proceedings of the 8th ACM SIGPLAN international conference on Functional programming. New York: ACM Press, 2003, 213–225
Appel A W. Foundational proof-carrying code. In: Proceedings of the 16th Annual IEEE Symposium on Logic in computer science. Washington: IEEE Computer Society, 2001, 247–258
Yu D C, Hamid N A, Shao Z. Building certified libraries for pcc: dynamic storage allocation. Science of Computer Programming, 2004, 50(1–3): 101–127
Feng X Y, Shao Z, Vaynberg A, et al. Modular verification of assembly code with stack-based control abstractions. In: Proceedings of the 2006 ACM SIGPLAN conference on Programming language design and implementation. New York: ACM Press, 2006, 401–414
Xi H W. Applied type system (extended abstract). In: post-workshop Proceedings of TYPES 2003. Lecture Notes in Computer Science, Vol 3085. Berlin: Springer-Verlag, 2004, 394–408
Necula G C, Lee P. The design and implementation of a certifying compiler. In: Proceedings of the 1998 ACM SIGPLAN Conference on Prgramming language design and implementation. New York: ACM Press, 1998, 333–344
Colby C, Lee P, Necula G C, et al. A certifying compiler for Java. ACM SIGPLAN Notices, 2000, 35(5): 95–107
Reynolds J C. Separation logic: A logic for shared mutable data structures. In: Proceedings of the 17th Annual IEEE Symposium on Logic in computer science. Washington: IEEE Computer Society, 2002, 55–74
Dijkstra E W. A discipline of programming. Englewood Cliffs, New Jersey: Prentice-Hall, 1976
Steensgaard B. Points-to analysis in almost linear time. In: Proceedings of the 23rd ACM SIGPLAN-SIGACT symposium on Principles of programming languages. New York: ACM Press, 1996, 32–41
Berndl M, Lhoták O, Qian F, et al. Points-to analysis using BDDs. In: Proceedings of the 2003 ACM SIGPLAN Conference on Programming language design and implementation. New York: ACM Press, 2003, 103–114
Hind M. Pointer analysis: haven’t we solved this problem yet? In: Proceedings of the 2001 ACM SIGPLAN-SIGSOFT workshop on Program analysis for software tools and engineering. New York: ACM Press, 2001, 54–61
Bornat R. Proving pointer programs in Hoare logic. In: Proceedings of the 5th International Conference on Mathematics of program construction. London: Springer-Verlag, 2000, 102–126
Burstall R M. Some techniques for proving correctness of programs which alter data structures. Machine Intelligence, New York: American Elsevier, 1972, 7:23–50
Mehta F, Nipkow T. Proving pointer programs in higher-order logic. Information and Computation, 2005, 199(1–2): 200–227
Filliâtre J C, Marché C. Multi-Prover Verification of C Programs. In: Proceedings of the 6th International conference on formal engineering methods. Seattle: Springer-Verlag, 2004, 15–29
Moore J S. Piton: a mechanically verified assembly-language. Norwell: Kluwer Academic Publishers, 1996
Leroy X. Formal certification of a compiler back-end or programming a compiler with a proof assistant. In: Conference record of the 33rd ACM SIGPLAN-SIGACT symposium on Principles of programming languages. New York: ACM Press, 2006, 42–54
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Chen, Y., Ge, L., Hua, B. et al. A pointer logic and certifying compiler. Front. Comput. Sc. China 1, 297–312 (2007). https://doi.org/10.1007/s11704-007-0029-9
Received:
Accepted:
Issue Date:
DOI: https://doi.org/10.1007/s11704-007-0029-9