Skip to main content

Relational Solver for Java Generics Type System

  • Conference paper
  • First Online:
Logic-Based Program Synthesis and Transformation (LOPSTR 2023)

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    https://github.com/UnitTestBot/UTBotJava/issues/730, https://github.com/UnitTestBot/UTBotJava/issues/1994, https://github.com/UnitTestBot/UTBotJava/issues/924.

  2. 2.

    http://minikanren.org/#implementations.

  3. 3.

    It is a convention in miniKanren programming to superscript relational definitions with “\(^o\)”.

  4. 4.

    Source code is available online: https://github.com/Lozov-Petr/JGS/tree/LOPSTR-2023.

References

  1. Java programming language page. https://www.oracle.com/java/

  2. Tiobe index. https://www.tiobe.com/tiobe-index/

  3. Unittestbot java. https://github.com/UnitTestBot/UTBotJava

  4. 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

    Chapter  Google Scholar 

  5. 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

  6. 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)

    Google Scholar 

  7. 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)

    Google Scholar 

  8. Byrd, W.E., Friedman, D.P.: \(\alpha \) kanren a fresh name in nominal logic programming. In: Scheme and Functional Programming (2007)

    Google Scholar 

  9. 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

  10. 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

  11. Comon, H.: Disunification: a survey. In: Computational Logic – Essays in Honor of Alan Robinson, pp. 322–359 (1991)

    Google Scholar 

  12. 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

  13. 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

  14. Grigore, R.: Java generics are turing complete. SIGPLAN Not. 52(1), 73–85 (2017). https://doi.org/10.1145/3093333.3009871

  15. 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

  16. 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

  17. Kosarev, D., Boulytchev, D.: Typed embedding of a relational language in OCaml, pp. 1–22 (2016). https://doi.org/10.4204/EPTCS.285.1

  18. 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

    Chapter  Google Scholar 

  19. Leroy, X., Doligez, D., Alain Frisch, J.G., Rémy, D., Vouillon, J.: The ocaml system, release 5.0 (2022)

    Google Scholar 

  20. Lozov, P., Verbitskaia, E., Boulytchev, D.: Relational interpreters for search problems. In: miniKanren and Relational Programming Workshop (2019)

    Google Scholar 

  21. 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

    Chapter  Google Scholar 

  22. Pierce, B.C.: Types and Programming Languages. MIT Press, Cambridge (2002). http://ropas.snu.ac.kr/~kwang/520/pierce_book.pdf

  23. 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

    Chapter  MATH  Google Scholar 

  24. 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)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Dmitry Boulytchev .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

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)

Publish with us

Policies and ethics