Higher-Order unification for free!
Résumé
Specifying and implementing a proof system from scratch requires significant effort. Logical Frameworks and Higher Order Logic Programming Languages provide
dedicated, high-level Meta Languages (ML) to facilitate this task in two key ways: 1) variable binding and substitution are for free when ML binders represent object logic ones; 2) proof construction, and even proof search, are greatly simplified by leveraging the unification procedure provided by the ML. Notable examples of ML are Elf~\cite{elf}, Twelf~\cite{twelf}, $\lambda$Prolog~\cite{miller_nadathur_2012} and Isabelle~\cite{10.1007/978-3-540-71067-7_7} which have been utilized to implement various formal systems such as First Order Logic~\cite{felty88cade}, Set Theory~\cite{10.1007/BF00881873}, Higher Order Logic~\cite{books/sp/NipkowPW02}, and even the Calculus of Constructions~\cite{felty93lics}.The object logic we are interested in is Coq's Calculus of Inductive Constructions (CIC)\cite{Coq-refman}. We aim to develop a higher-order unification-based proof search procedure for it using the ML Elpi~\cite{dunchev15lpar}, a dialect of $\lambda$Prolog. Elpi's equational theory includes $\eta\beta$ equivalence and features a higher-order unification procedure \Ue restricted to the pattern fragment~\cite{miller92jsc}.
Elpi offers an encoding of CIC suitable for meta-programming~\cite{tassi:hal-01637063,tassi:hal-01897468,gregoire:hal-03800154,newtc} but restricts \Ue to roughly first-order unification problems only. We refer to this basic encoding as \Fo. In this paper we propose a more well-behaved encoding called \Ho, and show how to translate unification problems from \Fo{} to corresponding ones in \Ho. Consequently, we derive \Uo{}, the higher-order unification procedure of \Fo{} that honours $\eta\beta$-equivalence (for CIC functions), addresses problems within the pattern fragment, and allows for the use of heuristics to deal with problems outside the pattern fragment. Moreover, as \Uo{} delegates most of the work to \Ue, it can be used to efficiently simulate a logic program in \Fo{} by taking advantage of unification-related optimizations of the ML, such as clause indexing.
Domaines
Informatique [cs]Origine | Fichiers produits par l'(les) auteur(s) |
---|