Abstract
In this paper, we introduce a new way of certifying assembly programs. Unlike previous program logics, we extract the control-flow information from the code and generate an intermediate trail between the specification and the real code. Trails are auxiliary specifications and treated as modules in the certification process. We define a simple modular program logic called trail-based certified assembly programming (TCAP) to certify and link different parts of a program using the corresponding trails. Because the control flow information in trails is explicit, the rules are easier to design. We show that our logic is powerful enough to prove partial correctness of assembly programs with features including stack-based abstractions and self-modifying code.We also provide a semantics for TCAP and prove that the logic is sound with respect to the semantics.
Similar content being viewed by others
References
Necula G. Proof-carrying code. In: Proceedings of 24th ACM Symposium on Principles of Programming Languages. 1997, 106–119
Hoare C A R. An axiomatic basis for computer programming. Communications of the ACM, 1969, 12(10): 576–580
Necula G. Compiling with proofs. Dissertation for the Doctoral Degree. Pittsburgh: Carnegie Mellon University, 1998
Morrisett G, Walker D, Crary K, Glew N. From system F to typed assembly language. In: Proceedings of 25th ACM SIGPLANSIGACT Symposium on Principles of Programming Languages. 1998, 85–97
Appel A W. Foundational proof-carrying code. In: Proceedings of 2001 Symposium on Logic in Computer Science. 2001, 247–258
Ni Z, Shao Z. Certified assembly programming with embedded code pointers. In: Proceedings of 33rd ACM Symposium on Principles of Programming Languages. 2006, 320–333
Glew N, Morrisett G. Type-safe linking and modular assembly language. In: Proceedings of 26th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. 1999, 250–261
Feng X, Shao Z, Vaynberg A, Xiang S, Ni Z. Modular verification of assembly code with Stack-based control abstractions. In: Proceedings of 2006 ACM SIGPLAN Conference on Programming Language Design and Implementation. 2006, 401–414
The Coq Development Team. The Coq proof assistant reference manual, The Coq release v8.0, http://coq.inria.fr/10. Cai H, Shao Z, Vaynberg A. Certified self-modifying code. In: Proceedings of 2007 ACM SIGPLAN Conference on Programming Language Design and Implementation. 2007, 66–77
Morrisett G, Crary K, Glew N, Grossman D, Samuels R, Smith F, Walker D, Weirich S, Zdancewic S. TALx86: a realistic typed assembly language. In: Proceedings of 1999 ACM SIGPLAN Workshop on Compiler Support for System Software. 1999, 25–35
Jones C B. Tentative steps toward a development method for interfering programs. ACM Transactions on Programming Languages and Systems, 1983, 5(4): 596–619
Calcagno C, O’hearn P W, Yang H. Local action and abstract separation logic. In: Proceedings of 22nd Annual IEEE Symposium on Logic in Computer Science. 2007, 366–378
Shivers O. Control-flow analysis of higher-order languages. Dissertation for the Doctoral Degree. Pittsburgh: Carnegie-Mellon University, 1991
Vardoulakis D, Shivers O. CFA2: a context-free approach to control-flow analysis. In: Proceedings of European Symposium on Programming. 2010, 570–589
Tan G, Appel A W. A compositional logic for control flow. In: Proceedings of 7th International Conference on Verification, Model Checking and Abstract Interpretation. 2006, 80–94
Author information
Authors and Affiliations
Corresponding author
Additional information
Wei Wang is a fourth-year PhD student in the department of computer science at the University of Science and Technology of China, supervised by Prof. Yiyun Chen. His research interests include programming languages and formal methods. In particular, Wei is interested in developing theories, programming languages, and tools to build formally certified assembly programs, with rigorous safety and correctness guarantees.
Rights and permissions
About this article
Cite this article
Wang, W. Certifying assembly programs with trails. Front. Comput. Sci. China 5, 472–485 (2011). https://doi.org/10.1007/s11704-011-0166-z
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11704-011-0166-z