Journal Articles Proceedings of the ACM on Programming Languages Year : 2021

Modular, compositional, and executable formal semantics for LLVM IR

Abstract

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
Origin Publisher files allowed on an open archive

Dates and versions

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

Identifiers

Cite

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⟩
210 View
214 Download

Altmetric

Share

More