Abstract
Proof-carrying code (PCC) is a general framework for verifying the safety properties of machine-language programs. PCC proofs are usually written in a logic extended with language-specific typing rules; they certify safety but only if there is no bug in the typing rules. In foundational proof-carrying code (FPCC), on the other hand, proofs are constructed and verified by using strictly the foundations of mathematical logic, with no type-specific axioms. FPCC is more flexible and secure because it is not tied to any particular type system and it has a smaller trusted base. Foundational proofs, however, are much harder to construct. Previous efforts on FPCC all required building sophisticated semantic models for types. Furthermore, none of them can be easily extended to support mutable fields and recursive types. In this article, we present a syntactic approach to FPCC that avoids all of these difficulties. Under our new scheme, the foundational proof for a typed machine program simply consists of the typing derivation plus the formalized syntactic soundness proof for the underlying type system. The former can be readily obtained from a type-checker, while the latter is known to be much easier to construct than the semantic soundness proofs. We give a translation from a typed assembly language into FPCC and demonstrate the advantages of our new system through an implementation in the Coq proof assistant.
Similar content being viewed by others
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.References
Ahmed, A. J.: Mutable fields in a semantic model of types, Talk presented at 2000 PCC Workshop, June 2000.
Ahmed, A. J., Appel, A. W. and Virga, R.: A stratified semantics of general references embeddable in higher-order logic, in Proceedings 17th Annual IEEE Symposium on Logic in Computer Science, June 2002, pp. 75–86.
Appel, A. W.: Foundational proof-carrying code, in Proceedings 16th Annual IEEE Symposium on Logic in Computer Science, June 2001, pp. 247–258.
Appel, A. W. and Felten, E. W.: Models for security policies in proof-carrying code, Technical Report CS-TR-636-01, Department of Computer Science, Princeton University, Mar. 2001.
Appel, A. W. and Felty, A. P.: A semantic model of types and machine instructions for proof-carrying code, in Proceedings 27th ACM Symposium on Principles of Programming Languages, ACM Press, 2000, pp. 243–253.
Appel, A. W. and McAllester, D.: An indexed model of recursive types for foundational proofcarrying code, ACM Trans. on Programming Languages and Systems 23(5) (Sept. 2001), 657–683.
Colby, C., Lee, P., Necula, G., Blau, F., Plesko, M.and Cline, K.: A certifying compiler for Java, in Proceedings 2000 ACMConference on Programming Language Design and Implementation, ACM Press, New York, 2000, pp. 95–107.
Coquand, T. and Huet, G.: The calculus of constructions, Inform. and Comput. 76 (1988), 95–120.
Felty, A.: Semantic models of types and machine instructions for proof-carrying code, Talk presented at 2000 PCC Workshop, June 2000.
Grossman, D., Morrisett, G. and Zdancewic, S.: Syntactic type abstraction, ACM Trans. on Programming Languages and Systems 22(6) (Nov. 2000), 1037–1080.
Howard, W. A.: The formulae-as-types notion of constructions, in To H. B. Curry: Essays on Computational Logic, Lambda Calculus and Formalism, Academic Press, 1980.
League, C., Shao, Z. and Trifonov, V.: Precision in practice: A type-preserving Java compiler, in Proceedings 12th International Conference on Compiler Construction, Lecture Notes in Comput. Sci. 2622, Springer-Verlag, Heidelberg, 2003, pp. 106–120.
Michael, N. and Appel, A.: Machine instruction syntax and semantics in higher order logic, in Proceedings 17th International Conference on Automated Deduction, Springer-Verlag, June 2000, pp. 7–24.
Morrisett, G., Crary, K., Glew, N. and Walker, D.: Stack-based typed assembly language, in X. Leroy and A. Ohori (eds), Proceedings 1998 International Workshop on Types in Compilation, Kyoto, Japan, Lecture Notes in Comput. Sci. 1473, Springer-Verlag, March 1998, pp. 28–52.
Morrisett, G., Walker, D., Crary, K. and Glew, N.: From System F to typed assembly language, in Proceedings 25th ACM Symposium on Principles of Programming Languages, ACM Press, Jan. 1998, pp. 85–97.
Necula, G.: Proof-carrying code, in Proceedings 24th ACM Symposium on Principles of Programming Languages, ACM Press, New York, Jan. 1997, pp. 106–119.
Necula, G.: Compiling with proofs, PhD thesis, School of Computer Science, Carnegie Mellon University, Sept. 1998.
Necula, G. and Lee, P.: Safe kernel extensions without run-time checking, in Proceedings 2nd USENIX Symp. on Operating System Design and Impl., 1996, pp. 229–243.
Necula, G. and Lee, P.: The design and implementation of a certifying compiler, in Proceedings 1998 ACM Conference on Programming Language Design and Implementation, New York, 1998, pp. 333–344.
Paulin-Mohring, C.: Inductive definitions in the system Coq – rules and properties, in M. Bezem and J. Groote (eds), Proceedings TLCA, Lecture Notes in Comput. Sci. 664, Springer-Verlag, 1993.
Shao, Z., Saha, B., Trifonov, V. and Papaspyrou, N.: A type system for certified binaries, in Proceedings 29th ACM Symposium on Principles of Programming Languages, ACM Press, Jan. 2002, pp. 217–232.
Swadi, K. N. and Appel, A.W.: Typed machine language and its semantics, Preliminary version available at www.cs.princeton.edu/∼appel/papers/tml.pdf, July 2001.
The Coq Development Team: The Coq proof assistant reference manual. The Coq release v7.1, Oct. 2001.
Trifonov, V., Saha, B. and Shao, Z.: Fully reflexive intensional type analysis, in Proceedings 2000 ACM International Conference on Functional Programming, ACM Press, Sept. 2000, pp. 82–93.
Werner, B.: Une théorie des constructions inductives, PhD thesis, L'Université Paris 7, Paris, France, 1994.
Wright, A. K. and Felleisen, M.: A syntactic approach to type soundness, Inform. and Comput. 115(1) (1994), 38–94.
Xi, H. and Harper, R.: A dependently typed assembly language, in Proceedings 2001 ACM International Conference on Functional Programming, ACM Press, Sept. 2001, pp. 169–180.
Author information
Authors and Affiliations
Rights and permissions
About this article
Cite this article
Hamid, N.A., Shao, Z., Trifonov, V. et al. A Syntactic Approach to Foundational Proof-Carrying Code. Journal of Automated Reasoning 31, 191–229 (2003). https://doi.org/10.1023/B:JARS.0000021012.97318.e9
Issue Date:
DOI: https://doi.org/10.1023/B:JARS.0000021012.97318.e9