Higher-Order unification for free! - Inria - Institut national de recherche en sciences et technologies du numérique Accéder directement au contenu
Pré-Publication, Document De Travail Année : 2024

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.
Fichier principal
Vignette du fichier
main.pdf (695.07 Ko) Télécharger le fichier
Origine : Fichiers produits par l'(les) auteur(s)

Dates et versions

hal-04547069 , version 1 (15-04-2024)
hal-04547069 , version 2 (27-04-2024)

Licence

Paternité

Identifiants

  • HAL Id : hal-04547069 , version 2

Citer

Davide Fissore, Enrico Tassi. Higher-Order unification for free!: Reusing the meta-language unification for the object language. 2024. ⟨hal-04547069v2⟩
0 Consultations
0 Téléchargements

Partager

Gmail Facebook X LinkedIn More