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

一种近似程序变换的语义

A Semantics for Approximate Program Transformations

Edwin Westbrook, Swarat Chaudhuri

摘要:

近似程序转换是一种可以在指定的经验误差范围内改变程序语义的转换。这种转换有广泛的应用:它们可以减少计算时间,功耗和内存使用,并且在某些情况下,可以允许实现不可计算的操作。近似程序变换的正确性证明是定量的。不幸的是,与标准程序转换不同,目前还没有模块化的方法来证明近似转换本身的正确性。误差界必须证明每个转换程序单独,并必须重新证明每次修改程序或一组不同的近似应用。在本文中,我们给出了一个语义,使定量推理的一个大类的近似程序变换的本地,组合的方式。我们的语义是基于程序之间的距离的概念,它定义了一个近似变换是正确的错误界意味着什么。关键的见解是,程序之间的距离一般不能用度量空间和实数来表示。相反,我们的语义承认每个类型构造的距离的自然概念;例如,数字被用作数值数据的距离,函数被用作函数数据的距离,多态数据项被用作多态数据的距离。然后,我们将展示我们的语义如何应用于两个示例近似:用浮点数替换实数和循环穿孔。

英文摘要:

An approximate program transformation is a transformation that can change the semantics of a program within a specified empirical error bound. Such transformations have wide applications: they can decrease computation time, power consumption, and memory usage, and can, in some cases, allow implementations of incomputable operations. Correctness proofs of approximate program transformations are by definition quantitative. Unfortunately, unlike with standard program transformations, there is as of yet no modular way to prove correctness of an approximate transformation itself. Error bounds must be proved for each transformed program individually, and must be re-proved each time a program is modified or a different set of approximations are applied. In this paper, we give a semantics that enables quantitative reasoning about a large class of approximate program transformations in a local, composable way. Our semantics is based on a notion of distance between programs that defines what it means for an approximate transformation to be correct up to an error bound. The key insight is that distances between programs cannot in general be formulated in terms of metric spaces and real numbers. Instead, our semantics admits natural notions of distance for each type construct; for example, numbers are used as distances for numerical data, functions are used as distances for functional data, an polymorphic lambda-terms are used as distances for polymorphic data. We then show how our semantics applies to two example approximations: replacing reals with floating-point numbers, and loop perforation.

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

↑