Cyclic Datatypes modulo Bisimulation based on Second-Order Algebraic Theories

Cyclic data structures, such as cyclic lists, in functional programming are tricky to handle because of their cyclicity. This paper presents an investigation of categorical, algebraic, and computational foundations of cyclic datatypes. Our framework of cyclic datatypes is based on second-order algebraic theories of Fiore et al., which give a uniform setting for syntax, types, and computation rules for describing and reasoning about cyclic datatypes. We extract the "fold" computation rules from the categorical semantics based on iteration categories of Bloom and Esik. Thereby, the rules are correct by construction. We prove strong normalisation using the General Schema criterion for second-order computation rules. Rather than the fixed point law, we particularly choose Bekic law for computation, which is a key to obtaining strong normalisation. We also prove the property of "Church-Rosser modulo bisimulation" for the computation rules. Combining these results, we have a remarkable decidability result of the equational theory of cyclic data and fold.

[1]  Z. Ésik,et al.  Iteration Theories: The Equational Logic of Iterative Processes , 1993 .

[2]  Dan Suciu,et al.  UnQL: a query language and algebra for semistructured data based on structural recursion , 2000, The VLDB Journal.

[3]  Maarten M. Fokkinga,et al.  Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire , 1991, FPCA.

[4]  Kazutaka Matsuda,et al.  Bidirectionalizing graph transformations , 2010, ICFP '10.

[5]  Zena M. Ariola,et al.  Equational Term Graph Rewriting , 1996, Fundam. Informaticae.

[6]  真人 長谷川 Models of sharing graphs : a categorical semantics of let and letrec , 1999 .

[7]  Bruno C. d. S. Oliveira,et al.  Functional programming with structured graphs , 2012, ICFP.

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

[9]  Makoto Hamana,et al.  Initial Algebra Semantics for Cyclic Sharing Structures , 2009, TLCA.

[10]  Bruno Courcelle,et al.  Fundamental Properties of Infinite Trees , 1983, Theor. Comput. Sci..

[11]  Robin Milner,et al.  A Complete Inference System for a Class of Regular Behaviours , 1984, J. Comput. Syst. Sci..

[12]  Jan Willem Klop,et al.  Combinatory reduction systems , 1980 .

[13]  Stefan Blom,et al.  Cyclic Lambda Calculi , 1997, TACS.

[14]  Zoltán Ésik Axiomatizing Iteration Categories , 1999, Acta Cybern..

[15]  Gordon D. Plotkin,et al.  Complete axioms for categorical fixed-point operators , 2000, Proceedings Fifteenth Annual IEEE Symposium on Logic in Computer Science (Cat. No.99CB36332).

[16]  Amy P. Felty,et al.  Higher-Order Abstract Syntax in Coq , 1995, TLCA.

[17]  Makoto Hamana Correct Looping Arrows from Cyclic Terms - Traced Categorical Interpretation in Haskell , 2012, FLOPS.

[18]  Neil Ghani,et al.  Representing Cyclic Structures as Nested Datatypes , 2006 .

[19]  Ola Mahmoud,et al.  Second-order algebraic theories , 2011 .

[20]  Zoltán Ésik Axiomatizing the Least Fixed Point Operation and Binary Supremum , 2000, CSL.

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

[22]  Janusz A. Brzozowski,et al.  Derivatives of Regular Expressions , 1964, JACM.

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

[24]  Atsushi Ohori,et al.  Parallel functional programming on recursively defined data via data-parallel recursion , 1999, Journal of Functional Programming.

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

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

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

[28]  Thierry Coquand,et al.  Pattern Matching with Dependent Types , 1992 .

[29]  Kazutaka Matsuda,et al.  Graph Transformation as Graph Reduction FUnCAL: A Functional Reformulation of Graph-Transformation Language UnCAL , 2015 .

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

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

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

[33]  Ross Street,et al.  Traced monoidal categories , 1996 .

[34]  Agostino Dovier,et al.  An efficient algorithm for computing bisimulation equivalence , 2004, Theor. Comput. Sci..

[35]  Makoto Hamana,et al.  Iteration Algebras for UnQL Graphs and Completeness for Bisimulation , 2015, FICS.

[36]  Samson Abramsky,et al.  Domain theory , 1995, LICS 1995.

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

[38]  Jean-Pierre Jouannaud,et al.  Inductive-data-type systems , 2002, Theor. Comput. Sci..

[39]  Adam Chlipala Parametric higher-order abstract syntax for mechanized semantics , 2008, ICFP 2008.

[40]  Makoto Hamana,et al.  Initial Algebra Semantics for Cyclic Sharing Tree Structures , 2010, Log. Methods Comput. Sci..

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

[42]  Tim Sheard,et al.  Revisiting catamorphisms over datatypes with embedded functions (or, programs from outer space) , 1996, POPL '96.

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

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

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

[46]  Susumu Nishimura A strict functional language with cyclic recursive data , 2005, Formal Aspects of Computing.

[47]  Gordon D. Plotkin,et al.  The category-theoretic solution of recursive domain equations , 1977, 18th Annual Symposium on Foundations of Computer Science (sfcs 1977).

[48]  Philippa Gardner,et al.  Context logic and tree update , 2005, POPL '05.

[49]  G. Winskel The formal semantics of programming languages , 1993 .

[50]  Sam Staton,et al.  Substitution, jumps, and algebraic effects , 2014, CSL-LICS.

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