Conference Papers Year : 2024

Source-to-Source Optimizations Validated using Separation Logic

Arthur Charguéraud
Thomas Koehler

Abstract

We present a demo of OptiTrust, an interactive framework for optimizing general-purpose programs via series of programmer-guided, source-to-source transformations. Optimization steps are described in transformation scripts, expressed as OCaml programs. At every step, the programmer may interactively visualize the effect of the transformation as the difference between two pieces of human-readable code. The framework currently applies to C code. That said, our internal AST is based on the imperative lambda-calculus, thus we expect it to be straightforward to extend OptiTrust for optimizing OCaml code. A central question is how to verify that nontrivial transformations preserve the semantics of the code. To that end, we require the programmer to provide Separation Logic annotations, and use them to compute resource usage throughout the code. As we show, this information suffices to justify the correctness of numerous essential source-to-source transformations, such as swapping of instructions, swapping of loops, hoisting of instructions out of loops, etc.
Fichier principal
Vignette du fichier
jfla2024-paper-8.pdf (602.02 Ko) Télécharger le fichier
Origin Files produced by the author(s)

Dates and versions

hal-04406229 , version 1 (19-01-2024)

Licence

Identifiers

  • HAL Id : hal-04406229 , version 1

Cite

Guillaume Bertholon, Arthur Charguéraud, Thomas Koehler. Source-to-Source Optimizations Validated using Separation Logic. 35es Journées Francophones des Langages Applicatifs (JFLA 2024), Jan 2024, Saint-Jacut-de-la-Mer, France. ⟨hal-04406229⟩
110 View
145 Download

Share

More