Dynamically typed languages such as Python have become very popular. Among other strengths, Python's dynamic nature and its straightforward linking to native code have made it the de-facto language for many research areas such as Artificial Intelligence. This flexibility, however, makes static analysis very hard. While creating a sound, or a soundy, analysis for Python remains an open problem, we present in this work Serenity, a framework for static analysis of Python that turns out to be sufficient for some tasks. The Serenity framework exploits two basic mechanisms: (a) reliance on dynamic dispatch at the core of language translation, and (b) extreme abstraction of libraries, to generate an abstraction of the code. We demonstrate the efficiency and usefulness of Serenity's analysis in two applications: code completion and automated machine learning. In these two applications, we demonstrate that such analysis has a strong signal, and can be leveraged to establish state-of-the-art performance, comparable to neural models and dynamic analysis respectively.
翻译:Python 等动态打字语言非常受欢迎。 除其他优点外, Python 的动态性质及其与本地代码的直接联系使它成为人工智能等许多研究领域的非facto语言。 但是,这种灵活性使得静态分析非常困难。 在为 Python 创建一个声音或声音分析的同时, 我们在这个工作中展示了“ 平静”, 这是一种静态分析Python 的框架, 事实证明它足以完成某些任务。 平静框架利用了两种基本机制:(a) 依赖语言翻译核心的动态发送,以及(b) 图书馆的极端抽象化,以产生代码的抽象化。 我们展示了在两种应用中“ 平静” 分析的效率和效用: 代码完成和自动机器学习。 在这两种应用中,我们证明这种分析具有强烈的信号,可以用来建立与神经模型和动态分析相类似的状态。