Academia.eduAcademia.edu

Outline

A New Higher-order Unification Algorithm for λKanren

2021

https://doi.org/10.1145/NNNNNNN.NNNNNNN

Abstract

Is there a world where true is equal to false? Indeed, there is, if higher-order unification [13] and miniKanren [9] meet each other. Even if all components are already well-established, it may still end up with unnatural or even absurd results, if we combine them naively. This paper unveils the difficulties in handling binders with standard higher-order unification. To solve these problems, we propose a new unification formulation. Higher-order unification [13] solves equations among λ-terms modulo αβη-equivalence [3]. Miller [19] finds a decidable fragment of higher-order unification problems by restricting the application forms of the input terms. For an application form F a, if F is a unification variable, then a must be a list of zero or more distinct bound variables. Such restricted application forms are called patterns and we hereafter refer to the problem identified by Miller as pattern unification. Pattern unification then becomes the core of λProlog [20]. λProlog implement...

References (36)

  1. Andreas Abel and Brigitte Pientka. 2011. Higher-order Dynamic Pattern Unification for Dependent Types and Records. In Proceedings of the 10th International Conference on Typed Lambda Calculi and Applications (TLCA'11). Springer- Verlag, Berlin, Heidelberg, 10-26.
  2. Krzysztof R. Apt and M. H. van Emden. 1982. Contributions to the Theory of Logic Programming. Journal of the ACM (JACM) 29, 3 (July 1982), 841-862.
  3. H. P. Barendregt. 1981. The Lambda Calculus: Its Syntax and Semantics. North-Holland PubCo, Sole distributors for the USAand Canada Elsevier North-Holland.
  4. William E. Byrd and Daniel P. Friedman. 2007. 𝛼Kanren: A Fresh Name In Nominal Logic Programming. Université Laval Technical Report DIUL-RT-0701, Scheme Workshop '07, editor Danny Dubé (2007), 79 -90.
  5. Christophe Calvès. 2010. Complexity and Implementation of Nominal Algorithms. King's College of London.
  6. James Cheney. 2005. Relating Nominal and Higher-order Pattern Unification. In Proceedings of UNIF 2005. 104-119.
  7. Nicolaas G. de Bruijn. 1972. Lambda Calculus Notation with Nameless Dummies, a Tool for Automatic Formula Manipulation, with Application to the Church-Rosser Theorem. Indagationes Mathematicae (Proceedings) 75, 5 (Jan. 1972), 381-392.
  8. Conal Elliott. 1989. Higher-order unification with dependent types. Rewriting Techniques and Applications 355 (Jan. 1989).
  9. Daniel P. Friedman, William E. Byrd, Oleg Kiselyov, and Jason Hemann. 2018. The Reasoned Schemer, Second Edition.
  10. Thérèse Hardin, Gilles Dowek, Claude Kirchner, and Frank Pfenning. 1999. Unification via Explicit Substitutions: The Case of Higher-Order Patterns. (Jan. 1999).
  11. Jason Hemann and Daniel P. Friedman. 2013. 𝜇Kanren: A Minimal Core for Relational Programming. In Proceedings of the 2013 Workshop on Scheme and Functional Programming (Scheme'13), Vol. 6.
  12. Gerard P. Huet. 1973. The undecidability of unification in third order logic. Information and Control 22, 3 (April 1973), 257-267. https://doi.org/10.1016/S0019-9958(73)90301-X
  13. Gérard P.P. Huet. 2002. Higher Order Unification 30 Years Later. In Proceedings of the 15th International Conference on Theorem Proving in Higher Order Logics (TPHOLs '02). Springer-Verlag, London, UK, UK, 3-12.
  14. Jordi Levy and Mateu Villaret. 2008. Nominal Unification from a Higher-Order Perspective. In Rewriting Techniques and Applications (Lecture Notes in Computer Science), Andrei Voronkov (Ed.). Springer Berlin Heidelberg, 246-260.
  15. Jordi Levy and Mateu Villaret. 2010. An Efficient Nominal Unification Algorithm. In Proceedings of the 21st Interna- tional Conference on Rewriting Techniques and Applications (RTA '10). Edinburgh, Scottland, UK, 209-226.
  16. L Lucchesi. 1972. The undecidability of the unification problem for third order languages. https://www.semanticscholar.org/paper/The-undecidability-of-the-unification-problem-for-Lucchesi/ 218e43e101803d96031f56360e450fcb349b500b
  17. Weixi Ma, Kuang-chen Lu, and Daniel P. Friedman. 2020. Higher-order Logic Programming with 𝜆Kanren. In miniKan- ren 2020.
  18. Alberto Martelli and Ugo Montanari. 1982. An Efficient Unification Algorithm. ACM Trans. Program. Lang. Syst. 4, 2 (April 1982), 258-282.
  19. Dale Miller. 1991. A Logic Programming Language with Lambda-abstraction, Function Variables, and Simple Unifica- tion. Journal of Logic and Computation 1, 4 (Sept. 1991), 497-536.
  20. Dale Miller and Gopalan Nadathur. 2012. Programming with Higher-Order Logic. Cambridge University Press, Cam- bridge.
  21. Dale Miller, Gopalan Nadathur, and Andre Scedrov. 1987. Hereditary Harrop Formulas and Uniform Proof Systems. (Jan. 1987), 98-105.
  22. Joseph P. Near, William E. Byrd, and Daniel P. Friedman. 2008. 𝛼leanTAP: A Declarative Theorem Prover for First- order Classical Logic. In Logic Programming (LNCS 5366). Springer, Berlin, Heidelberg, 238-252.
  23. Tobias Nipkow. 1993. Functional Unification of Higher-Order Patterns. Proc. 8th IEEE Symp. Logic in Computer Science (1993). , Vol. 1, No. 1, Article . Publication date: August 2021.
  24. Tobias Nipkow, Lawrence C. Paulson, and Markus Wenzel. 2002. Isabelle/HOL: A Proof Assistant for Higher-Order Logic. Springer-Verlag, Berlin Heidelberg.
  25. T. Nipkow and Christian Prehofer. 1998. Higher-order rewriting and equational reasoning. Automated Deduction -A Basis for Applications 1 (Jan. 1998).
  26. Ulf Norell. 2007. Towards A Practical Programming Language Based on Dependent Type Theory. Chalmers University of Technology.
  27. M. S. Paterson and M. N. Wegman. 1978. Linear Unification. J. Comput. System Sci. 16, 2 (April 1978), 158-167.
  28. Lawrence C. Paulson. 1986. Natural deduction as higher-order resolution. The Journal of Logic Programming 3, 3 (Oct. 1986), 237-258.
  29. Frank Pfenning. 1989. Elf: a language for logic definition and verified metaprogramming. In [1989] Proceedings. Fourth Annual Symposium on Logic in Computer Science. 313-322. ISSN: null.
  30. Frank Pfenning and Carsten Schürmann. 1999. System Description: Twelf -A Meta-Logical Framework for Deductive Systems. In CADE-16 (LNCS 1632). Springer, Berlin, Heidelberg, 202-206.
  31. Brigitte Pientka and Joshua Dunfield. 2010. Beluga: A Framework for Programming and Reasoning with Deductive Systems (System Description). In Automated Reasoning (Lecture Notes in Computer Science), Jürgen Giesl and Reiner Hähnle (Eds.). Springer, Berlin, Heidelberg, 15-21.
  32. Zhenyu Qian. 1993. Linear Unification of Higher-Order Patterns. In TAPSOFT'93: Theory and Practice of Software Development (Lecture Notes in Computer Science), M. C. Gaudel and J. P. Jouannaud (Eds.). Springer Berlin Heidelberg, 391-405.
  33. ANTONIS STAMPOULIS. 2021. Makam. http://astampoulis.github.io/makam/
  34. Antonis Stampoulis and Adam Chlipala. 2018. Prototyping a functional language using higher-order logic program- ming: a functional pearl on learning the ways of λProlog/Makam. Proceedings of the ACM on Programming Languages 2, ICFP (July 2018), 93:1-93:30. https://doi.org/10.1145/3236788
  35. Teyjus team. 2021. Teyjus. http://teyjus.cs.umn.edu/
  36. Christian Urban, Andrew M. Pitts, and Murdoch J. Gabbay. 2004. Nominal Unification. Theoretical Computer Science 323, 1-3 (Sept. 2004), 473-497.