SCYTHE:用于快速、高效程序缩减的语义感知重写
Scythe: Semantic-Aware Rewriting for Fast,Effective Program Reduction
AI总结:
该研究提出语义感知预处理工具SCYTHE,将其与PERSES、LATRA等程序缩减器结合,可在不修改原缩减器的情况下,显著提升程序缩减的效率与效果。
摘要:
自动化程序缩减会将程序缩小为保留目标属性的更小程序。与语言无关的基于语法的缩减器易于跨语言适配,但由于仅对语法进行推理,无法执行删除整个声明所需的耦合编辑,例如,无法在方法仍被调用时删除它。因此,它们会在无法成功的编辑上浪费预言机调用,且常留下不相关的声明。我们提出SCYTHE,一种快速的语义感知预处理步骤,可在不修改任何基于语法的缩减器的情况下,与其配合使用。SCYTHE将程序编码为类型化声明依赖图,并应用一组语义感知算子,将声明与其使用点解耦,使其可移除同时保持程序类型正确。细粒度的标记级最小化则留给下游缩减器完成。在C、Java和Solididity的73个基准测试中,SCYTHE与PERSES结合的结果从未比单独使用PERSES的结果更大,且在73个案例中的70个案例中结果严格更小。平均而言,该组合生成的程序小55.6%(最大达95.5%),速度快2.3倍(最大达7.4倍)。SCYTHE还能提升LATRA的性能,LATRA是一种与纯语法的PERSES不同、还应用特定语言转换的缩减器:该组合生成的程序小10.6%(最大达61.8%),平均速度快2.4倍。
英文摘要:
Automated program reduction shrinks a program into a smaller one that preserves a property of interest. Language-agnostic grammar-based reducers are easy to retarget across languages, but because they reason only about syntax, they cannot perform the coupled edits needed to remove whole declarations, e.g., a method cannot be deleted while it is still called. As a result, they waste oracle calls on edits that cannot succeed and often leave irrelevant declarations behind. We present SCYTHE, a fast, semantic-aware pre-processing step that runs in front of any grammar-based reducer without modifying it. SCYTHE encodes the program as a typed declaration dependency graph and applies a set of semantic-aware operators that decouple declarations from their use sites, making them removable while keeping the program well-typed. Fine-grained token-level minimization is then left to the downstream reducer. On 73 benchmarks across C, Java, and Solidity, combining SCYTHE with PERSES never yields a larger result than PERSES alone, and a strictly smaller one on 70 of 73 cases. On average, the combination produces programs 55.6% smaller (up to 95.5%) and is 2.3$\times$ faster (up to 7.4$\times$). SCYTHE also boosts LATRA, a reducer that, unlike the purely syntactic PERSES, also applies language-specific transformations: the combination produces programs 10.6% smaller (up to 61.8%) and is 2.4$\times$ faster on average. Video: https://youtu.be/uEq_YYU0zZw
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。