paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Reducing Static Analysis Unsoundness with Approximate Interpretation

以近似解释减少静态分析的不健全性
PLDI 8(PLDI)2024匹配度 3/10 · 该论文属于程序分析与静态/动态分析,涉及静态分析不健全性和调用图构建,但与用户核心关注的 PL↔AI、LLM/Agent 改进静态分析、浮点程序分析或贝叶斯程序分析均无直接交叉。仅可作为程序分析一般背景参考。引用 10 inbox
Mathias Rud Laursen, Wenyuan Xu, Anders Møller
dblp: 2026-09-10crossref: 2026-09-10

AI 速览

一句话:提出近似解释动态分析,自动推断 JavaScript 动态属性访问的确定事实,用于静态分析减少不健全性并改进调用图构建。

JavaScript 静态分析常因动态属性访问(通过运行时计算名读写对象属性)而面临不健全问题;现有先进分析为保证可扩展性与精度多忽略这类操作,导致漏掉调用边和别名关系。本文提出近似解释(approximate interpretation)这一动态分析技术,能高效、全自动地推断动态属性访问(尤其是复杂库 API 初始化代码中)的似确定事实,并将所得信息用于静态分析,以恢复原本丢失的抽象信息。作者实现该技术并在 141 个真实 Node.js 应用与库上实验:平均调用边增加 55.1%,可达函数增加 21.8%,已解析调用点增加 17.7%,单态调用点仅减少 1.5%;在 36 个有动态调用图的项目上,分析召回率从 75.9% 提至 88.1%,精度下降可忽略。

问题
JavaScript 静态分析因动态属性访问而难以兼顾可扩展性与精度,现有分析常忽略这些操作,造成调用边和别名关系遗漏以及分析不健全。
方法
提出近似解释动态分析,自动推断动态属性访问的似确定事实,特别是库 API 初始化中的事实,并把这些信息反馈给静态分析以恢复抽象信息。
评估
在 141 个真实 Node.js 应用与库上评估调用图构建;并在 36 个有动态调用图的项目上测召回率与精度,结果显示召回显著提升且精度损失可忽略。
原文摘要(Abstract)

Static program analysis for JavaScript is more difficult than for many other programming languages. One of the main reasons is the presence of dynamic property accesses that read and write object properties via dynamically computed property names. To ensure scalability and precision, existing state-of-the-art analyses for JavaScript mostly ignore these operations although it results in missed call edges and aliasing relations. We present a novel dynamic analysis technique named approximate interpretation that is designed to efficiently and fully automatically infer likely determinate facts about dynamic property accesses, in particular those that occur in complex library API initialization code, and how to use the produced information in static analysis to recover much of the abstract information that is otherwise missed. Our implementation of the technique and experiments on 141 real-world Node.js-based JavaScript applications and libraries show that the approach leads to significant improvements in call graph construction. On average the use of approximate interpretation leads to 55.1 % more call edges, 21.8 % more reachable functions, 17.7 % more resolved call sites, and only 1.5 % fewer monomorphic call sites. For 36 JavaScript projects where dynamic call graphs are available, average analysis recall is improved from 75.9 % to 88.1 % with a negligible reduction in precision.

链接与引用

DOI 原文 · PDF(开放获取) · DBLP

BibTeX
@article{LaursenXM24,
  title = {Reducing Static Analysis Unsoundness with Approximate Interpretation},
  author = {Mathias Rud Laursen and Wenyuan Xu and Anders Møller},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {8},
  number = {PLDI},
  year = {2024},
  doi = {10.1145/3656424}
}