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 条
  • [41] Automatic verification of functional programs
    Drobushevich, G.A.
    Zubovich, K.A.
    Cybernetics (English Translation of Kibernetika), 1991, 26 (04):
  • [42] DYNAMIC MEMORY ALLOCATION IN FORTRAN
    FRIDMAN, VM
    MEDVEDIS, IE
    PROGRAMMING AND COMPUTER SOFTWARE, 1983, 9 (05) : 258 - 260
  • [43] DYNAMIC MEMORY ALLOCATION.
    Fernandes, Antonio
    Byte, 1987, 12 (0l): : 69 - 173
  • [44] A DYNAMIC MEMORY ALLOCATION ALGORITHM
    BOVET, DP
    ESTRIN, G
    IEEE TRANSACTIONS ON COMPUTERS, 1970, C 19 (05) : 403 - &
  • [45] Automated Analysis of Data-Dependent Programs with Dynamic Memory
    Abdulla, Parosh Aziz
    Atto, Muhsin
    Cederberg, Jonathan
    Ji, Ran
    AUTOMATED TECHNOLOGY FOR VERIFICATION AND ANALYSIS, PROCEEDINGS, 2009, 5799 : 197 - +
  • [46] Automatic Discovery of Transition Symmetry in Multithreaded Programs Using Dynamic Analysis
    Yang, Yu
    Chen, Xiaofang
    Gopalakrishnan, Ganesh
    Wang, Chao
    MODEL CHECKING SOFTWARE, 2009, 5578 : 279 - +
  • [47] Usage counting analysis for lazy functional languages
    Hamilton, GW
    INFORMATION AND COMPUTATION, 1998, 146 (02) : 100 - 137
  • [48] Dynamic memory allocation and communication protocols
    Bollella, Gregory
    Dr. Dobb's Journal of Software Tools for Professional Programmer, 1997, 22 (03):
  • [50] Upper Bounds for Dynamic Memory Allocation
    Hasan, Yusuf
    Chen, Wei-Mei
    Chang, J. Morris
    Gharaibeh, Bashar M.
    IEEE TRANSACTIONS ON COMPUTERS, 2010, 59 (04) : 468 - 477