Skip to Main content Skip to Navigation
Conference papers

Hierarchy Builder: algebraic hierarchies made easy in Coq with Elpi

Abstract : It is nowadays customary to organize libraries of machine checked proofs around hierarchies of algebraic structures [2, 6, 8, 16, 18, 23, 27]. One influential example is the Mathematical Components library on top of which the long and intricate proof of the Odd Order Theorem could be fully formalized [14]. Still, building algebraic hierarchies in a proof assistant such as Coq [9] requires a lot of manual labor and often a deep expertise in the internals of the prover [13, 17]. Moreover, according to our experience [26], making a hierarchy evolve without causing breakage in client code is equally tricky: even a simple refactoring such as splitting a structure into two simpler ones is hard to get right. In this paper we describe HB, a high level language to build hierarchies of algebraic structures and to make these hierarchies evolve without breaking user code. The key concepts are the ones of factory, builder and abbreviation that let the hierarchy developer describe an actual interface for their library. Behind that interface the developer can provide appropriate code to ensure retro compatibility. We implement the HB language in the hierarchy-builder addon for the Coq system using the Elpi [11, 28] extension language.
Complete list of metadata

Cited literature [26 references]  Display  Hide  Download
Contributor : Cyril Cohen <>
Submitted on : Wednesday, May 6, 2020 - 12:38:48 PM
Last modification on : Thursday, April 1, 2021 - 4:15:56 PM


Files produced by the author(s)




Cyril Cohen, Kazuhiko Sakaguchi, Enrico Tassi. Hierarchy Builder: algebraic hierarchies made easy in Coq with Elpi. FSCD 2020 - 5th International Conference on Formal Structures for Computation and Deduction, Jun 2020, Paris, France. pp.34:1--34:21, ⟨10.4230/LIPIcs.FSCD.2020.34⟩. ⟨hal-02478907v5⟩



Record views


Files downloads