A Unifying Type-Theory for Higher-Order (Amortized) Cost Analysis

被引:11
|
作者
Rajani, Vineet [1 ]
Gaboardi, Marco [2 ]
Garg, Deepak [3 ]
Hoffmann, Jan [4 ]
机构
[1] Max Planck Inst Secur & Privacy, Bochum, Germany
[2] Boston Univ, Boston, MA 02215 USA
[3] Max Planck Inst Software Syst, Saarland Informat Campus, Saarbrucken, Germany
[4] Carnegie Mellon Univ, Pittsburgh, PA 15213 USA
基金
美国国家科学基金会;
关键词
amortized cost analysis; type theory; relative completeness;
D O I
10.1145/3434308
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
This paper presents lambda-amor, a new type-theoretic framework for amortized cost analysis of higher-order functional programs and shows that existing type systems for cost analysis can be embedded in it lambda-amor introduces a new modal type for representing potentials - costs that have been accounted for, but not yet incurred, which are central to amortized analysis. Additionally, lambda-amor relies on standard type-theoretic concepts like affineness, refinement types and an indexed cost monad lambda-amor is proved sound using a rather simple logical relation. We embed two existing type systems for cost analysis in lambda-amor showing that, despite its simplicity, lambda-amor can simulate cost analysis for different evaluation strategies (call-by-name and callby-value), in different styles (effect-based and coeffect-based), and with or without amortization. One of the embeddings also implies that lambda-amor is relatively complete for all terminating PCF programs.
引用
收藏
页数:28
相关论文
共 50 条
  • [1] A Modal Type Theory of Expected Cost in Higher-Order Probabilistic Programs
    Rajani, Vineet
    Barthe, Gilles
    Garg, Deepak
    [J]. Proceedings of the ACM on Programming Languages, 2024, 8 (OOPSLA2)
  • [2] A Theory of Higher-Order Subtyping with Type Intervals
    Stucki, Sandro
    Giarrusso, Paolo G.
    [J]. PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2021, 5
  • [3] Higher-order intensional type analysis
    Weirich, S
    [J]. PROGRAMMING LANGUAGES AND SYSTEMS, PROCEEDINGS, 2002, 2305 : 98 - 114
  • [4] THE THEORY OF STRICTNESS ANALYSIS FOR HIGHER-ORDER FUNCTIONS
    BURN, GL
    HANKIN, CL
    ABRAMSKY, S
    [J]. LECTURE NOTES IN COMPUTER SCIENCE, 1986, 217 : 42 - 62
  • [5] A CONSISTENT HIGHER-ORDER THEORY WITHOUT A (HIGHER-ORDER) MODEL
    FORSTER, T
    [J]. ZEITSCHRIFT FUR MATHEMATISCHE LOGIK UND GRUNDLAGEN DER MATHEMATIK, 1989, 35 (05): : 385 - 386
  • [6] DEVELOPMENT TRANSFORMATION BASED ON HIGHER-ORDER TYPE THEORY
    LU, JG
    XU, JF
    [J]. LECTURE NOTES IN COMPUTER SCIENCE, 1992, 613 : 58 - 70
  • [7] Conservativity of Type Theory over Higher-Order Arithmetic
    Otten, Daniel
    van den Berg, Benno
    [J]. 32ND EACSL ANNUAL CONFERENCE ON COMPUTER SCIENCE LOGIC, CSL 2024, 2024, 288
  • [8] HIGHER-ORDER THEORY OF GRAVITATION
    PANDEY, SN
    [J]. INTERNATIONAL JOURNAL OF THEORETICAL PHYSICS, 1988, 27 (06) : 695 - 702
  • [9] HIGHER-ORDER LEVERMORE THEORY
    POMRANING, GC
    [J]. JOURNAL OF QUANTITATIVE SPECTROSCOPY & RADIATIVE TRANSFER, 1984, 32 (03): : 185 - 190
  • [10] A Higher-Order Theory of Presupposition
    Martin, Scott
    Pollard, Carl
    [J]. STUDIA LOGICA, 2012, 100 (04) : 727 - 751