Skip to main content Accessibility help

How to prove decidability of equational theories with second-order computation analyser SOL



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, i.e. 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 the 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 λ-calculi, Plotkin and Power’s theory of states and bits, and Stark’s theory of π-calculus. We also demonstrate how this methodology can solve the coherence of monoidal categories.

A video abstract can be found at:



Hide All
Aoto, T. & Toyama, Y. (2012) A reduction-preserving completion for proving confluence of non-terminating term rewriting systems. Logic. Method. Comput. Sci. 8(1), 129.
Baader, F. & Nipkow, T. (1998) Term Rewriting and All that. Cambridge University Press.
Baxter, L. (1977) The Complexity of Unification. PhD Thesis, Department of Computer Science, University of Waterloo.
Benton, N. & Hyland, M. (2003) Traced premonoidal categories. Theor. Inform. Appl. 37(4), 273299.
Benton, P. N., Bierman, G. M. & de Paiva, V. (1998) Computational types from a logical perspective. J. Funct. Program. 8(2), 177193.
Bird, R. & Moor, O. D. (1996) Algebra of Programming. Prentice-Hall.
Blanqui, F. (2000) Termination and confluence of higher-order rewrite systems. In Rewriting Techniques and Application (RTA 2000). LNCS, vol. 1833. Springer, pp. 4761.
Blanqui, F. (2016) Termination of rewrite relations on λ-terms based on Girard’s notion of reducibility. Theor. Comput. Sci. 611, 5086.
Chakravarty, M. M. T., Keller, G. & Peyton Jones, S. L. (2005a) Associated type synonyms. In Proceedings of the 10th ACM SIGPLAN International Conference on Functional Programming, ICFP 2005, Tallinn, Estonia, September 26–28, 2005, pp. 241–253.
Chakravarty, M. M. T., Keller, G., Peyton Jones, S. L. & Marlow, S. (2005b) Associated types with class. In Proceedings of POPL’05, Long Beach, California, USA, January 12–14, 2005, pp. 1–13.
Clavel, M., Durán, F., Eker, S., Lincoln, P., Martí-Oliet, N., Meseguer, J. & Talcott, C. L. (2007) All About Maude - A High-Performance Logical Framework, How to Specify, program and Verify Systems in Rewriting Logic. LNCS, vol. 4350. Springer.
Coquand, T. (1992) Pattern matching with dependent types. In Proceedings of the 3rd Workshop on Types for Proofs and Programs.
Damas, L. & Milner, R. (1982) Principal type-schemes for functional programs. In Proceedings of POPL’82, pp. 207–212.
Diaconescu, R. & Futatsugi, K. (2002) Logical foundations of CafeOBJ. Theor. Comput. Sci. 285(2), 289318.
Fiore, M. (2002) Semantic analysis of normalisation by evaluation for typed lambda calculus. In Proceedings of PPDP’02. ACM, pp. 26–37.
Fiore, M. (2008) Second-order and dependently sorted abstract syntax. In Proceedings of LICS’08, pp. 57–68.
Fiore, M. & Hamana, M. (2013) Multiversal polymorphic algebraic theories: syntax, semantics, translations, and equational logic. In 28th Annual ACM/IEEE Symposium on Logic in Computer Science, LICS, 2013, pp. 520–529.
Fiore, M. & Hur, C.-K. (2010) Second-order equational logic. In Proceedings of CSL’10. LNCS, vol. 6247, pp. 320–335.
Fiore, M. & Mahmoud, O. (2010) Second-order algebraic theories. In Proceedings of MFCS’10. LNCS, vol. 6281, pp. 368–380.
Fiore, M., Plotkin, G. & Turi, D. (1999) Abstract syntax and variable binding. In Proceedings of LICS’99, pp. 193–202.
Fiore, M. P. & Campos, M. D. (2013) The algebra of directed acyclic graphs. In Coecke, B., Ong, L., & Panangaden, P. (eds), Computation, Logic, Games, and Quantum Foundations. LNCS, vol. 7860, pp. 3751.
Fiore, M. P., Moggi, E. & Sangiorgi, D. (1996) A fully-abstract model for the pi-calculus. In 11th Logic in Computer Science Conference (LICS’96). IEEE, pp. 43–54. Information and Computation 179, 76117 (2002).
Gibbons, J. (1995) An initial-algebra approach to directed acyclic graphs. In Proceedings of MPC’95. LNCS, vol. 947, pp. 282–303.
Gibbons, J. & Hinze, R. (2011) 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, pp. 2–14.
Girard, J.-Y. (1989) Proofs and Types. Cambridge University Press. translated and with appendices by Paul Taylor, Yves Lafont.
Goguen, J., Winkler, T., Meseguer, J. & Futatsugi, K. (2000) Introducing OBJ. In Goguen, J. & Malcolm, G. (eds), Software Engineering with OBJ. ADFM, vol. 2, pp. 3–167.
Hamana, M. (2004) Free Σ-monoids: a higher-order syntax with metavariables. In Asian Symposium on Programming Languages and Systems (APLAS’04). LNCS, vol. 3302, pp. 348–363.
Hamana, M. (2005) Universal algebra for termination of higher-order rewriting. In Rewriting Techniques and Application (RTA’05). LNCS, vol. 3467, pp. 135–149.
Hamana, M. (2007) Higher-order semantic labelling for inductive datatype systems. In Proceedings of 9th ACM-SIGPLAN Symposium on Principles and Practice of Declarative Programming (PPDP’07). ACM, pp. 97–108.
Hamana, M. (2010) Semantic labelling for proving termination of combinatory reduction systems. In Proceedings of WFLP’09. LNCS, vol. 5979, pp. 62–78.
Hamana, M. (2011) Polymorphic abstract syntax via Grothendieck construction. In FoSSaCS’11. LNCS, vol. 3467, pp. 381–395.
Hamana, M. (2016) Strongly normalising cyclic data computation by iteration categories of second-order algebraic theories. In Proceedings of FSCD’16. The Leibniz International Proceedings in Informatics (LIPIcs), vol. 52, 21:1–21:18.
Hamana, M. (2017) How to prove your calculus is decidable: practical applications of second-order algebraic theories and computation. Proc. ACM Program. Lang. 1(22), 128.
Hamana, M. (2018) Polymorphic rewrite rules: confluence, type inference, and instance validation. In Proceedings of 14th International Symposium on Functional and Logic Programming (FLOPS’18). LNCS, vol. 10818, 99–115.
Hasegawa, M. (2005) Classical linear logic of implications. Math. Struct. Comput. Sci. 15(2), 323342.
Huet, G. (1980) Confluent reductions: abstract properties and applications to term rewriting systems. J. ACM 27(4), 797821.
Jouannaud, J., Kirchner, H. & Remy, J. (1983) Church–Rosser properties of weakly terminating term rewriting systems. In Proceedings of the 8th International Joint Conference on Artificial Intelligence, pp. 909–915.
Kelly, G. M. (1964) On mac lane’s conditions for coherence of natural associativities, commutativities, etc. J. Alg. 1(4), 397402.
Knuth, D. & Bendix, P. (1970) Simple word problems in universal algebras. In Computational Problem in Abstract Algebra. Oxford: Pergamon, pp. 263297. Included also in Automation of reasoning 2, Springer (1983), pp. 342–376.
Libal, T. & Miller, D. (2016) Functions-as-constructors higher-order unification. In Proceedings of FSCD 2016. Leibniz International Proceedings in Informatics (LIPIcs), vol. 52, pp. 26:1–26:17.
Lindley, S. (2007) Extensional rewriting with sums. In Typed Lambda Calculi and Applications, 8th International Conference, TLCA 2007, Paris, France, June 26–28, 2007. Proceedings, pp. 255–271.
Lindley, S. & Stark, I. (2005) Reducibility and ⊤⊤-lifting for computation types. In Typed Lambda Calculi and Applications, 7th International Conference, TLCA 2005, Nara, Japan, April 21–23, 2005. Proceedings, pp. 262–277.
Mac Lane, S. (1963) Natural associativity and commutativity. Rice Univ. Stud. 49(4), 2846. Available at:
Mac Lane, S. (1971) Categories for the Working Mathematician. Graduate Texts in Mathematics, vol. 5. Springer-Verlag.
Mayr, R. & Nipkow, T. (1998) Higher-order rewrite systems and their confluence. Theor. Comput. Sci. 192(1), 329.
Melliès, P.-A. (2010) 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, UK, 150–159.
Miller, D. (1991) A logic programming language with lambda-abstraction, function variables, and simple unification. J. Logic Comput. 1(4), 497536.
Milner, R. (1996) Semantic ideas in computing. In Wand, I. and Milner, R. (eds), Computing Tomorrow. Cambridge University Press.
Milner, R. (1999) Communicating and Mobile Systems - The π-Calculus. Cambridge University Press.
Moggi, E. (1988) Computational Lambda-Calculus and Monads. LFCS ECS-LFCS-88-66. University of Edinburgh.
Moggi, E. (1991) Notions of computation and monads. Inform. Comput. 93, 5592.
Nipkow, T. (1991) Higher-order critical pairs. In Proceedings of 6th IEEE Symposium on Logic in Computer Science, pp. 342–349.
Ohta, Y. & Hasegawa, M. (2006) A terminating and confluent linear lambda calculus. In Rewriting Techniques and Application (RTA’06). LNCS, vol. 1833, pp. 166–180.
Peyton Jones, S. L., Tolmach, A. & Hoare, T. (2001) Playing by the rules: rewriting as a practical optimisation technique in GHC. In Haskell Workshop 2001.
Pfenning, F. & Elliott, C. (1988) Higher-order abstract syntax. In Proceedings of the ACM SIGPLAN’88 Symposium on Language Design and Implementation, pp. 199–208.
Plotkin, G. & Power, J. (2002) Notions of computation determine monads. In Proceedings of FoSSaCS’02, pp. 342–356.
Plotkin, G. D. (1975) Call-by-name, call-by-value and the lambda-calculus. Theor. Comput. Sci. 1(2), 125159.
Prehofer, C. (1995) Solving Higher-Order Equations From Logic to Programming. PhD Thesis, Technische Univerität München.
Sabry, A. & Wadler, P. (1997) A reflection on call-by-value. ACM Trans. Program. Lang. Syst. 19(6), 916941.
Sheard, T. & Jones, S. P. (2002) Template metaprogramming for Haskell. In Proceedings of the Haskell Workshop 2002.
Stark, I. (1996) A fully abstract domain model for the π-calculus. In Proceedings of the Eleventh Annual IEEE Symposium on Logic in Computer Science, pp. 36–42.
Stark, I. (2008) Free-algebra models for the π-calculus. Theor. Comput. Sci. 390(2–3), 248270.
Staton, S. (2009) Two cotensors in one: presentations of algebraic theories for local state and fresh names. Electr. Notes Theor. Comput. Sci. 249, 471490.
Staton, S. (2013a) An algebraic presentation of predicate logic. In Proceedings of FoSSaCS’13. LNCS, vol. 7794, pp. 401–417.
Staton, S. (2013b) Instances of computational effects: an algebraic perspective. In 28th Annual ACM/IEEE Symposium on Logic in Computer Science. LICS, vol. 2013, p. 519.
Staton, S. (2015) Algebraic effects, linearity, and quantum programming languages. In Proceedings of POPL’15, pp. 395406.
van de Pol, J. (1994) Termination proofs for higher-order rewrite systems. In the First International Workshop on Higher-Order Algebra, Logic and Term Rewriting (HOA’93). LNCS, vol. 816, pp. 305–325.
Wadler, P. 1990 (June) Comprehending monads. In ACM Conference on Lisp and Functional Programming, pp. 6178.
Yokoyama, T., Hu, Z. & Takeichi, M. (2003) 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, 128–142.
Yokoyama, T., Hu, Z. & Takeichi, M. (2004a) Deterministic second-order patterns. Inf. Process. Lett. 89(6), 309314.
Yokoyama, T., Hu, Z. & Takeichi, M. (2004b) Deterministic second-order patterns for program transformation. Comput. Soft. 21(5), 7176. In Japanese.

How to prove decidability of equational theories with second-order computation analyser SOL



Altmetric attention score

Full text views

Total number of HTML views: 0
Total number of PDF views: 0 *
Loading metrics...

Abstract views

Total abstract views: 0 *
Loading metrics...

* Views captured on Cambridge Core between <date>. This data will be updated every 24 hours.

Usage data cannot currently be displayed

How to prove decidability of equational theories with second-order computation analyser SOL

Submit a response


No Discussions have been published for this article.


Reply to: Submit a response

Your details

Conflicting interests

Do you have any conflicting interests? *