Automatic Certification of Java Source Code in Rewriting Logic

  • Mauricio Alba-Castro
  • María Alpuente
  • Santiago Escobar
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4916)


In this paper we propose an abstract certification technique for Java which is based on rewriting logic, a very general logical and semantic framework efficiently implemented in the functional programming language Maude. Starting from a specification of the Java semantics written in Maude, we develop an abstract, finite-state operational semantics also written in Maude which is appropriate for program verification. As a by-product of the abstract verification, a dependable safety certificate is delivered which consists of a set of (abstract) rewriting proofs that can be easily checked by the code consumer using a standard rewriting logic engine. Our certification methodology extends to other programming languages by simply replacing the concrete semantics of Java by a semantics for the programming language at hand. The abstract proof-carrying code technique has been implemented and successfully tested on several examples, which demonstrate the feasibility of our approach.


Java Program Safety Property Abstract Interpretation Java Code Abstract Domain 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Albert, E., Puebla, G., Hermenegildo, M.V.: Abstraction-carrying code. In: Baader, F., Voronkov, A. (eds.) LPAR 2004. LNCS (LNAI), vol. 3452, pp. 380–397. Springer, Heidelberg (2005)Google Scholar
  2. 2.
    Appel, A.W., Felty, A.P.: A semantic model of types and machine instuctions for proof-carrying code. In: POPL, pp. 243–253 (2000)Google Scholar
  3. 3.
    Besson, F., Jensen, T.P., Pichardie, D.: Proof-carrying code from certified abstract interpretation and fixpoint compression. Theor. Comput. Sci. 364(3), 273–291 (2006)zbMATHCrossRefMathSciNetGoogle Scholar
  4. 4.
    Burdy, L., Requet, A., Lanet, J.-L.: Java applet correctness: A developer-oriented approach. In: Araki, K., Gnesi, S., Mandrioli, D. (eds.) FME 2003. LNCS, vol. 2805, pp. 422–439. Springer, Heidelberg (2003)Google Scholar
  5. 5.
    Burdy, L., Cheon, Y., Cok, D., Ernst, M., Kiniry, J., Leavens, G.T., Rustan, K., Leino, M., Poll, E.: An overview of JML tools and applications. International Journal on Software Tools for Technology Transfer 7(3), 212–232 (2005)CrossRefGoogle Scholar
  6. 6.
    Chalin, P., Kiniry, J.R., Leavens, G.T., Poll, E.: Beyond assertions: Advanced specification and verification with JML and ESC/Java2. In: de Boer, F.S., Bonsangue, M.M., Graf, S., de Roever, W.-P. (eds.) FMCO 2005. LNCS, vol. 4111, pp. 342–363. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  7. 7.
    Clavel, M., Durán, F., Eker, S., Lincoln, P., Martí-Oliet, N., Meseguer, J., Talcott, C.: All About Maude - A High-Performance Logical Framework. LNCS, vol. 4350. Springer, Heidelberg (2007)zbMATHGoogle Scholar
  8. 8.
    Cousot, P., Cousot, R.: Abstract interpretation: A unified lattice model for static analysis of programs by construction or approximation of fixpoints. In: Conference Record of the Fourth ACM Symposium on Principles of Programming Languages, pp. 238–252 (1977)Google Scholar
  9. 9.
    Cousot, P., Cousot, R.: Systematic Design of Program Analysis Frameworks. In: Proc. of Sixth ACM Symp. on Principles of Programming Languages, pp. 269–282 (1979)Google Scholar
  10. 10.
    Farzan, A., Chen, F., Meseguer, J., Rosu, G.: JavaRL: The rewriting logic semantics of Java (2007),
  11. 11.
    Farzan, A., Chen, F., Meseguer, J., Rosu, G.: Formal analysis of Java programs in JavaFAN. In: Alur, R., Peled, D.A. (eds.) CAV 2004. LNCS, vol. 3114, pp. 501–505. Springer, Heidelberg (2004)Google Scholar
  12. 12.
    Farzan, A., Meseguer, J., Rosu, G.: Formal JVM code analysis in JavaFAN. In: Rattray, C., Maharaj, S., Shankland, C. (eds.) AMAST 2004. LNCS, vol. 3116, pp. 132–147. Springer, Heidelberg (2004)Google Scholar
  13. 13.
    Felty, A.P.: A tutorial example of the semantic approach to foundational proof-carrying code. In: Giesl, J. (ed.) RTA 2005. LNCS, vol. 3467, pp. 394–406. Springer, Heidelberg (2005)Google Scholar
  14. 14.
    Flanagan, C., Leino, K.R.M., Lillibridge, M., Nelson, G., Saxe, J.B., Stata, R.: Extended static checking for Java. In: PLDI, pp. 234–245 (2002)Google Scholar
  15. 15.
    Leavens, G., Baker, A., Ruby, C.: Preliminary design of JML: A behavioral interface specification language for Java. ACM SIGSOFT Software Engineering Notes 31(3), 1–38 (2006)CrossRefGoogle Scholar
  16. 16.
    Meseguer, J.: Conditional rewriting logic as a unified model of concurrency. Theor. Comput. Sci. 96(1), 73–155 (1992)zbMATHCrossRefMathSciNetGoogle Scholar
  17. 17.
    Meseguer, J., Rosu, G.: The rewriting logic semantics project. Theor. Comput. Sci. 373(3), 213–237 (2007)zbMATHCrossRefMathSciNetGoogle Scholar
  18. 18.
    Necula, G.C.: Proof carrying code. In: Proceedings of the 24th ACM SIGPLAN-SIGACT Annual Symposium on Principles of Programming Languages POPL 1997, Paris, France, pp. 106–119. ACM Press, New York, NY, USA (1997)CrossRefGoogle Scholar
  19. 19.
    Necula, G.C., Lee, P.: Safe kernel extensions without run time checking. In: Proc. of the second USENIX symposium on Operating systems design and implementation OSDI 1996, pp. 229–243. ACM Press, New York (1996)CrossRefGoogle Scholar
  20. 20.
    TeReSe (ed.): Term Rewriting Systems. Cambridge University Press, Cambridge (2003)Google Scholar
  21. 21.
    Wildmoser, M., Nipkow, T., Klein, G., Nanz, S.: Prototyping proof carrying code. In: Lévy, J.-J., Mayr, E.W., Mitchell, J.C. (eds.) 3rd Int’ll Conf. on Theoretical Computer Science (TCS 2004), pp. 333–348. Kluwer, Dordrecht (2004)Google Scholar
  22. 22.
    Wu, D., Appel, A., Stump, A.: Foundational proof checkers with small witnesses. In: Proceedings of the 5th ACM SIGPLAN international conference on Principles and practice of declarative programming PPDP, pp. 264–274. ACM Press, New York (2003)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2008

Authors and Affiliations

  • Mauricio Alba-Castro
    • 1
    • 2
  • María Alpuente
    • 1
  • Santiago Escobar
    • 1
  1. 1.Universidad Politécnica de ValenciaSpain
  2. 2.Universidad Autónoma de ManizalesColombia

Personalised recommendations