Abstract
We present a solver for Java generics type system implemented using relational verifier-to-solver approach. The solver finds solutions for a system of subtyping inequations with free variables and thus can be used to determine a concrete type satisfying a set of constraints. The context of this work is symbolic execution for testing and verification of Java programs.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
- 2.
- 3.
It is a convention in miniKanren programming to superscript relational definitions with “\(^o\)”.
- 4.
Source code is available online: https://github.com/Lozov-Petr/JGS/tree/LOPSTR-2023.
References
Java programming language page. https://www.oracle.com/java/
Tiobe index. https://www.tiobe.com/tiobe-index/
Unittestbot java. https://github.com/UnitTestBot/UTBotJava
Abramov, S., Glück, R.: Combining semantics with non-standard interpreter hierarchies. In: Kapoor, S., Prasad, S. (eds.) FSTTCS 2000. LNCS, vol. 1974, pp. 201–213. Springer, Heidelberg (2000). https://doi.org/10.1007/3-540-44450-5_16
Abramov, S., Glück, R.: From standard to non-standard semantics by semantics modifiers. Int. J. Found. Comput. Sci. 12(02), 171–211 (2001). https://doi.org/10.1142/S0129054101000448
Alvis, C.E., Willcock, J.J., Carter, K.M., Byrd, W.E., Friedman, D.P.: cKanren: minikanren with constraints. In: Proceedings of the 2011 Annual Workshop on Scheme and Functional Programming. Scheme 2011 (2011)
Byrd, W.E., Ballantyne, M., Rosenblatt, G., Might, M.: A unified approach to solving seven programming problems (functional pearl). Proc. ACM Program. Lang. 8:1–8:26 (2017)
Byrd, W.E., Friedman, D.P.: \(\alpha \) kanren a fresh name in nominal logic programming. In: Scheme and Functional Programming (2007)
Byrd, W.E., Holk, E., Friedman, D.P.: Minikanren, live and untagged: quine generation via relational interpreters (programming pearl). In: Proceedings of the Annual Workshop on Scheme and Functional Programming, Scheme 2012, pp. 8–29. Association for Computing Machinery, New York (2012). https://doi.org/10.1145/2661103.2661105
Cadar, C., Sen, K.: Symbolic execution for software testing: three decades later. Commun. ACM 56(2), 82–90 (2013). https://doi.org/10.1145/2408776.2408795
Comon, H.: Disunification: a survey. In: Computational Logic – Essays in Honor of Alan Robinson, pp. 322–359 (1991)
Friedman, D.P., Byrd, W.E., Kiselyov, O., Hemann, J.: The Reasoned Schemer, 2nd edn. The MIT Press, Cambridge (2005). https://doi.org/10.7551/mitpress/5801.001.0001
Gosling, J., Joy, B., Bracha, G.S.G., Buckley, A., Smith, D., Bierman, G.: The Java Language Specification; Java SE 20 Edition (2023). https://docs.oracle.com/javase/specs/jls/se20/jls20.pdf
Grigore, R.: Java generics are turing complete. SIGPLAN Not. 52(1), 73–85 (2017). https://doi.org/10.1145/3093333.3009871
Ivanov, D., et al.: UTBot java at the SBST2022 tool competition. In: 2022 IEEE/ACM 15th International Workshop on Search-Based Software Testing (SBST), pp. 39–40 (2022). https://doi.org/10.1145/3526072.3527529
Kiselyov, O., Shan, C.C., Friedman, D.P., Sabry, A.: Backtracking, interleaving, and terminating monad transformers: (functional pearl). In: Proceedings of the Tenth ACM SIGPLAN International Conference on Functional Programming, ICFP 2005, pp. 192–203. Association for Computing Machinery, New York (2005). https://doi.org/10.1145/1086365.1086390
Kosarev, D., Boulytchev, D.: Typed embedding of a relational language in OCaml, pp. 1–22 (2016). https://doi.org/10.4204/EPTCS.285.1
Kosarev, D., Lozov, P., Boulytchev, D.: Relational synthesis for pattern matching. In: Oliveira, B.C.S. (ed.) APLAS 2020. LNCS, vol. 12470, pp. 293–310. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-64437-6_15
Leroy, X., Doligez, D., Alain Frisch, J.G., Rémy, D., Vouillon, J.: The ocaml system, release 5.0 (2022)
Lozov, P., Verbitskaia, E., Boulytchev, D.: Relational interpreters for search problems. In: miniKanren and Relational Programming Workshop (2019)
Lozov, P., Vyatkin, A., Boulytchev, D.: Typed relational conversion. In: Wang, M., Owens, S. (eds.) TFP 2017. LNCS, vol. 10788, pp. 39–58. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-89719-6_3
Pierce, B.C.: Types and Programming Languages. MIT Press, Cambridge (2002). http://ropas.snu.ac.kr/~kwang/520/pierce_book.pdf
Rozplokhas, D., Vyatkin, A., Boulytchev, D.: Certified semantics for relational programming. In: Oliveira, B.C.S. (ed.) APLAS 2020. LNCS, vol. 12470, pp. 167–185. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-64437-6_9
Torgersen, M., Ernst, E., Hansen, C.: Wild fj. In: Proceedings of FOOL 12, the Twelth International Workshop on Foundations of Object-Oriented Languages; Conference date: 15 January 2005 (2005)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Lozov, P., Kosarev, D., Ivanov, D., Boulytchev, D. (2023). Relational Solver for Java Generics Type System. In: Glück, R., Kafle, B. (eds) Logic-Based Program Synthesis and Transformation. LOPSTR 2023. Lecture Notes in Computer Science, vol 14330. Springer, Cham. https://doi.org/10.1007/978-3-031-45784-5_8
Download citation
DOI: https://doi.org/10.1007/978-3-031-45784-5_8
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-45783-8
Online ISBN: 978-3-031-45784-5
eBook Packages: Computer ScienceComputer Science (R0)