Grigore showed that Java generics are Turing complete by describing a reduction from Turing machines to Java subtyping. We apply Grigore's algorithm to Python type hints and deduce that they are Turing complete. In addition, we present an alternative reduction in which the Turing machines are simulated in real time, resulting in significantly lower compilation times. Our work is accompanied by a Python implementation of both reductions that compiles Turing machines into Python subtyping machines.
翻译:Grigore通过描述从图灵机到爪哇亚型缩略图的缩略图显示爪哇非专利品已经完成。 我们将格里戈雷的算法应用于Python型提示,并推断它们已经完成图灵型提示。 此外,我们提出了另一种缩略法,即模拟图灵机的实时,从而大大缩短了编译时间。我们的工作还伴随着Python的裁减法,将图灵机编成Python亚型机器。