Java Generics Are Turing Complete Radu Grigore September 2017 Highlights
Why do we care?
. . . . . .
distinguished at ECOOP 2016
But . . . Java is messy!
FOOL 2007
Problem Input infinite directed graph two distinguished vertices t and t ′ Output Is there a finite path t � t ′ in the given graph?
Vertices: Types f ( g ( x ) , h ())
Vertices: Types f 2 ( g 1 ( x ) , h 0 ())
Vertices: Types f gxh
Vertices: Types x , y , ...are variables C , D , ...have arity 1 Z has arity 0 Example vertex/type: CDCCDEZ s , t , ...are meta-variables, ranging over types
Arcs: Inheritance Rules the inheritance rule Cx < :: t ( x ) means that, for all ground types s , there is an arc Cs → t ( s )
Arcs: Inheritance Rules the inheritance rule Cx < :: t ( x ) means that, for all ground types s , there is an arc Cs → t ( s ) class table � set of inheritance rules
Arcs: Contravariance if s � t then Ct → Cs
Theorem It is undecidable whether t � t ′ according to a given unambiguous class table.
Theorem It is undecidable whether t � t ′ according to a given unambiguous class table. Turing machine input tape subtype query class table type checker Y/N/?
Theorem It is undecidable whether t � t ′ according to a given unambiguous class table. applies to Java! Turing machine input tape subtype query class table type checker Y/N/?
eof
Recommend
More recommend