Higher-Order Rewriting with Dependent Types

Higher-order, typed logic programming languages such as lambda-Prolog and Twelf have emerged in this last decade as the solution to many of the shortcomings of rst-order languages like Prolog. A stronglytyped system allows early detection of many common programming mistakes, and it accounts for smaller and faster runtime environments. Lambda abstraction provides proper representation to the concept of bound variable, ubiquitous in mathematics. Because of these features, these languages have found in the last few years applications in several interesting areas, such as security protocols for mobile code. Unfortunately, use of these tools also evidenced a few problems in these languages, mostly due to the inadequate representation of equality that they o er. Early development of Prolog faced similar problems, which were ultimately tackled through two di erent approaches. Both of these founded their roots in the theory of Term Rewriting Systems, but evolved along quite di erent paths. Constraint Logic Programming extended Prolog by integrating decision procedures for speci c theories to the inference engine. Rewriting Logic o ered a new approach to logic programming, where term rewriting, rather than proof search, was used as model of computation. We believe that the development of higher-order languages, in order to address their current inadequacies, should evolve along similar paths. For this reason, we study in this dissertation a theory of Higher-order Term Rewriting for the LF calculus, on which Twelf is based. The results presented here can be divided in two parts. In the rst part,we analyze an extension to LF where types can also be converted modulo an equational theory. As the LF calculus is very sensitive to changes in the type conversion relation used, all the con uence properties of -reduction and (restricted) -expansion, and existence of normal forms have to re-examined. We show that our extension is conservative, and all the usual properties continue to hold, albeit in a weaker form. In the second part, we proceed in de ning a notion of rewriting. Since in a dependently typed calculus terms are allowed to appear inside types, a naive de nition, extending the one given by Nipkow for simply typed calculi, is inapplicable, as it may lead to situations where rewriting invalidates the type of an expression. Hence, we turn our attention to the study of special preorders, called dependence relations, that allow us to extract type information that is implicit in a LF signature, and use it to restrict rewriting to well-behaved instances. Dependence relations turn out also to be useful when studying con uence of rewriting, which, as usual, can be reduced to checking some special rewriting con gurations known as critical pairs. Together with a general Critical Pair Criterion, we present a specialized version, where fewer critical pairs need to be checked thanks to the type information conveyed by these preorders. A few examples conclude the presentation, demonstrating some of the potential of the concepts introduced. We present applications to Milner's Action and Process Calculi, Category Theory, and Proof Theory.

[1]  Robert A. Kowalski,et al.  The Semantics of Predicate Logic as a Programming Language , 1976, JACM.

[2]  Stefan Kahrs,et al.  Towards a Domain Theory for Termination Proofs , 1995, RTA.

[3]  Pierre-Louis Curien Categorical Combinators, Sequential Algorithms, and Functional Programming , 1993, Progress in Theoretical Computer Science.

[4]  Thom W. Frühwirth,et al.  Theory and Practice of Constraint Handling Rules , 1998, J. Log. Program..

[5]  H. Geuvers The Church-Rosser property for βη-reduction in typed λ-calculi , 1992, LICS 1992.

[6]  M. Clavel,et al.  Principles of Maude , 1996, WRLA.

[7]  George C. Necula,et al.  Compiling with proofs , 1998 .

[8]  Robert L. Constable,et al.  Nuprl as a General Logic , 1989 .

[9]  Dale Miller,et al.  A Logic Programming Language with Lambda-Abstraction, Function Variables, and Simple Unification , 1991, J. Log. Comput..

[10]  Tobias Nipkow,et al.  Modular Higher-Order E-Unification , 1991, RTA.

[11]  Neil Ghani Eta-Expansions in Dependent Type Theory - The Calculus of Constructions , 1997, TLCA.

[12]  Frank Pfenning,et al.  An Empirical Study of the Runtime Behavior of Higher-Order Logic Programs , 1992 .

[13]  F. Honsell,et al.  A Framework for De ning LogicsRobert Harper , 1987 .

[14]  Robin Milner,et al.  Calculi for Synchrony and Asynchrony , 1983, Theor. Comput. Sci..

[15]  Frank Pfenning,et al.  A Structural Proof of Cut Elimination and Its Representation in a Logical Framework , 1994 .

[16]  F. Pfenning Logic programming in the LF logical framework , 1991 .

[17]  Mark E. Stickel,et al.  Complete Sets of Reductions for Some Equational Theories , 1981, JACM.

[18]  S. C. Kleene,et al.  Introduction to Metamathematics , 1952 .

[19]  V. Breazu-Tannen,et al.  Combining algebra and higher-order types , 1988, [1988] Proceedings. Third Annual Information Symposium on Logic in Computer Science.

[20]  Jan Willem Klop,et al.  Term rewriting systems: a tutorial , 1987 .

[21]  Christian Prehofer,et al.  Solving higher order equations: from logic to programming , 2012 .

[22]  Joachim Steinbach,et al.  A Reduction Ordering for Higher-Order Terms , 1999 .

[23]  Robin Milner,et al.  Communication and concurrency , 1989, PHI Series in computer science.

[24]  Nachum Dershowitz,et al.  Completion for Rewriting Modulo a Congruence , 1987, Theor. Comput. Sci..

[25]  Roland H. C. Yap,et al.  The CLP( R ) language and system , 1992, TOPL.

[26]  D. Prawitz Natural Deduction: A Proof-Theoretical Study , 1965 .

[27]  Donald E. Knuth,et al.  Simple Word Problems in Universal Algebras††The work reported in this paper was supported in part by the U.S. Office of Naval Research. , 1970 .

[28]  Vincent van Oostrom,et al.  Comparing Combinatory Reduction Systems and Higher-order Rewrite Systems , 1993, HOA.

[29]  Herman Geuvers,et al.  Modularity of strong normalization and confluence in the algebraic-/spl lambda/-cube , 1994, Proceedings Ninth Annual IEEE Symposium on Logic in Computer Science.

[30]  Olav Lysne,et al.  A Termination Ordering for Higher Order Rewrite System , 1995, RTA.

[31]  Nachum Dershowitz Orderings for Term-Rewriting Systems , 1979, FOCS.

[32]  Tobias Nipkow Orthogonal Higher-Order Rewrite Systems are Confluent , 1993, TLCA.

[33]  Henk Barendregt,et al.  The Lambda Calculus: Its Syntax and Semantics , 1985 .

[34]  Frank Pfenning,et al.  Higher-Order Logic Programming as Constraint Logic Programming , 1993, PPCP.

[35]  Nachum Dershowitz,et al.  Orderings for term-rewriting systems , 1979, 20th Annual Symposium on Foundations of Computer Science (sfcs 1979).

[36]  M. F.,et al.  Bibliography , 1985, Experimental Gerontology.

[37]  Amy P. Felty,et al.  The Coq proof assistant user's guide : version 5.6 , 1990 .

[38]  Helmut Schwichtenberg,et al.  Strict Functionals for Termination Proofs , 1995, TLCA.

[39]  Thérèse Hardin,et al.  Proof of termination of the rewriting system subst on CCL , 1986, Theor. Comput. Sci..

[40]  G. Huet,et al.  Equations and rewrite rules: a survey , 1980 .

[41]  Roberto Virga,et al.  Higher-Order Superposition for Dependent Types , 1996, RTA.

[42]  Per Martin-Löf,et al.  Constructive mathematics and computer programming , 1984 .

[43]  Gérard P. Huet,et al.  A Complete Proof of Correctness of the Knuth-Bendix Completion Algorithm , 1981, J. Comput. Syst. Sci..

[44]  Giuseppe Longo,et al.  Categories, types and structures - an introduction to category theory for the working computer scientist , 1991, Foundations of computing.

[45]  Pascal Van Hentenryck,et al.  The Constraint Logic Programming Language CHIP , 1988, FGCS.

[46]  Roberto Di Cosmo,et al.  On the Power of Simple Diagrams , 1996, RTA.

[47]  Tobias Nipkow,et al.  Higher-order critical pairs , 1991, [1991] Proceedings Sixth Annual IEEE Symposium on Logic in Computer Science.

[48]  Lawrence C. Paulson,et al.  Isabelle: The Next 700 Theorem Provers , 2000, ArXiv.

[49]  Frank Pfenning,et al.  Higher-order abstract syntax , 1988, PLDI '88.

[50]  Narciso Martí-Oliet,et al.  Rewriting Logic as a Logical and Semantic Framework , 1996 .

[51]  Christian Prehofer,et al.  Higher-order narrowing , 1994, Proceedings Ninth Annual IEEE Symposium on Logic in Computer Science.

[52]  David A. Wolfram,et al.  Rewriting, and Equational Unification: the Higher-Order Cases , 1991, RTA.

[53]  Dale Miller,et al.  A Theory of Modules for Logic Programming , 1986, SLP.

[54]  Robert Pieter Nederpelt Lazarom Strong normalization in a typed lambda calculus with lambda structured types , 1973 .

[55]  P. Martin-Löf On the meanings of the logical constants and the justi cations of the logical laws , 1996 .

[56]  Gerhard Gentzen,et al.  Investigations into Logical Deduction , 1970 .

[57]  P. Martin-Lof,et al.  Constructive mathematics and computer programming , 1984, Philosophical Transactions of the Royal Society of London. Series A, Mathematical and Physical Sciences.