Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages 2017
DOI: 10.1145/3009837.3009871
|View full text |Cite
|
Sign up to set email alerts
|

Java generics are turing complete

Abstract: This paper describes a reduction from the halting problem of Turing machines to subtype checking in Java. It follows that subtype checking in Java is undecidable, which answers a question posed by Kennedy and Pierce in 2007. It also follows that Java's type checker can recognize any recursive language, which improves a result of Gil and Levy from 2016. The latter point is illustrated by a parser generator for fluent interfaces.

Help me understand this report

Search citation statements

Order By: Relevance

Paper Sections

Select...
1
1
1
1

Citation Types

1
17
0

Year Published

2018
2018
2023
2023

Publication Types

Select...
4
3
1

Relationship

0
8

Authors

Journals

citations
Cited by 29 publications
(18 citation statements)
references
References 16 publications
1
17
0
Order By: Relevance
“…As shown in Fig. 1, the new results here, together with the proof that S ⊤ is undecidable due to Kennedy and Pierce and the subsequent proof by Grigore [2017] implying that ⟨C, X⟩ is undecidable, completely characterize the computing power of all eight points of the lattice. This characterization is not in terms of the Chomsky hierarchy of classes of formal languages, but rather in terms of a similar hierarchy of classes of forests, also called formal tree languages (see, e.g., [Comon et al 2007]), as depicted by Fig.…”
Section: Kennedy and Pierce's Type System And Its Decidable Fragmentssupporting
confidence: 53%
See 1 more Smart Citation
“…As shown in Fig. 1, the new results here, together with the proof that S ⊤ is undecidable due to Kennedy and Pierce and the subsequent proof by Grigore [2017] implying that ⟨C, X⟩ is undecidable, completely characterize the computing power of all eight points of the lattice. This characterization is not in terms of the Chomsky hierarchy of classes of formal languages, but rather in terms of a similar hierarchy of classes of forests, also called formal tree languages (see, e.g., [Comon et al 2007]), as depicted by Fig.…”
Section: Kennedy and Pierce's Type System And Its Decidable Fragmentssupporting
confidence: 53%
“…Fling [Gil and Roth 2019] and TypeLevelLR [Yamazaki et al 2019] are two prominent fluent API generators that support all deterministic context-free languages (DCFLs). Grigore [2017] implemented a generator that accepts context-free grammars describing general context-free DSLs-a proper super-set of DCFLs. Specifically, his implementation coded a CYK parser in an intermediate simple, yet high level language, and then translated the code in this language into a Turing machine, being emulated in a subtyping query.…”
Section: Fluent Apis and Treetopmentioning
confidence: 99%
“…Firstly, unlike in traditional existential types [Pierce 1992], types such as ∃T t 2 t 1 .T are instantaneously rewritten into the upper bound of T by the frontend and do not appear in subtyping. Secondly, unlike in Java, where subtyping has been proved undecidable [Grigore 2017], neither of the following is allowed in Julia: recursive bounds on type variables (e.g. Ref{T} where T<:Foo{T}) [Wehr and Thiemann 2009], contravariant type constructors [Kennedy and Pierce 2007], existential types in type definitions (e.g.…”
Section: Related Workmentioning
confidence: 99%
“…Java wildcards represent a restricted form of the existential types in JavaGI however, and were not necessarily implicated by this proof. Java Generics were ultimately proven Turing Complete by Grigore in 2017 [40], and thus undecidable. Grigore encoded Turing machines into a fragment of Java's subtyping that was limited to Java Generics and contravariant type parameters.…”
Section: Decidability Of Subtyping In Javamentioning
confidence: 99%
“…Grigore [40] showed that Java Generics was Turing complete by demonstrating that Java subtyping could encode a Turing machine. The mechanism that allows such a reduction is the recursive manner in which Java generics can be used coupled with the contra-variant subtyping of Java wildcards, and Java's multiple inheritance (but not necessarily multiple instantiation inheritance).…”
Section: Encoding Java Genericsmentioning
confidence: 99%