skip to main content
research-article
Open Access

How to prove your calculus is decidable: practical applications of second-order algebraic theories and computation

Published:29 August 2017Publication History
Skip Abstract Section

Abstract

We present a general methodology of proving the decidability of equational theory of programming language concepts in the framework of second-order algebraic theories. We propose a Haskell-based analysis tool SOL, Second-Order Laboratory, which assists the proofs of confluence and strong normalisation of computation rules derived from second-order algebraic theories.

To cover various examples in programming language theory, we combine and extend both syntactical and semantical results of second-order computation in a non-trivial manner. We demonstrate how to prove decidability of various algebraic theories in the literature. It includes the equational theories of monad and lambda-calculi, Plotkin and Power's theory of states, and Stark's theory of pi-calculus.

References

  1. F. Baader and T. Nipkow. Term Rewriting and All That. Cambridge University Press, 1998. Google ScholarGoogle ScholarCross RefCross Ref
  2. L. Baxter. The complexity of unification. PhD thesis, Department of Computer Science, University of Waterloo, 1977.Google ScholarGoogle Scholar
  3. N. Benton and M. Hyland. Traced premonoidal categories. Theoretical Informatics and Applications, 37(4):273–299, 2003. Google ScholarGoogle ScholarCross RefCross Ref
  4. P. N. Benton, Gavin M. Bierman, and Valeria de Paiva. Computational types from a logical perspective. J. Funct. Program., 8 (2):177–193, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. R. Bird and O. D. Moor. Algebra of Programming. Prentice-Hall, 1996. Google ScholarGoogle ScholarCross RefCross Ref
  6. F. Blanqui. Termination and confluence of higher-order rewrite systems. In Rewriting Techniques and Application (RTA 2000), LNCS 1833, pages 47–61. Springer, 2000. Google ScholarGoogle ScholarCross RefCross Ref
  7. F. Blanqui. Termination of rewrite relations on λ-terms based on Girard’s notion of reducibility. Theor. Comput. Sci., 611: 50–86, 2016. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. M. M. T. Chakravarty, G. Keller, and S. L. Peyton Jones. Associated type synonyms. In Proceedings of the 10th ACM SIGPLAN International Conference on Functional Programming, ICFP 2005, Tallinn, Estonia, September 26-28, 2005, pages 241–253, 2005a. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. M. M. T. Chakravarty, G. Keller, S. L. Peyton Jones, and S. Marlow. Associated types with class. In Proceedings of the 32nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2005, Long Beach, California, USA, January 12-14, 2005, pages 1–13, 2005b. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. T. Coquand. Pattern matching with dependent types. In Proc. of the 3rd Work. on Types for Proofs and Programs, 1992.Google ScholarGoogle Scholar
  11. M. Fiore. Semantic analysis of normalisation by evaluation for typed lambda calculus. In Proc. of PPDP’02, pages 26–37. ACM Press, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. M. Fiore. Second-order and dependently-sorted abstract syntax. In Proc. of LICS’08, pages 57–68, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. M. Fiore and M. Hamana. Multiversal polymorphic algebraic theories: Syntax, semantics, translations, and equational logic. In Twenty-Eighth Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2013, pages 520–529, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. M. Fiore and C.-K. Hur. Second-order equational logic. In Proc. of CSL’10, LNCS 6247, pages 320–335, 2010.Google ScholarGoogle Scholar
  15. M. Fiore and O. Mahmoud. Second-order algebraic theories. In Proc. of MFCS’10, LNCS 6281, pages 368–380, 2010. Google ScholarGoogle ScholarCross RefCross Ref
  16. M. Fiore, G. Plotkin, and D. Turi. Abstract syntax and variable binding. In Proc. of LICS’99, pages 193–202, 1999. Google ScholarGoogle ScholarCross RefCross Ref
  17. M.P. Fiore, E. Moggi, and D. Sangiorgi. A fully-abstract model for the pi-calculus. In 11th Logic in Computer Science Conf. (LICS’96), pages 43–54. IEEE, 1996. Information and Computation 179, 76-117 (2002). Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. J. Gibbons and R. Hinze. Just do it: simple monadic equational reasoning. In Proceeding of the 16th ACM SIGPLAN international conference on Functional Programming, ICFP 2011, Tokyo, Japan, September 19-21, 2011, pages 2–14, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. J.-Y. Girard. Proofs and types. Cambridge University Press, 1989. translated and with appendices by Paul Taylor, Yves Lafont.Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. M. Hamana. Free Σ-monoids: A higher-order syntax with metavariables. In Asian Symposium on Programming Languages and Systems (APLAS’04), LNCS 3302, pages 348–363, 2004.Google ScholarGoogle ScholarCross RefCross Ref
  21. M. Hamana. Universal algebra for termination of higher-order rewriting. In Rewriting Techniques and Application (RTA’05), LNCS 3467, pages 135–149, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. M. Hamana. Higher-order semantic labelling for inductive datatype systems. In Proc. of 9th ACM-SIGPLAN Symposium on Principles and Practice of Declarative Programming (PPDP’07), pages 97–108. ACM Press, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. M. Hamana. Semantic labelling for proving termination of combinatory reduction systems. In Functional and (Constraint) Logic Programming (WFLP’09), LNCS 5979, pages 62–78, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. M. Hamana. Strongly normalising cyclic data computation by iteration categories of second-order algebraic theories. In Proc. of FSCD’16, volume 52 of the Leibniz International Proceedings in Informatics (LIPIcs), pages 21:1–21:18, 2016.Google ScholarGoogle Scholar
  25. M. Hasegawa. Classical linear logic of implications. Mathematical Structures in Computer Science, 15(2):323–342, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. G. Huet. Confluent reductions: Abstract properties and applications to term rewriting systems. Journal of ACM, 27(4): 797–821, 1980. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. G. P. Huet. A unification algorithm for typed lambda-calculus. Theor. Comput. Sci., 1(1):27–57, 1975. Google ScholarGoogle ScholarCross RefCross Ref
  28. J. Jouannaud, H. Kirchner, and J. Remy. Church-Rosser properties of weakly terminating term rewriting systems. In Proceedings of the 8th International Joint Conference on Artificial Intelligence, pages 909–915, 1983.Google ScholarGoogle Scholar
  29. D. Knuth and P. Bendix. Simple word problems in universal algebras. In Computational Problem in abstract algebra, pages 263–297. Pergamon Press, Oxford, 1970. included also in Automationof reasoning 2, Springer (1983), pp.342-376. Google ScholarGoogle ScholarCross RefCross Ref
  30. T. Libal and D. Miller. Functions-as-Constructors Higher-Order Unification. In Proc. of FSCD 2016, volume 52 of Leibniz International Proceedings in Informatics (LIPIcs), pages 26:1–26:17, 2016.Google ScholarGoogle Scholar
  31. S. Lindley and I. Stark. Reducibility and ⊤⊤-lifting for computation types. In Typed Lambda Calculi and Applications, 7th International Conference, TLCA 2005, Nara, Japan, April 21-23, 2005, Proceedings, pages 262–277, 2005.Google ScholarGoogle Scholar
  32. R. Mayr and T. Nipkow. Higher-order rewrite systems and their confluence. Theor. Comput. Sci., 192(1):3–29, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. P.-A. Melliès. Segal condition meets computational effects. In Proceedings of the 25th Annual IEEE Symposium on Logic in Computer Science, LICS 2010, 11-14 July 2010, Edinburgh, United Kingdom, pages 150–159, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. D. Miller. A logic programming language with lambda-abstraction, function variables, and simple unification. Journal of Logic and Computation, 1(4):497–536, 1991. Google ScholarGoogle ScholarCross RefCross Ref
  35. R. Milner. Semantic ideas in computing. In Computing tomorrow. Cambridge University Press, 1996. Google ScholarGoogle ScholarCross RefCross Ref
  36. R. Milner. Communicating and mobile systems - the π -calculus. CUP, 1999.Google ScholarGoogle Scholar
  37. E. Moggi. Computational lambda-calculus and monads. LFCS ECS-LFCS-88-66, University of Edinburgh, 1988.Google ScholarGoogle Scholar
  38. E. Moggi. Notions of computation and monads. Information and Computation, 93:55–92, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. T. Nipkow. Higher-order critical pairs. In Proc. 6th IEEE Symp. Logic in Computer Science, pages 342–349, 1991. Google ScholarGoogle ScholarCross RefCross Ref
  40. Y. Ohta and M. Hasegawa. A terminating and confluent linear lambda calculus. In Rewriting Techniques and Application (RTA’06), LNCS 1833, pages 166–180, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. S. L. Peyton Jones, A. Tolmach, and T. Hoare. Playing by the rules: rewriting as a practical optimisation technique in GHC. In Haskell Workshop 2001, 2001.Google ScholarGoogle Scholar
  42. F. Pfenning and C. Elliott. Higher-order abstract syntax. In Proceedings of the ACM SIGPLAN ’88 Symposium on Language Design and Implementation, pages 199–208, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. G. Plotkin and J. Power. Notions of computation determine monads. In Proc. of FoSSaCS’02, pages 342–356, 2002. Google ScholarGoogle ScholarCross RefCross Ref
  44. G. D. Plotkin. Call-by-name, call-by-value and the lambda-calculus. Theor. Comput. Sci., 1(2):125–159, 1975. Google ScholarGoogle ScholarCross RefCross Ref
  45. J. van de Pol. Termination proofs for higher-order rewrite systems. In the First International Workshop on Higher-Order Algebra, Logic and Term Rewriting (HOA’93), LNCS 816, pages 305–325, 1994.Google ScholarGoogle Scholar
  46. D. Prawitz. Ideas and results in proof theory. In Proceedings of the 2nd Scandinavian Logic Symposium, number 63 in Studies in Logics and the Foundations of Mathmatics, pages 235–307, 1971. Google ScholarGoogle ScholarCross RefCross Ref
  47. C. Prehofer. Solving Higher-Order Equations: From Logic to Programming. PhD thesis, Technische Univerität München, 1995.Google ScholarGoogle Scholar
  48. A. Sabry and P. Wadler. A reflection on call-by-value. ACM Trans. Program. Lang. Syst., 19(6):916–941, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. I. Stark. A fully abstract domain model for the π -calculus. In Proc. of the Eleventh Annual IEEE Symposium on Logic in Computer Science, pages 36–42, 1996. Google ScholarGoogle ScholarCross RefCross Ref
  50. I. Stark. Free-algebra models for the π -calculus. Theor. Comput. Sci., 390(2-3):248–270, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. S. Staton. Two cotensors in one: Presentations of algebraic theories for local state and fresh names. Electr. Notes Theor. Comput. Sci., 249:471–490, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. S. Staton. An algebraic presentation of predicate logic. In Proc. of FoSSaCS’13, LNCS 7794, pages 401–417, 2013a. Google ScholarGoogle ScholarDigital LibraryDigital Library
  53. S. Staton. Instances of computational effects: An algebraic perspective. In 28th Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2013, page 519, 2013b.Google ScholarGoogle ScholarCross RefCross Ref
  54. S. Staton. Algebraic effects, linearity, and quantum programming languages. In Proc. of POPL’15, pages 395–406, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  55. P. Wadler. Comprehending monads. In ACM Conference on Lisp and Functional Programming, pages 61–78, Nice, France, June 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  56. T. Yokoyama, Z. Hu, and M. Takeichi. Deterministic higher-order patterns for program transformation. In Logic Based Program Synthesis and Transformation, 13th International Symposium LOPSTR 2003, Uppsala, Sweden, August 25-27, 2003, Revised Selected Papers, pages 128–142, 2003.Google ScholarGoogle Scholar
  57. T. Yokoyama, Z. Hu, and M. Takeichi. Deterministic second-order patterns. Inf. Process. Lett., 89(6):309–314, 2004a. Google ScholarGoogle ScholarDigital LibraryDigital Library
  58. T. Yokoyama, Z. Hu, and M. Takeichi. Deterministic second-order patterns for program transformation. Computer Software, 21(5):71–76, 2004b. in Japanese.Google ScholarGoogle Scholar

Index Terms

  1. How to prove your calculus is decidable: practical applications of second-order algebraic theories and computation

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        • Published in

          cover image Proceedings of the ACM on Programming Languages
          Proceedings of the ACM on Programming Languages  Volume 1, Issue ICFP
          September 2017
          1173 pages
          EISSN:2475-1421
          DOI:10.1145/3136534
          Issue’s Table of Contents

          Copyright © 2017 ACM

          Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 29 August 2017
          Published in pacmpl Volume 1, Issue ICFP

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • research-article

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader