Initial Algebra Semantics for Cyclic Sharing Structures

Terms are a concise representation of tree structures. Since they can be naturally defined by an inductive type, they offer data structures in functional programming and mechanised reasoning with useful principles such as structural induction and structural recursion. In the case of graphs or "tree-like" structures --- trees involving cycles and sharing --- however, it is not clear what kind of inductive structures exists and how we can faithfully assign a term representation of them. In this paper we propose a simple term syntax for cyclic sharing structures that admits structural induction and recursion principles. We show that the obtained syntax is directly usable in the functional language Haskell, as well as ordinary data structures such as lists and trees. To achieve this goal, we use categorical approach to initial algebra semantics in a presheaf category. That approach follows the line of Fiore, Plotkin and Turi's models of abstract syntax with variable binding.

[1]  A. J. Nijman,et al.  PARLE Parallel Architectures and Languages Europe , 1987, Lecture Notes in Computer Science.

[2]  Conor McBride Faking it: Simulating dependent types in Haskell , 2002, J. Funct. Program..

[3]  Mark N. Wegman,et al.  Efficiently computing static single assignment form and the control dependence graph , 1991, TOPL.

[4]  Tarmo Uustalu,et al.  Explicit substitutions and higher-order syntax , 2003, MERLIN '03.

[5]  Robert E. Tarjan,et al.  Depth-First Search and Linear Graph Algorithms , 1972, SIAM J. Comput..

[6]  U. Norell,et al.  Towards a practical programming language based on dependent type theory , 2007 .

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

[8]  James Brotherston,et al.  Cyclic Proofs for First-Order Logic with Inductive Definitions , 2005, TABLEAUX.

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

[10]  Wouter Swierstra,et al.  The power of Pi , 2008, ICFP 2008.

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

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

[13]  Robin Milner,et al.  On Observing Nondeterminism and Concurrency , 1980, ICALP.

[14]  Brian Campbell,et al.  Amortised Memory Analysis Using the Depth of Data Structures , 2009, ESOP.

[15]  Makoto Hamana,et al.  Explicit substitutions and higher-order syntax , 2006, High. Order Symb. Comput..

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

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

[18]  Bruno Courcelle,et al.  Algorithmes d'equivalence et de reduction a des expressions minimales dans une classe d'equations recursives simples , 1974, ICALP.

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

[20]  Patricia Johann,et al.  Initial Algebra Semantics Is Enough! , 2007, TLCA.

[21]  Bart Jacobs,et al.  Structural Induction and Coinduction in a Fibrational Setting , 1998, Inf. Comput..

[22]  Peter Aczel,et al.  Infinite trees and completely iterative theories: a coalgebraic view , 2003, Theor. Comput. Sci..

[23]  Marino Miculan,et al.  A framework for typed HOAS and semantics , 2003, PPDP '03.

[24]  Ryu Hasegawa,et al.  Two applications of analytic functors , 2002, Theor. Comput. Sci..

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

[26]  Edmund Robinson Variations on Algebra: Monadicity and Generalisations of Equational Therories , 2002, Formal Aspects of Computing.

[27]  Peter Dybjer,et al.  Inductive families , 2005, Formal Aspects of Computing.

[28]  Patricia Johann,et al.  Foundations for structured programming with GADTs , 2008, POPL '08.

[29]  Roy Dyckhoff Automated Reasoning with Analytic Tableaux and Related Methods , 2000, Lecture Notes in Computer Science.

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

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

[32]  Marko C. J. D. van Eekelen,et al.  Term Graph Rewriting , 1987, PARLE.

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

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

[35]  Simon L. Peyton Jones,et al.  Simple unification-based type inference for GADTs , 2006, ICFP '06.