skip to main content
research-article

K-Java: A Complete Semantics of Java

Authors Info & Claims
Published:14 January 2015Publication History
Skip Abstract Section

Abstract

This paper presents K-Java, a complete executable formal semantics of Java 1.4. K-Java was extensively tested with a test suite developed alongside the project, following the Test Driven Development methodology. In order to maintain clarity while handling the great size of Java, the semantics was split into two separate definitions -- a static semantics and a dynamic semantics. The output of the static semantics is a preprocessed Java program, which is passed as input to the dynamic semantics for execution. The preprocessed program is a valid Java program, which uses a subset of the features of Java. The semantics is applied to model-check multi-threaded programs. Both the test suite and the static semantics are generic and ready to be used in other Java-related projects.

Skip Supplemental Material Section

Supplemental Material

p445-sidebyside.mpg

References

  1. K-Java repository. URL https://github.com/kframework/java-semantics/tree/popl-artifact-evaluation.Google ScholarGoogle Scholar
  2. Gaining access to the JCK. URL http://openjdk.java.net/groups/conformance/JckAccess/.Google ScholarGoogle Scholar
  3. Using Java 5 features in earlier JDKs. URL http://www.ibm.com/developerworks/java/library/j-jtp02277/index.html.Google ScholarGoogle Scholar
  4. Translation of lambda expressions. URL http://cr.openjdk.java.net/~briangoetz/lambda/lambda-translation.html.Google ScholarGoogle Scholar
  5. MatchC project. URL http://fsl.cs.illinois.edu/index.php/Special:MatchCOnline.Google ScholarGoogle Scholar
  6. Mauve. URL https://sourceware.org/mauve/.Google ScholarGoogle Scholar
  7. Openjdk project. URL http://openjdk.java.net/.Google ScholarGoogle Scholar
  8. A simple scenario using wait() and notify() in Java. URL http://stackoverflow.com/questions/2536692/a-simple-scenario-using-wait-and-notify-in-java.Google ScholarGoogle Scholar
  9. L. Bettini, F. Damiani, I. Schaefer, and F. Strocco. Traitrecordj: A programming language with traits and records. Sci. Comput. Program., 78(5):521--541, May 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. M. Bodin, A. Chargueraud, D. Filaretti, P. Gardner, S. Maffeis, D. Naudziuniene, A. Schmitt, and G. Smith. A trusted mechanised JavaScript specification. In POPL'14, pages 87--100. ACM, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. D. Bogdănaş. Label-based programming language semantics in K framework with SDF. In SYNASC '12, pages 160--167. IEEE, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. D. Bogdănaş. K-Java: runtime semantics for method invocation and object instantiation. Technical report, University of Illinois, 2014. URL http://hdl.handle.net/2142/55512.Google ScholarGoogle Scholar
  13. E. Börger, N. G. Fruja, V. Gervasi, and R. F. Stärk. A high-level modular definition of the semantics of C#. Theor. Comput. Sci., 336 (2--3):235--284, May 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. G. Bracha, M. Odersky, D. Stoutamire, and P. Wadler. Making the future safe for the past: Adding genericity to the java programming language. In OOPSLA '98, pages 183--200. ACM, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. M. Bravenboer, R. Vermaas, R. de Groot, and E. Dolstra. Java Front. URL http://strategoxt.org/Stratego/JavaFront.Google ScholarGoogle Scholar
  16. M. Clavel, F. Durn, S. Eker, P. Lincoln, N. Martoliet, J. Meseguer, and C. Talcott. Maude manual (version 2.6), 2011. URL http://maude.cs.uiuc.edu/maude2-manual/.Google ScholarGoogle Scholar
  17. A. ştefănescu, c. Ciobâcă, R. Mereuţă, B. M. Moore, T. F. Şerbănuţă, and G. Roşu. All-path reachability logic. In RTA-TLCA'14, LNCS. Springer, 2014.Google ScholarGoogle Scholar
  18. S. Eker, J. Meseguer, and A. Sridharanarayanan. The Maude LTL model checker and its implementation. In SPIN'03, pages 230--234. Springer-Verlag, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. C. Ellison. A Formal Semantics of C with Applications. PhD thesis, University of Illinois, July 2012.Google ScholarGoogle Scholar
  20. C. Ellison and G. Roşu. An executable formal semantics of C with applications. In POPL '12, pages 533--544. ACM, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. A. Farzan, F. Chen, J. Meseguer, and G. Roşu. Formal analysis of Java programs in JavaFAN. In CAV'04, volume 3114 of LNCS, pages 501--505, 2004.Google ScholarGoogle ScholarCross RefCross Ref
  22. D. Filaretti and S. Maffeis. An executable formal semantics of PHP. In ECOOP'14, pages 567--592, 2014.Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. M. Flatt, S. Krishnamurthi, and M. Felleisen. A programmer's reduction semantics for classes and mixins. In Formal Syntax and Semantics of Java, pages 241--269. Springer-Verlag, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. FSF. C language testsuites: "C-torture" version 4.4.2, 2010. URL http://gcc.gnu.org/onlinedocs/gccint/C-Tests.html.Google ScholarGoogle Scholar
  25. J. Gosling, B. Joy, G. Steele, and G. Bracha. Java Language Specification, Second Edition. Addison-Wesley, 2nd edition, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. D. Guth. A formal semantics of Python 3.3. Master's thesis, University of Illinois at Urbana-Champaign, July 2013.Google ScholarGoogle Scholar
  27. C. Haack, E. Poll, J. Schfer, and A. Schubert. Immutable objects for a java-like language. In ESOP'07, volume 4421 of LNCS, pages 347--362. Springer Berlin Heidelberg, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. J. Heering, P. R. H. Hendriks, P. Klint, and J. Rekers. The syntax definition formalism SDF "reference manual" .SIGPLAN Not., 24 (11):43--75, Nov. 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. K. Kreft and A. Langer. Understanding the closures debate, 2008. URL http://www.javaworld.com/article/2077869/scripting-jvm-languages/understanding-the-closures-debate.html.Google ScholarGoogle Scholar
  30. J. G. Politz, A. Martinez, M. Milano, S. Warren, D. Patterson, J. Li, A. Chitipothu, and S. Krishnamurthi. Python: The full monty. In OOPSLA '13, pages 217--232. ACM, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. G. Roşu and A. Ştefănescu. Checking reachability using matching logic. In OOPSLA'12, pages 555--574. ACM, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. G. Roşu, A. Ştefănescu, c. Ciobâcă, and B. M. Moore. One-path reachability logic. In LICS'13, pages 358--367. IEEE, June 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. G. Roşu and T. F. Şerbănuţă. An overview of the K semantic frame-work. JLAP, 79(6):397--434, 2010.Google ScholarGoogle Scholar
  34. P. Sestoft. Java Precisely. MIT Press, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. R. F. Stärk, E. Börger, and J. Schmid. Java and the Java Virtual Machine: Definition, Verification, Validation. Springer-Verlag, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. K-Java: A Complete Semantics of Java

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      • Published in

        cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 50, Issue 1
        POPL '15
        January 2015
        682 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/2775051
        • Editor:
        • Andy Gill
        Issue’s Table of Contents
        • cover image ACM Conferences
          POPL '15: Proceedings of the 42nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages
          January 2015
          716 pages
          ISBN:9781450333009
          DOI:10.1145/2676726

        Copyright © 2015 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 14 January 2015

        Check for updates

        Qualifiers

        • research-article

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!