arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2208.14755cs.PL
收藏

Python类型提示是图灵完备的

Python Type Hints are Turing Complete

Ori Roth

摘要:

Grigore通过描述从图灵机到Java子类型的简化证明了Java泛型是图灵完备的。我们将Grigore算法应用于Python类型提示,并推断它们是图灵完备的。此外,我们提出了一种替代减少图灵机的实时的模拟,从而显着降低编译时间。我们的工作伴随着这两种简化的Python实现,将图灵机编译成Python子类型机器。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑