Proof Pearl: Faithful Computation and Extraction of µ-Recursive Algorithms in Coq
Résumé
Basing on an original Coq implementation of unbounded linear search for partially decidable predicates, we study the computational contents of µ-recursive functions via their syntactic representation, and a correct by construction Coq interpreter for this abstract syntax. When this interpreter is extracted, we claim the resulting OCaml code to be the natural combination of the implementation of the µ-recursive schemes of composition, primitive recursion and unbounded minimization of partial (i.e., possibly non-terminating) functions. At the level of the fully specified Coq terms, this implies the representation of higher-order functions of which some of the arguments are themselves partial functions. We handle this issue using some techniques coming from the Braga method. Hence we get a faithful embedding of µ-recursive algorithms into Coq preserving not only their extensional meaning but also their intended computational behavior. We put a strong focus on the quality of the Coq artifact which is both self contained and with a line of code count of less than 1k in total.
Mots clés
Theory of computation → Models of computation
µ-recursive functions
computational contents
Coq
extraction
OCaml
Theory of computation → Functional constructs
Software and its engineering → Formal methods
Software and its engineering → Functional languages
Theory of computation → Higher order logic phrases Unbounded linear search
Theory of computation → Type theory
Domaines
Informatique [cs]Origine | Fichiers produits par l'(les) auteur(s) |
---|---|
Licence |