Modular, compositional, and executable formal semantics for LLVM IR - Archive ouverte HAL
Article Dans Une Revue Proceedings of the ACM on Programming Languages Année : 2021

Modular, compositional, and executable formal semantics for LLVM IR

Résumé

This paper presents a novel formal semantics, mechanized in Coq, for a large, sequential subset of the LLVM IR. In contrast to previous approaches, which use relationally-specified operational semantics, this new semantics is based on monadic interpretation of interaction trees, a structure that provides a more compositional approach to defining language semantics while retaining the ability to extract an executable interpreter. Our semantics handles many of the LLVM IR's non-trivial language features and is constructed modularly in terms of event handlers, including those that deal with nondeterminism in the specification. We show how this semantics admits compositional reasoning principles derived from the interaction trees equational theory of weak bisimulation, which we extend here to better deal with nondeterminism, and we use them to prove that the extracted reference interpreter faithfully refines the semantic model. We validate the correctness of the semantics by evaluating it on unit tests and LLVM IR programs generated by HELIX.
Fichier principal
Vignette du fichier
vellvm_design_final.pdf (516.65 Ko) Télécharger le fichier
Origine Fichiers éditeurs autorisés sur une archive ouverte

Dates et versions

hal-03525711 , version 1 (14-01-2022)

Identifiants

Citer

Yannick Zakowski, Calvin Beck, Irene Yoon, Ilia Zaichuk, Vadim Zaliva, et al.. Modular, compositional, and executable formal semantics for LLVM IR. Proceedings of the ACM on Programming Languages, 2021, 5 (ICFP), pp.1-30. ⟨10.1145/3473572⟩. ⟨hal-03525711⟩
195 Consultations
209 Téléchargements

Altmetric

Partager

More