Automatic Amortised Analysis of Dynamic Memory Allocation for Lazy Functional Programs

被引:15
|
作者
Simoes, Hugo [1 ]
Vasconcelos, Pedro [1 ]
Florido, Mario [1 ]
Jost, Steffen [2 ]
Hammond, Kevin [3 ]
机构
[1] Univ Porto, LIACC, P-4100 Oporto, Portugal
[2] Univ Munich, Munich, Germany
[3] Univ St Andrews, St Andrews, Fife, Scotland
基金
英国工程与自然科学研究理事会;
关键词
lazy evaluation; resource analysis; amortisation; type systems; HEAP-SPACE ANALYSIS; LANGUAGES; COMPLEXITY; SEMANTICS; USAGE;
D O I
10.1145/2398856.2364575
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
This paper describes the first successful attempt, of which we are aware, to define an automatic, type-based static analysis of resource bounds for lazy functional programs. Our analysis uses the automatic amortisation approach developed by Hofmann and Jost, which was previously restricted to eager evaluation. In this paper, we extend this work to a lazy setting by capturing the costs of unevaluated expressions in type annotations and by amortising the payment of these costs using a notion of lazy potential. We present our analysis as a proof system for predicting heap allocations of a minimal functional language (including higher-order functions and recursive data types) and define a formal cost model based on Launchbury's natural semantics for lazy evaluation. We prove the soundness of our analysis with respect to the cost model. Our approach is illustrated by a number of representative and non-trivial examples that have been analysed using a prototype implementation of our analysis.
引用
收藏
页码:165 / 176
页数:12
相关论文
共 50 条
  • [31] Testing and tracing lazy functional programs using QuickCheck and Hat
    Claessen, Koen
    Runciman, Colin
    Chitil, Olaf
    Hughes, John
    Wallace, Malcolm
    Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), 2004, 2638 : 59 - 99
  • [32] Theoretical foundations for the declarative debugging of lazy functional logic programs
    Cabalbero, R
    López-Fraguas, FJ
    Rodríguez-Artalejo, M
    FUNCTIONAL AND LOGIC PROGRAMMING, PROCEEDINGS, 2001, 2024 : 170 - 184
  • [33] Rules plus strategies for transforming lazy functional logic programs
    Alpuente, M
    Falaschi, M
    Moreno, G
    Vidal, G
    THEORETICAL COMPUTER SCIENCE, 2004, 311 (1-3) : 479 - 525
  • [34] The cache behaviour of large lazy functional programs on stock hardware
    Nethercote, N
    Mycroft, A
    ACM SIGPLAN NOTICES, 2003, 38 (02) : 44 - 55
  • [35] The results of: Profiling large-scale lazy functional programs
    Jarvis, SA
    Morgan, RG
    IMPLEMENTATION OF FUNCTIONAL LANGUAGES, 1997, 1268 : 200 - 221
  • [36] Understanding memory allocation of scheme programs
    Serrano, M
    Boehm, HJ
    ACM SIGPLAN NOTICES, 2000, 35 (09) : 245 - 256
  • [37] Testing and tracing lazy functional programs using QuickCheck and Hat
    Claessen, K
    Runciman, C
    Chitil, O
    Hughes, J
    Wallace, M
    ADVANCED FUNCTIONAL PROGRAMMING, 2003, 2638 : 59 - 99
  • [38] Understanding memory allocation of scheme programs
    Serrano, Manuel
    Boehm, Hans-J.
    HP Laboratories Technical Report, 2000, (62):
  • [39] Java']Java memory allocation with lazy worst fit for small objects
    Choi, HK
    Chung, YC
    Moon, SM
    COMPUTER JOURNAL, 2005, 48 (04): : 437 - 442
  • [40] AUTOMATIC VERIFICATION OF FUNCTIONAL PROGRAMS
    DROBUSHEVICH, GA
    ZUBOVICH, KA
    CYBERNETICS, 1990, 26 (04): : 491 - 502