paperbot · PL 论文追踪

全部论文 待读 收藏

P2 flowR: A Static Program Slicer for R

flowR:面向 R 的静态程序切片器
ASE Proceedings of the 39th IEEE/ACM International Conference on Automated Software Engineering2024匹配度 3/10 · 论文属于静态程序分析与程序切片工具,与用户在 PL 侧的静态分析兴趣有交集;但它面向 R 脚本的理解与维护,不涉及 LLM/Agent、浮点程序分析或贝叶斯程序分析等核心方向。引用 1 inbox
Florian Sihler, Matthias Tichy
crossref: 2026-09-12

AI 速览

一句话:提出 flowR,一个面向 R 的静态程序切片与数据流分析工具,集成到 VS Code 辅助脚本理解与维护。

研究者常用 R 脚本做统计分析与可视化,但脚本常因分析、绘图混杂而难以理解维护,且缺乏分析工具。作者提出 flowR:面向 R 的静态程序切片器与数据流分析器,可集成到 Visual Studio Code。它先静态构建细粒度数据流图,支持循环、函数调用、副作用、source 外部文件及 R 原语重定义;再在图上求解可达性,得到用户感兴趣变量对应的程序切片,并以多种交互方式呈现。评估显示,在给定数据流图上计算切片平均约 16 ms,可减少约 94% 的 token,帮助聚焦相关代码。

问题
R 脚本常因分析、绘图混杂而难以理解维护,且缺乏支持正确、可维护代码编写的分析工具。
方法
flowR 通过静态程序分析构建支持循环、函数调用、副作用、外部文件与 R 原语重定义的数据流图,并在图上求解可达性以计算程序切片;工具可集成到 VS Code,提供交互式切片。
评估
作者在给定数据流图上评估切片计算,平均耗时约 16 ms,切片可减少约 94% 的 token。
原文摘要(Abstract)

Context Many researchers rely on the R programming language to perform their statistical analyses and visualizations in the form of R scripts. However, recent research and experience show, that many of these scripts contain problems. From being hard to comprehend by combining several analyses and plots into a single source file to being non-reproducible, with a lack of analysis tools supporting the writing of correct and maintainable code. Objective In this work, we address the problem of comprehending and maintaining R scripts by proposing flowR, a program slicer and static dataflow analyzer for the R programming language, which can be integrated directly into Visual Studio Code. Given a set of variables of interest, like the generation of a single figure in a script, flowR automatically reduces the program to the parts relevant for the output of interest, like the value of a variable. Method First, we use static program analysis to construct a detailed dataflow graph of the R script. The analysis supports loops, function calls, side effects, sourcing external files, and even redefinitions of R's primitive constructs. Subsequently, we calculate the program slice by solving a reachability problem on the graph, collecting all required parts and presenting them to the user. Results Providing several interactive ways of slicing the program, we require an average of 16 ms to calculate the slice on a given dataflow graph, reducing the code by around 94% of tokens.

链接与引用

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

BibTeX
@inproceedings{paperbot8313,
  title = {flowR: A Static Program Slicer for R},
  author = {Florian Sihler and Matthias Tichy},
  booktitle = {ASE},
  year = {2024},
  doi = {10.1145/3691620.3695359}
}