arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1709.08016cs.PL
收藏

一种函数式程序的增量切片方法

An Incremental Slicing Method for Functional Programs

Prasanna Kumar K., Amitabha Sanyal, Amey Karkare

摘要:

切片的几个应用程序需要一个程序相对于一个以上的切片标准进行切片。程序专门化、并行化和内聚性测量是这些应用的例子。这些应用程序可以受益于增量静态切片方法,其中相对于一个标准的切片计算的很大程度上可以重新用于另一个标准。在本文中,我们考虑的问题,增量切片的功能性程序。首先,我们提出了一个非增量版本的切片算法,它做一个多变量分析1的功能。由于多变量分析往往是昂贵的,我们计算每个函数的紧凑上下文无关的摘要,然后在函数的调用站点使用此摘要。函数摘要的构造非常重要,有助于增量版本的开发。另一方面,增量方法由一次性的预计算步骤组成,该步骤使用非增量版本相对于固定的默认切片标准对程序进行切片,并将结果进一步处理为规范形式。提出了一个实际的切片标准,增量步骤涉及一个低成本的计算,使用的结果,预先计算,以获得切片。我们已经实现了一个原型的切片器的一个纯子集的计划,对和列表作为唯一的代数数据类型。我们的实验表明,切片器的增量步骤比非增量版本快几个数量级。我们还证明了我们的增量算法的正确性,相对于非增量版本。

英文摘要:

Several applications of slicing require a program to be sliced with respect to more than one slicing criterion. Program specialization, parallelization and cohesion measurement are examples of such applications. These applications can benefit from an incremental static slicing method in which a significant extent of the computations for slicing with respect to one criterion could be reused for another. In this paper, we consider the problem of incremental slicing of functional programs. We first present a non-incremental version of the slicing algorithm which does a polyvariant analysis 1 of functions. Since polyvariant analyses tend to be costly, we compute a compact context-independent summary of each function and then use this summary at the call sites of the function. The construction of the function summary is non-trivial and helps in the development of the incremental version. The incremental method, on the other hand, consists of a one-time pre-computation step that uses the non-incremental version to slice the program with respect to a fixed default slicing criterion and processes the results further to a canonical form. Presented with an actual slicing criterion, the incremental step involves a low-cost computation that uses the results of the pre-computation to obtain the slice. We have implemented a prototype of the slicer for a pure subset of Scheme, with pairs and lists as the only algebraic data types. Our experiments show that the incremental step of the slicer runs orders of magnitude faster than the non-incremental version. We have also proved the correctness of our incremental algorithm with respect to the non-incremental version.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑