Affiliation:
1. MPI-SWS, Germany
2. Princeton University, USA
Abstract
Incremental computation aims to speed up re-runs of a program after its inputs have been modified slightly. It works by recording a trace of the program's first run and propagating changes through the trace in incremental runs, trying to re-use as much of the original trace as possible. The recent work CostIt is a type and effect system to establish the time complexity of incremental runs of a program, as a function of input changes. However, CostIt is limited in two ways. First, it prohibits input changes that influence control flow. This makes it impossible to type programs that, for instance, branch on inputs that may change. Second, the soundness of CostIt is proved relative to an abstract cost semantics, but it is unclear how the semantics can be realized.
In this paper, we address both these limitations. We present DuCostIt, a re-design of CostIt, that combines reasoning about costs of change propagation and costs of from-scratch evaluation. The latter lifts the restriction on control flow changes. To obtain the type system, we refine Flow Caml, a type system for information flow analysis, with cost effects. Additionally, we inherit from CostIt index refinements to track data structure sizes and a co-monadic type. Using a combination of binary and unary step-indexed logical relations, we prove DuCostIt's cost analysis sound relative to not only an abstract cost semantics, but also a concrete semantics, which is obtained by translation to an ML-like language.
Publisher
Association for Computing Machinery (ACM)
Subject
Computer Graphics and Computer-Aided Design,Software
Reference28 articles.
1. A type theory for incremental computational complexity with control flow changes (technical appendix). Online at http://www. mpi-sws.org/~ecicek/ducostit_appendix.pdf. A type theory for incremental computational complexity with control flow changes (technical appendix). Online at http://www. mpi-sws.org/~ecicek/ducostit_appendix.pdf.
2. U. A. Acar. Self-Adjusting Computation. PhD thesis Department of Computer Science Carnegie Mellon University 2005. U. A. Acar. Self-Adjusting Computation. PhD thesis Department of Computer Science Carnegie Mellon University 2005.
3. Adaptive functional programming
4. An experimental analysis of self-adjusting computation
5. Step-Indexed Syntactic Logical Relations for Recursive and Quantified Types
Cited by
8 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. ReLoC Reloaded: A Mechanized Relational Logic for Fine-Grained
Concurrency and Logical Atomicity;Logical Methods in Computer Science;2021-07-27
2. Relational cost analysis in a functional-imperative setting;Journal of Functional Programming;2021
3. Relational cost analysis for functional-imperative programs;Proceedings of the ACM on Programming Languages;2019-07-26
4. Closure conversion is safe for space;Proceedings of the ACM on Programming Languages;2019-07-26
5. Bidirectional type checking for relational properties;Proceedings of the 40th ACM SIGPLAN Conference on Programming Language Design and Implementation;2019-06-08