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 条
  • [1] AUTOMATIC PARALLELIZATION OF LAZY FUNCTIONAL PROGRAMS
    HOGEN, G
    KINDLER, A
    LOOGEN, R
    LECTURE NOTES IN COMPUTER SCIENCE, 1992, 582 : 254 - 268
  • [2] LAZY DEBUGGING OF LAZY FUNCTIONAL PROGRAMS
    SNYDER, RM
    NEW GENERATION COMPUTING, 1990, 8 (02) : 139 - 161
  • [3] Memory allocation with lazy fits
    Chung, YC
    Moon, SM
    ACM SIGPLAN NOTICES, 2001, 36 (01) : 65 - 70
  • [4] Profiling and Analysis of Object Lazy Allocation in Java']Java Programs
    Shi, Jianjun
    Ji, Weixing
    Zhang, Lulu
    Gao, Yujin
    Zhang, Han
    Qing, Duzheng
    2016 17TH IEEE/ACIS INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, ARTIFICIAL INTELLIGENCE, NETWORKING AND PARALLEL/DISTRIBUTED COMPUTING (SNPD), 2016, : 591 - 596
  • [5] Dynamic slicing of lazy functional programs based on redex trails
    DIA, Technical University of Madrid, Campus de Montegancedo s/n, 28660 Boadilla del Monte, Spain
    不详
    High Order Symbol Comput, 2008, 1-2 (147-192):
  • [6] A NEW VERSION OF THE LINKAGE ANALYSIS PROGRAMS - DYNAMIC MEMORY ALLOCATION, AMALGAMATION, AND PARALLELIZATION
    YOUNG, A
    WEEKS, DE
    LATHROP, GM
    AMERICAN JOURNAL OF HUMAN GENETICS, 1995, 57 (04) : 1187 - 1187
  • [7] Flow analysis of lazy higher-order functional programs
    Jones, Neil D.
    Andersen, Nils
    THEORETICAL COMPUTER SCIENCE, 2007, 375 (1-3) : 120 - 136
  • [8] Dynamic memory allocation Behavior in Java']Java programs
    Li, RCL
    Fong, AS
    Chun, HW
    Tam, CH
    COMPUTERS AND THEIR APPLICATIONS, 2001, : 362 - 365
  • [9] Specialization of lazy functional logic programs
    Alpuente, M
    Falaschi, M
    Julian, P
    Vidal, G
    ACM SIGPLAN NOTICES, 1997, 32 (12) : 151 - 162
  • [10] Axioms for strict and lazy functional programs
    Stärk, RE
    ANNALS OF PURE AND APPLIED LOGIC, 2005, 133 (1-3) : 293 - 318