An AST for Representing Programs with Invariants and Proofs - Trente-Quatrièmes Journées Francophones des Langages Applicatifs Access content directly
Conference Papers Year : 2023

An AST for Representing Programs with Invariants and Proofs


Deductive verification enables one to check that a program satisfies its specification. There are mainly two approaches: either the user provides invariants in the form of annotations and use a tool to extract proof obligations, like in, e.g., Why3; or the user verifies the program through interactive proofs, like in, e.g., CFML, by providing invariants during the proof steps. We are interested in expressing in Coq the representation of a program, accompanied with not only its invariants but also its proof terms. Concretely, we present an AST for representing source code and specification in a deep embedding style, and embedded lemmas in shallow embedding style. Such lemmas can be established using the full capabilities of the prover. We develop a way to build these ASTs from source code using CFML-style interactive tactics. We also develop a way to build these ASTs by extracting proof obligations from source code already annotated with its invariants. Besides, we provide a way to validate our ASTs by reifying them as Coq proof terms. This work is a first step towards a long term project to devise a trustworthy, userguided, source-to-source optimization framework. On the one hand, we may need to exploit invariants to justify the correctness of code transformations. On the other hand, to be able to chain transformations, we also need every transformation to update the program annotations.
Fichier principal
Vignette du fichier
jfla23_paper_6762.pdf (329.65 Ko) Télécharger le fichier
Origin : Files produced by the author(s)

Dates and versions

hal-03936618 , version 1 (12-01-2023)


  • HAL Id : hal-03936618 , version 1


Guillaume Bertholon, Arthur Charguéraud. An AST for Representing Programs with Invariants and Proofs. JFLA 2023 - 34èmes Journées Francophones des Langages Applicatifs, Jan 2023, Praz-sur-Arly, France. pp.43-58. ⟨hal-03936618⟩
55 View
163 Download


Gmail Facebook Twitter LinkedIn More