paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Inferring the Shape of Data Frames in R Programs using Abstract Interpretation

使用抽象解释推断 R 程序中数据框的形状
ASE Proceedings of the 41st IEEE/ACM International Conference on Automated Software Engineering2026匹配度 3/10 · 论文属于静态分析与抽象解释方向,与用户对程序分析的兴趣有方法层面的弱关联;但其目标是推断 R 语言 data frame 的形状,并未涉及 LLM/Agent、机器学习系统、浮点程序分析或贝叶斯程序分析等核心方向。引用 1 inbox
Oliver Gerstl, Florian Sihler, Matthias Tichy
crossref: 2026-10-09

AI 速览

一句话:提出一种抽象解释静态分析,推断 R 程序中 data frame 的列名与行列数形状。

数据框是 R 等数据分析语言的核心结构,但语言缺乏静态保证,难以在程序点推理其形状。本文提出一种基于抽象解释的静态分析,通过跟踪已确保与潜在列名、潜在列数和行数,使用 reduced product 域,并为变异、过滤、子集选择等常见数据框操作定义抽象语义,从而推断数据框形状。作者在 78 个真实 R 脚本上评估正确性与精度,未出现下近似,提供健全性经验证据;在 33,314 个真实脚本上为 42.1% 的操作推断出具体形状约束、0.9% 推断出精确形状,若可读取全部数据集则提升至 58.7% 和 4.2%,并发现 40 个脚本存在潜在无效数据框访问。

问题
R 等语言缺少对 data frame 形状的静态保证,程序点难以确定列名、列数与行数。
方法
使用抽象解释与 reduced product 域,跟踪 ensured 与 potential 列名及潜在行列数,并为 mutate、filter、subset 等常见数据框操作定义抽象语义。
评估
在 78 个可执行真实 R 脚本上验证健全性与精度,并在 33,314 个真实脚本上统计推断覆盖率,同时发现 40 个含潜在无效数据框访问的脚本。
原文摘要(Abstract)

Data frames are a fundamental data structure in many data analysis tasks and are widely used in programming languages like R. Due to their omnipresence in data analysis, there are many functions that operate on their shape and content, for example, to clean and transform study data. However, languages like R do not offer static guarantees on data frames making it difficult to reason about their shape at a specific point in the program. In this paper, we present a novel static analysis to infer the shape of data frames in R programs using abstract interpretation by tracking the ensured and potential column names, as well as the potential number of columns and rows. For this, we use a reduced product domain and define abstract semantics for the most commonly used data frame operations, such as mutating, filtering, and subsetting. We evaluate the correctness and accuracy of our analysis on a selection of 78 executable real-world R scripts achieving empirical evidence for soundness by never under-approximating the data frame shape. Additionally, we demonstrate the ability of our analysis to infer the shape of data frames on a large dataset of 33,314 real-world R scripts by inferring concrete shape constraints for 42.1 % and exact shapes for 0.9 % of the data frame operations, improving to 58.7 % and 4.2 % if all datasets read in these scripts are available to our analysis. Using the inferred data frame shapes, we identified 40 real-world R scripts containing potential invalid data frame accesses. This shows the potential of our analysis to significantly support researchers in using data frames in data analysis.

链接与引用

DOI 原文 · arXiv · DBLP

BibTeX
@inproceedings{abs-2607-03889,
  title = {Inferring the Shape of Data Frames in R Programs using Abstract Interpretation},
  author = {Oliver Gerstl and Florian Sihler and Matthias Tichy},
  booktitle = {ASE},
  year = {2026},
  doi = {10.1145/3832783.3834445}
}