A High-Level Separation Logic for Heap Space under Garbage Collection (Extended Version) - Inria - Institut national de recherche en sciences et technologies du numérique Accéder directement au contenu
Article Dans Une Revue Proceedings of the ACM on Programming Languages Année : 2023

A High-Level Separation Logic for Heap Space under Garbage Collection (Extended Version)

Résumé

We present a Separation Logic with space credits for reasoning about heap space in a sequential call-by-value lambda-calculus equipped with garbage collection and mutable state. A key challenge is to design sound, modular, lightweight mechanisms for establishing the unreachability of a block. Prior work in this area uses pointed-by assertions to keep track of the predecessors of every block, but is carried out in the setting of an assembly-like programming language. We take up the challenge in the setting of a high-level language, where a key problem is to identify and reason about the memory locations that the garbage collector considers as roots. For this purpose, we propose novel "stackable" assertions, which keep track of the existence of stack-to-heap pointers without explicitly recording their origin. Furthermore, we explain how to reason about closures -- concrete heap-allocated data structures that implement the abstract concept of a first-class function. We demonstrate the expressiveness and tractability of our program logic via a range of examples, including recursive functions on linked lists, objects implemented using closures and mutable internal state, recursive functions in continuation-passing style, and three stack implementations that exhibit different space bounds. These last three examples illustrate reasoning about the reachability of the items stored in a container as well as amortized reasoning about space. All of our results are proved in Coq on top of Iris.
Fichier principal
Vignette du fichier
spacelambda-extended.pdf (692.92 Ko) Télécharger le fichier
Origine : Fichiers produits par l'(les) auteur(s)

Dates et versions

hal-03823056 , version 1 (20-10-2022)
hal-03823056 , version 2 (14-11-2022)

Licence

Paternité

Identifiants

Citer

Alexandre Moine, Arthur Charguéraud, François Pottier. A High-Level Separation Logic for Heap Space under Garbage Collection (Extended Version). Proceedings of the ACM on Programming Languages, 2023, 7 (POPL), pp.718-747. ⟨10.1145/3571218⟩. ⟨hal-03823056v2⟩
259 Consultations
272 Téléchargements

Altmetric

Partager

Gmail Facebook X LinkedIn More