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: https://vimeo.com/365486403

[1]  Richard S. Bird,et al.  Algebra of programming , 1997, Prentice Hall International series in computer science.

[2]  Makoto Hamana,et al.  Polymorphic Rewrite Rules: Confluence, Type Inference, and Instance Validation , 2018, FLOPS.

[3]  Masato Takeichi,et al.  Deterministic second-order patterns , 2004, Inf. Process. Lett..

[4]  Marcelo P. Fiore,et al.  Second-Order Algebraic Theories - (Extended Abstract) , 2010, MFCS.

[5]  Sam Staton,et al.  Instances of Computational Effects: An Algebraic Perspective , 2013, 2013 28th Annual ACM/IEEE Symposium on Logic in Computer Science.

[6]  Yoshihito Toyama,et al.  A Reduction-Preserving Completion for Proving Confluence of Non-Terminating Term Rewriting Systems , 2012, Log. Methods Comput. Sci..

[7]  Marcelo P. Fiore,et al.  Semantic analysis of normalisation by evaluation for typed lambda calculus , 2002, PPDP '02.

[8]  Gérard P. Huet,et al.  Confluent Reductions: Abstract Properties and Applications to Term Rewriting Systems , 1980, J. ACM.

[9]  Jeremy Gibbons,et al.  An Initial-Algebra Approach to Directed Acyclic Graphs , 1995, MPC.

[10]  Frédéric Blanqui,et al.  Termination of rewrite relations on λ-terms based on Girard's notion of reducibility , 2015, Theor. Comput. Sci..

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

[12]  Masahito Hasegawa,et al.  A Terminating and Confluent Linear Lambda Calculus , 2006, RTA.

[13]  Masahito Hasegawa,et al.  Classical linear logic of implications , 2002, Mathematical Structures in Computer Science.

[14]  Ian Stark,et al.  Reducibility and TT-Lifting for Computation Types , 2005, TLCA.

[15]  Makoto Hamana Higher-order semantic labelling for inductive datatype systems , 2007, PPDP '07.

[16]  S. Maclane,et al.  Categories for the Working Mathematician , 1971 .

[17]  Narciso Martí-Oliet,et al.  All About Maude - A High-Performance Logical Framework, How to Specify, Program and Verify Systems in Rewriting Logic , 2007, All About Maude.

[18]  Lewis Denver Baxter The complexity of unification. , 1976 .

[19]  Nick Benton,et al.  Computational types from a logical perspective , 1998, Journal of Functional Programming.

[20]  Robin Milner,et al.  Principal type-schemes for functional programs , 1982, POPL '82.

[21]  Nick Benton,et al.  Traced Premonoidal Categories , 2003, RAIRO Theor. Informatics Appl..

[22]  Frédéric Blanqui,et al.  Termination and Confluence of Higher-Order Rewrite Systems , 2000, RTA.

[23]  J. Girard,et al.  Proofs and types , 1989 .

[24]  Gordon D. Plotkin,et al.  Abstract syntax and variable binding , 1999, Proceedings. 14th Symposium on Logic in Computer Science (Cat. No. PR00158).

[25]  Simon L. Peyton Jones,et al.  Associated type synonyms , 2005, ICFP '05.

[26]  Sam Staton,et al.  Algebraic Effects, Linearity, and Quantum Programming Languages , 2015, POPL.

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

[28]  Marcelo P. Fiore,et al.  Second-Order and Dependently-Sorted Abstract Syntax , 2008, 2008 23rd Annual IEEE Symposium on Logic in Computer Science.

[29]  Sam Lindley,et al.  Extensional Rewriting with Sums , 2007, TLCA.

[30]  Davide Sangiorgi,et al.  A Fully Abstract Model for the [pi]-calculus , 1996, Inf. Comput..

[31]  I. Stark,et al.  A fully abstract domain model for the /spl pi/-calculus , 1996, Proceedings 11th Annual IEEE Symposium on Logic in Computer Science.

[32]  Tobias Nipkow,et al.  Higher-Order Rewrite Systems and Their Confluence , 1998, Theor. Comput. Sci..

[33]  Masato Takeichi,et al.  Deterministic Higher-Order Patterns for Program Transformation , 2003, LOPSTR.

[34]  Dale Miller,et al.  Functions-as-Constructors Higher-Order Unification , 2016, FSCD.

[35]  Makoto Hamana Universal Algebra for Termination of Higher-Order Rewriting , 2005, RTA.

[36]  Gordon D. Plotkin,et al.  Notions of Computation Determine Monads , 2002, FoSSaCS.

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

[38]  Marcelo P. Fiore,et al.  The Algebra of Directed Acyclic Graphs , 2013, Computation, Logic, Games, and Quantum Foundations.

[39]  Chung-Kil Hur,et al.  Second-order equational logic , 2010, CSL 2010.

[40]  Makoto Hamana,et al.  Semantic Labelling for Proving Termination of Combinatory Reduction Systems , 2009, WFLP.

[41]  G. M. Kelly,et al.  On MacLane's conditions for coherence of natural associativities, commutativities, etc. , 1964 .

[42]  Jaco van de Pol,et al.  Termination Proofs for Higher-order Rewrite Systems , 1993, HOA.

[43]  Makoto Hamana Free S-Monoids: A Higher-Order Syntax with Metavariables , 2004, APLAS.

[44]  Eugenio Moggi,et al.  Notions of Computation and Monads , 1991, Inf. Comput..

[45]  Makoto Hamana Strongly Normalising Cyclic Data Computation by Iteration Categories of Second-Order Algebraic Theories , 2016, FSCD.

[46]  Philip Wadler,et al.  Comprehending monads , 1990, LISP and Functional Programming.

[47]  Simon L. Peyton Jones,et al.  Associated types with class , 2005, POPL '05.

[48]  Paul-André Melliès,et al.  Segal Condition Meets Computational Effects , 2010, 2010 25th Annual IEEE Symposium on Logic in Computer Science.

[49]  Sam Staton,et al.  An Algebraic Presentation of Predicate Logic - (Extended Abstract) , 2013, FoSSaCS.

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

[51]  Ralf Hinze,et al.  Just do it: simple monadic equational reasoning , 2011, ICFP.

[52]  Makoto Hamana,et al.  Multiversal Polymorphic Algebraic Theories: Syntax, Semantics, Translations, and Equational Logic , 2013, 2013 28th Annual ACM/IEEE Symposium on Logic in Computer Science.

[53]  Makoto Hamana,et al.  Polymorphic Abstract Syntax via Grothendieck Construction , 2011, FoSSaCS.

[54]  Tobias Nipkow,et al.  Term rewriting and all that , 1998 .

[55]  Simon Peyton Jones,et al.  Playing by the rules: rewriting as a practical optimisation technique in GHC , 2001 .

[56]  Razvan Diaconescu,et al.  Logical foundations of CafeOBJ , 2002, Theor. Comput. Sci..

[57]  Sam Staton,et al.  Two Cotensors in One: Presentations of Algebraic Theories for Local State and Fresh Names , 2009, MFPS.

[58]  S. Lane Natural Associativity and Commutativity , 1979 .

[59]  Robin Milner Semantic ideas in computing , 1997 .

[60]  D. Knuth,et al.  Simple Word Problems in Universal Algebras , 1983 .

[61]  Nicole Stender Template Metaprogramming for Haskell , 2014 .

[62]  Eugenio Moggi,et al.  Computational lambda-calculus and monads , 1989, [1989] Proceedings. Fourth Annual Symposium on Logic in Computer Science.

[63]  Makoto Hamana,et al.  How to prove your calculus is decidable: practical applications of second-order algebraic theories and computation , 2017, Proc. ACM Program. Lang..

[64]  Gordon D. Plotkin,et al.  Call-by-Name, Call-by-Value and the lambda-Calculus , 1975, Theor. Comput. Sci..