Precise and fast static type analysis for dynamically typed language is very difficult. This is mainly because the lack of static type information makes it difficult to approximate all possible values of a variable. Actually, the existing static type analysis methods are imprecise or slow. In this paper, we propose a novel method to improve the precision of static type analysis for Python code, where a backward analysis is used to obtain the path-sensitivity. By doing so, our method aims to obtain more precise static type information, which contributes to the overall improvement of static analysis. To show the effectiveness of our method, we conducted a preliminary experiment to compare our method implementation and the existing analysis tool with respect to precision and time efficiency. The result shows our method provides more precise type analysis with fewer false positives than the existing static type analysis tool. Also it shows our proposed method increases the analysis time, but it is still within the range of practical use.
翻译:对动态键入语言进行精确和快速静态类型分析非常困难,主要原因是缺乏静态类型信息,难以估计变量的所有可能值。事实上,现有的静态类型分析方法不准确或缓慢。在本文中,我们提议了一种新方法,以提高Python代码静态类型分析的精确性,即使用后向分析来获取路径敏感度。通过这种方法,我们的方法旨在获取更精确的静态类型信息,这有助于全面改进静态分析。为了显示我们的方法的有效性,我们进行了初步实验,以比较我们的方法执行情况和现有分析工具的精确性和时间效率。结果显示,我们的方法提供了比现有静态类型分析工具更准确的类型分析,其误差的正数少于现有的静态类型分析工具。此外,它显示了我们所提议的方法增加了分析时间,但仍在实际使用的范围内。