Refunctionalization of Abstract Abstract Machines Bridging the Gap between Abstract Abstract Machines and Abstract Definitional Interpreters (Functional Pearl)

被引:6
|
作者
Wei, Guannan [1 ]
Decker, James [1 ]
Rompf, Tiark [1 ]
机构
[1] Purdue Univ, Dept Comp Sci, 305 N Univ St, W Lafayette, IN 47907 USA
关键词
refunctionalization; abstract machines; control-flow analysis; Scala; INTERDERIVABLE SEMANTIC SPECIFICATIONS; SCHEME PROGRAMMING LANGUAGE; COMPUTATION; EVALUATORS;
D O I
10.1145/3236800
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
The Abstracting abstract machines is a systematic methodology for constructing sound static analyses for higher-order languages, by deriving small-step abstract abstract machines (AAMs) that perform abstract interpretation from abstract machines that perform concrete evaluation. Darais et al. apply the same underlying idea to monadic definitional interpreters, and obtain monadic abstract definitional interpreters (ADIs) that perform abstract interpretation in big-step style using monads. Yet, the relation between small-step abstract abstract machines and big-step abstract definitional interpreters is not well studied. In this paper, we explain their functional correspondence and demonstrate how to systematically transform small-step abstract abstract machines into big-step abstract definitional interpreters. Building on known semantic interderivation techniques from the concrete evaluation setting, the transformations include linearization, lightweight fusion, disentanglement, refunctionalization, and the left inverse of the CPS transform. Linearization expresses nondeterministic choice through first-order data types, after which refunctionalization transforms the first-order data types that represent continuations into higher-order functions. The refunctionalized AAM is an abstract interpreter written in continuation-passing style (CPS) with two layers of continuations, which can be converted back to direct style with delimited control operators. Based on the known correspondence between delimited control and monads, we demonstrate that the explicit use of monads in abstract definitional interpreters is optional. All transformations properly handle the collecting semantics and nondeterminism of abstract interpretation. Remarkably, we reveal how precise call/return matching in control-flow analysis can be obtained by refunctionalizing a small-step abstract abstract machine with proper caching.
引用
收藏
页数:28
相关论文
共 50 条
  • [1] Refunctionalization of Abstract Abstract Machines
    Wei, Guannan
    Decker, James
    Rompf, Tiark
    [J]. PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2018, 2
  • [2] Optimizing Abstract Abstract Machines
    Johnson, J. Ian
    Labich, Nicholas
    Might, Matthew
    Van Horn, David
    [J]. ACM SIGPLAN NOTICES, 2013, 48 (09) : 443 - 454
  • [3] MAKING ABSTRACT MACHINES LESS ABSTRACT
    HANNAN, J
    [J]. LECTURE NOTES IN COMPUTER SCIENCE, 1991, 523 : 618 - 635
  • [4] Abstract machines
    Raunig, Herald
    [J]. LOGOS, 2010, (01): : 207 - 215
  • [5] Distilling Abstract Machines
    Accattoli, Beniamino
    Barenbaum, Pablo
    Mazza, Damiano
    [J]. ACM SIGPLAN NOTICES, 2014, 49 (09) : 363 - 376
  • [6] CONCURRENT ABSTRACT MACHINES
    BERRY, G
    [J]. LECTURE NOTES IN COMPUTER SCIENCE, 1991, 494 : 49 - 49
  • [7] INTERACTING ABSTRACT MACHINES
    WINKOWSKI, J
    [J]. BULLETIN DE L ACADEMIE POLONAISE DES SCIENCES-SERIE DES SCIENCES MATHEMATIQUES ASTRONOMIQUES ET PHYSIQUES, 1972, 20 (02): : 181 - +
  • [8] Abstract parallel machines
    O'Donnell, J
    Rünger, G
    [J]. COMPUTERS AND ARTIFICIAL INTELLIGENCE, 2000, 19 (02): : 105 - 129
  • [9] Abstract λ-Calculus Machines
    Kluge, Werner E.
    [J]. CENTRAL EUROPEAN FUNCTIONAL PROGRAMMING SCHOOL, 2008, 5161 : 112 - 157
  • [10] Principles of abstract machines
    Diehl, S
    Hartel, PH
    Sestoft, P
    [J]. FUTURE GENERATION COMPUTER SYSTEMS, 2000, 16 (07) : V - VI