Skip to main content
Log in

A pointer logic and certifying compiler

  • Research Article
  • Published:
Frontiers of Computer Science in China Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Subscribe and save

Springer+
from $39.99 /Month
  • Starting from 10 chapters or articles per month
  • Access and download chapters and articles from more than 300k books and 2,500 journals
  • Cancel anytime
View plans

Buy Now

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. 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

    Chapter  Google Scholar 

  2. 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

    Chapter  Google Scholar 

  3. 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

    Google Scholar 

  4. 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

    Chapter  Google Scholar 

  5. 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

    Article  MATH  Google Scholar 

  6. 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

    Chapter  Google Scholar 

  7. 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

    Google Scholar 

  8. 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

    Chapter  Google Scholar 

  9. Colby C, Lee P, Necula G C, et al. A certifying compiler for Java. ACM SIGPLAN Notices, 2000, 35(5): 95–107

    Article  Google Scholar 

  10. 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

    Chapter  Google Scholar 

  11. Dijkstra E W. A discipline of programming. Englewood Cliffs, New Jersey: Prentice-Hall, 1976

  12. 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

    Chapter  Google Scholar 

  13. 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

    Chapter  Google Scholar 

  14. 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

    Chapter  Google Scholar 

  15. 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

    Chapter  Google Scholar 

  16. Burstall R M. Some techniques for proving correctness of programs which alter data structures. Machine Intelligence, New York: American Elsevier, 1972, 7:23–50

    Google Scholar 

  17. Mehta F, Nipkow T. Proving pointer programs in higher-order logic. Information and Computation, 2005, 199(1–2): 200–227

    Article  MATH  Google Scholar 

  18. 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

    Google Scholar 

  19. Moore J S. Piton: a mechanically verified assembly-language. Norwell: Kluwer Academic Publishers, 1996

    Google Scholar 

  20. 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

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Ge Lin.

Rights and permissions

Reprints 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

Download citation

  • Received:

  • Accepted:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11704-007-0029-9

Keywords