Strongly Normalising Cyclic Data Computation by Iteration Categories of 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. Finally, 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.

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

[2]  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).

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[18]  Kazutaka Matsuda,et al.  The algebra of recursive graph transformation language UnCAL: complete axiomatisation and iteration categorical semantics , 2015, Mathematical Structures in Computer Science.

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

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

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

[22]  Dominic R. Verity,et al.  Traced monoidal categories , 1996, Mathematical Proceedings of the Cambridge Philosophical Society.

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

[24]  Masahito Hasegawa,et al.  Models of sharing graphs : a categorical semantics of let and letrec , 1999 .

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

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

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

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

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

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

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

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

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