skip to main content
research-article
Open Access

Structural recursion for querying ordered graphs

Published:25 September 2013Publication History
Skip Abstract Section

Abstract

Structural recursion, in the form of, for example, folds on lists and catamorphisms on algebraic data structures including trees, plays an important role in functional programming, by providing a systematic way for constructing and manipulating functional programs. It is, however, a challenge to define structural recursions for graph data structures, the most ubiquitous sort of data in computing. This is because unlike lists and trees, graphs are essentially not inductive and cannot be formalized as an initial algebra in general. In this paper, we borrow from the database community the idea of structural recursion on how to restrict recursions on infinite unordered regular trees so that they preserve the finiteness property and become terminating, which are desirable properties for query languages. We propose a new graph transformation language called lambdaFG for transforming and querying ordered graphs, based on the well-defined bisimulation relation on ordered graphs with special epsilon-edges. The language lambdaFG is a higher order graph transformation language that extends the simply typed lambda calculus with graph constructors and more powerful structural recursions, which is extended for transformations on the sibling dimension. It not only gives a general framework for manipulating graphs and reasoning about them, but also provides a solution to the open problem of how to define a structural recursion on ordered graphs, with the help of the bisimilarity for ordered graphs with epsilon-edges.

References

  1. K. Asada, S. Hidaka, H. Kato, Z. Hu, and K. Nakano. Parameterized graph transformation languages with monads. Technical Report GRACE-TR-2012-07, GRACE Center, National Institute of Informatics, 2012. http://www.biglab.org/papers.html.Google ScholarGoogle Scholar
  2. K. Asada, S. Hidaka, H. Kato, Z. Hu, and K. Nakano. A parameterized graph transformation calculus for finite graphs with monadic branches, 2013. To appear in PPDP'13. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. R. Bird and O. de Moor. Algebras of Programming. Prentice Hall, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. V. Breazu-Tannen, P. Buneman, and S. Naqvi. Structural recursion as a query language. In Proc. of the Third International Workshop on Database Programming Languages(DBPL 91), pages 9--19, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. P. Buneman, M. F. Fernandez, and D. Suciu. UnQL: a query language and algebra for semistructured data based on structural recursion. VLDB Journal: Very Large Data Bases, 9 (1): 76--110, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. F. W. Burton and H.-K. Yang. Manipulating multilinked data structures in a pure functional language. Softw. Pract. Exper., 20: 1167--1185, November 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. S. Dal Zilio, D. Lugiez, and C. Meyssonnier. A logic you can count on. POPL'04, pages 135--146, New York, NY, USA, 2004. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. H. Ehrig, K. Ehrig, U. Prange, and G. Taentzer. Fundamentals of Algebraic Graph Transformation. Springer-Verlag, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. M. Erwig. Functional programming with graphs. ICFP '97, pages 52--65, New York, NY, USA, 1997. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. L. Fegaras and T. Sheard. Revisiting catamorphisms over datatypes with embedded functions. POPL '96, St. Petersburg Beach, Florida, Jan. 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. J. Gibbons. An initial-algebra approach to directed acyclic graphs. In Mathematics of Program Construction, MPC '95, pages 282--303, London, UK, 1995. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. A. Gill, J. Launchbury, and S. P. Jones. A short cut to deforestation. In Proc. Conference on Functional Programming Languages and Computer Architecture, pages 223--232, Copenhagen, June 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. S. Ginali. Regular trees and the free iterative theory. J. Comput. Syst. Sci., 18 (3): 228--242, 1979.Google ScholarGoogle ScholarCross RefCross Ref
  14. M. Hamana. Initial algebra semantics for cyclic sharing structures. TLCA '09, pages 127--141, Berlin, Heidelberg, 2009. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. M. Hasegawa. The uniformity principle on traced monoidal categories. Electr. Notes Theor. Comput. Sci., 69: 137--155, 2002.Google ScholarGoogle ScholarCross RefCross Ref
  16. S. Hidaka, Z. Hu, K. Inaba, H. Kato, K. Matsuda, and K. Nakano. Bidirectionalizing graph transformations. In ACM SIGPLAN International Conference on Functional Programming, pages 205--216. ACM, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. S. Hidaka, Z. Hu, K. Inaba, H. Kato, K. Matsuda, K. Nakano, and I. Sasano. Marker-directed Optimization of UnCAL Graph Transformations. In LOPSTR'11, volume 7225 of LNCS, pages 123--138. Springer, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Z. Hu, H. Iwasaki, M. Takeichi, and A. Takano. Tupling calculation eliminates multiple data traversals. ICFP'97, pages 164--175, Amsterdam, The Netherlands, June 1997. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Z. Hu, T. Yokoyama, and M. Takeichi. Program optimizations and transformations in calculational form. In Summer School on Generative and Transformational Techniques in Software Engineering, pages 139--164, Braga, Portugal, 2006. Springer, LNCS 4043. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. B. Jacobs. From coalgebraic to monoidal traces. Electronic Notes in Theoretical Computer Science, 264 (2): 125 -- 140, 2010. Proceedings of the Tenth Workshop on Coalgebraic Methods in Computer Science (CMCS 2010). Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. T. Johnsson. Efficient graph algorithms using lazy monolithic arrays. J. Funct. Program., 8: 323--333, July 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. vin(2006)}JoBe06F. Jouault and J. Bézivin. KM3: A DSL for metamodel specification. In Formal Methods for Open Object-Based Distributed Systems, pages 171--185. LNCS 4037, Springer, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. A. J. Kfoury and J. Tiuryn. Type reconstruction in finite-rank fragments of the polymorphic lambda-calculus (extended summary). In LICS, pages 2--11, 1990.Google ScholarGoogle Scholar
  24. D. J. King and J. Launchbury. Structuring depth-first search algorithms in Haskell. POPL '95, pages 344--354, New York, 1995. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. S. Lombardy and J. Sakarovitch. The removal of weighted $\varepsilon$-transitions. CIAA'12, pages 345--352. Springer-Verlag, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. E. Meijer, M. Fokkinga, and R. Paterson. Functional programming with bananas, lenses, envelopes and barbed wire. In Proc. Conference on Functional Programming Languages and Computer Architecturerm (LNCS 523), pages 124--144, Cambridge, Massachuetts, Aug. 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. J. C. Mitchell. Foundations for programming languages. Foundation of computing series. MIT Press, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. B. C. Oliveira and W. R. Cook. Functional programming with structured graphs. ICFP '12, pages 77--88, New York, 2012. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. C. Picard and R. Matthes. Permutations in Coinductive Graph Representation. In D. Pattinson and L. Schröder, editors, Coalgebraic Methods in Computer Science, volume 7399 of LNCS, pages 218--237. Springer, 2012.Google ScholarGoogle ScholarCross RefCross Ref
  30. E. L. Robertson, L. V. Saxton, D. V. Gucht, and S. Vansummeren. Structural recursion as a query language on lists and ordered trees. Theory of Computing Systems, 44 (4): 590--619, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. A. Takano and E. Meijer. Shortcut deforestation in calculational form. FPCA '95, pages 306--313, New York, 1995. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. L. Wong. Querying Nested Collections. PhD thesis, Philadelphia, PA, USA, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Structural recursion for querying ordered graphs

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      • Published in

        cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 48, Issue 9
        ICFP '13
        September 2013
        457 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/2544174
        Issue’s Table of Contents
        • cover image ACM Conferences
          ICFP '13: Proceedings of the 18th ACM SIGPLAN international conference on Functional programming
          September 2013
          484 pages
          ISBN:9781450323260
          DOI:10.1145/2500365

        Copyright © 2013 Owner/Author

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 25 September 2013

        Check for updates

        Qualifiers

        • research-article

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!