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.
Supplemental Material
Available for Download
K-Java: Runtime Semantics for Method Invocation and Object Instantiation
- K-Java repository. URL https://github.com/kframework/java-semantics/tree/popl-artifact-evaluation.Google Scholar
- Gaining access to the JCK. URL http://openjdk.java.net/groups/conformance/JckAccess/.Google Scholar
- Using Java 5 features in earlier JDKs. URL http://www.ibm.com/developerworks/java/library/j-jtp02277/index.html.Google Scholar
- Translation of lambda expressions. URL http://cr.openjdk.java.net/~briangoetz/lambda/lambda-translation.html.Google Scholar
- MatchC project. URL http://fsl.cs.illinois.edu/index.php/Special:MatchCOnline.Google Scholar
- Mauve. URL https://sourceware.org/mauve/.Google Scholar
- Openjdk project. URL http://openjdk.java.net/.Google Scholar
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- D. Bogdănaş. Label-based programming language semantics in K framework with SDF. In SYNASC '12, pages 160--167. IEEE, 2012. Google Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- M. Bravenboer, R. Vermaas, R. de Groot, and E. Dolstra. Java Front. URL http://strategoxt.org/Stratego/JavaFront.Google Scholar
- 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 Scholar
- 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 Scholar
- 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 Scholar
Digital Library
- C. Ellison. A Formal Semantics of C with Applications. PhD thesis, University of Illinois, July 2012.Google Scholar
- C. Ellison and G. Roşu. An executable formal semantics of C with applications. In POPL '12, pages 533--544. ACM, 2012. Google Scholar
Digital Library
- 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 Scholar
Cross Ref
- D. Filaretti and S. Maffeis. An executable formal semantics of PHP. In ECOOP'14, pages 567--592, 2014.Google Scholar
Digital Library
- 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 Scholar
Digital Library
- FSF. C language testsuites: "C-torture" version 4.4.2, 2010. URL http://gcc.gnu.org/onlinedocs/gccint/C-Tests.html.Google Scholar
- J. Gosling, B. Joy, G. Steele, and G. Bracha. Java Language Specification, Second Edition. Addison-Wesley, 2nd edition, 2000. Google Scholar
Digital Library
- D. Guth. A formal semantics of Python 3.3. Master's thesis, University of Illinois at Urbana-Champaign, July 2013.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- G. Roşu and A. Ştefănescu. Checking reachability using matching logic. In OOPSLA'12, pages 555--574. ACM, 2012. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- G. Roşu and T. F. Şerbănuţă. An overview of the K semantic frame-work. JLAP, 79(6):397--434, 2010.Google Scholar
- P. Sestoft. Java Precisely. MIT Press, 2002. Google Scholar
Digital Library
- R. F. Stärk, E. Börger, and J. Schmid. Java and the Java Virtual Machine: Definition, Verification, Validation. Springer-Verlag, 2001. Google Scholar
Digital Library
Index Terms
K-Java: A Complete Semantics of Java
Recommendations
K-Java: A Complete Semantics of Java
POPL '15: Proceedings of the 42nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming LanguagesThis 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 ...
An executable formal semantics of C with applications
POPL '12This paper describes an executable formal semantics of C. Being executable, the semantics has been thoroughly tested against the GCC torture test suite and successfully passes 99.2% of 776 test programs. It is the most complete and thoroughly tested ...
KJS: a complete formal semantics of JavaScript
PLDI '15: Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and ImplementationThis paper presents KJS, the most complete and throughly tested formal semantics of JavaScript to date. Being executable, KJS has been tested against the ECMAScript 5.1 conformance test suite, and passes all 2,782 core language tests. Among the ...







Comments