Space-Efficient Manifest Contracts

被引:0
|
作者
Greenberg, Michael [1 ]
机构
[1] Princeton Univ, Princeton, NJ 08544 USA
关键词
contracts; pre- and post-conditions; function proxy; coercions; space efficiency; CHECKING;
D O I
10.1145/2775051.2676967
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
The standard algorithm for higher-order contract checking can lead to unbounded space consumption and can destroy tail recursion, altering a program's asymptotic space complexity. While space efficiency for gradual types-contracts mediating untyped and typed code-is well studied, sound space efficiency for manifest contracts-contracts that check stronger properties than simple types, e.g., "is a natural" instead of "is an integer"-remains an open problem. We show how to achieve sound space efficiency for manifest contracts with strong predicate contracts. The essential trick is breaking the contract checking down into coercions: structured, blame-annotated lists of checks. By carefully preventing duplicate coercions from appearing, we can restore space efficiency while keeping the same observable behavior.
引用
收藏
页码:181 / 194
页数:14
相关论文
共 50 条
  • [1] Space-Efficient Latent Contracts
    Greenberg, Michael
    [J]. TRENDS IN FUNCTIONAL PROGRAMMING (TFP 2016), 2019, 10447 : 3 - 23
  • [2] The Space-Efficient Core of Vadalog
    Berger, Gerald
    Gottlob, Georg
    Pieris, Andreas
    Sallinger, Emanuel
    [J]. PROCEEDINGS OF THE 38TH ACM SIGMOD-SIGACT-SIGAI SYMPOSIUM ON PRINCIPLES OF DATABASE SYSTEMS (PODS '19), 2019, : 270 - 284
  • [3] SPACE-EFFICIENT PARALLEL MERGING
    KATAJAINEN, J
    LEVCOPOULOS, C
    PETERSSON, O
    [J]. RAIRO-INFORMATIQUE THEORIQUE ET APPLICATIONS-THEORETICAL INFORMATICS AND APPLICATIONS, 1993, 27 (04): : 295 - 310
  • [4] Space-efficient gradual typing
    Herman D.
    Tomb A.
    Flanagan C.
    [J]. Higher-Order and Symbolic Computation, 2010, 23 (02) : 167 - 189
  • [5] Space-efficient search algorithms
    Korf, RE
    [J]. ACM COMPUTING SURVEYS, 1995, 27 (03) : 337 - 339
  • [6] SPACE-EFFICIENT PARALLEL MERGING
    KATAJAINEN, J
    LEVCOPOULOS, C
    PETERSSON, O
    [J]. LECTURE NOTES IN COMPUTER SCIENCE, 1992, 605 : 37 - 49
  • [7] Space-Efficient Graph Kernelizations
    Kammer, Frank
    Sajenko, Andrej
    [J]. THEORY AND APPLICATIONS OF MODELS OF COMPUTATION, TAMC 2024, 2024, 14637 : 260 - 271
  • [8] Space-Efficient Informational Redundancy
    Glasser, Christian
    [J]. ALGORITHMS AND COMPUTATION, PROCEEDINGS, 2008, 5369 : 448 - 459
  • [9] Space-efficient informational redundancy
    Glasser, Christian
    [J]. JOURNAL OF COMPUTER AND SYSTEM SCIENCES, 2010, 76 (08) : 792 - 811
  • [10] The Space-Efficient Core of Vadalog
    Berger, Gerald
    Gottlob, Georg
    Pieris, Andreas
    Sallinger, Emanuel
    [J]. ACM TRANSACTIONS ON DATABASE SYSTEMS, 2022, 47 (01):