Skip to main content

Computing with Catalan Families, Generically

  • Conference paper
  • First Online:
Practical Aspects of Declarative Languages (PADL 2016)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 9585))

Included in the following conference series:

  • 1369 Accesses

Abstract

We describe arithmetic algorithms on a canonical number representation based on the Catalan family of combinatorial objects specified as a Haskell type class.

Our algorithms work on a generic representation that we illustrate on instances members of the Catalan family, like ordered binary and multiway trees. We validate the correctness of our algorithms by defining an instance of the same type class based the usual bitstring-based natural numbers.

While their average and worst case complexity is within constant factors of their traditional counterparts, our algorithms provide super-exponential gains for numbers corresponding to Catalan objects of low representation size.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 34.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 44.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    In fact, one can see the functions e, e_ , c, c’, c_ as a generic API abstracting away the essential properties of the constructors E and C.

References

  1. Goodstein, R.: On the restricted ordinal theorem. J. Symbolic Logic 9, 33–41 (1944)

    Article  MathSciNet  MATH  Google Scholar 

  2. Haraburda, D., Tarau, P.: Binary trees as a computational framework. Comput. Lang. Syst. Struct. 39(4), 163–181 (2013)

    MATH  Google Scholar 

  3. Knuth, D.E.: Mathematics and computer science: coping with finiteness. Science 194(4271), 1235–1242 (1976)

    Article  MathSciNet  MATH  Google Scholar 

  4. Knuth, D.E.: TCALC (1994). http://math.mit.edu/~rstan/ec/catadd.pdf

  5. Knuth, D.E.: The Art of Computer Programming, Volume 4, Fascicle 4: Generating All Trees-History of Combinatorial Generation (Art of Computer Programming). Addison-Wesley Professional (2006)

    Google Scholar 

  6. Kreher, D.L., Stinson, D.: Combinatorial Algorithms: Generation, Enumeration, and Search. The CRC Press Series on Discrete Mathematics and its Applications, CRC PressINC (1999)

    Google Scholar 

  7. Stanley, R.P.: Enumerative Combinatorics. Wadsworth Publ. Co., Belmont (1986).http://www-cs-faculty.stanford.edu/~uno/programs/tcalc.w.gz

    Google Scholar 

  8. Stanley, R.P.: Catalan Addendum (2013). http://www-math.mit.edu/rstan/ec/catadd.pdf

  9. Tarau, P.: A groupoid of isomorphic data transformations. In: Carette, J., Dixon, L., Coen, C.S., Watt, S.M. (eds.) MKM 2009, Held as Part of CICM 2009. LNCS, vol. 5625, pp. 170–185. Springer, Heidelberg (2009)

    Chapter  Google Scholar 

  10. Tarau, P.: Bijective collection encodings and boolean operations with hereditarily binary natural numbers. In: Proceedings of the 16th international ACM SIGPLAN Symposium on Principles and Practice of Declarative Programming, PPDP 2014. ACM, New York (2014)

    Google Scholar 

  11. Tarau, P.: A Generic Numbering System based on Catalan Families of Combinatorial Objects (2014). CoRR abs/1406.1796

  12. Tarau, P.: Computing with Catalan families. In: Dediu, A.-H., Martín-Vide, C., Sierra-Rodríguez, J.-L., Truthe, B. (eds.) LATA 2014. LNCS, vol. 8370, pp. 565–575. Springer, Heidelberg (2014)

    Chapter  Google Scholar 

  13. Tarau, P.: The arithmetic of recursively run-length compressed natural numbers. In: Ciobanu, G., Méry, D. (eds.) ICTAC 2014. LNCS, vol. 8687, pp. 406–423. Springer, Heidelberg (2014)

    Google Scholar 

  14. Tarau, P.: A Size-proportionate Bijective Encoding of Lambda Terms as Catalan Objects endowed with Arithmetic Operations. In: Gavanelli, M., Reppy, J. (eds.) PADL 2016. LNCS, vol. 9585, pp. 99–116. Springer, Cham (2016)

    Google Scholar 

  15. Tarau, P., Buckles, B.: Arithmetic algorithms for hereditarily binary natural numbers. In: Proceedings of SAC 2014, ACM Symposium on Applied Computing, PL track. ACM, Gyeongju, March 2014

    Google Scholar 

  16. Wadler, P., Blott, S.: How to make ad-hoc polymorphism less ad-hoc. In: POPL, pp. 60–76 (1989)

    Google Scholar 

Download references

Acknowledgement

This research has been supported by NSF grant 1423324. We thanks the reviewers of PADL’16 for their constructive suggestions and comments.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Paul Tarau .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2016 Springer International Publishing Switzerland

About this paper

Cite this paper

Tarau, P. (2016). Computing with Catalan Families, Generically. In: Gavanelli, M., Reppy, J. (eds) Practical Aspects of Declarative Languages. PADL 2016. Lecture Notes in Computer Science(), vol 9585. Springer, Cham. https://doi.org/10.1007/978-3-319-28228-2_8

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-28228-2_8

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-28227-5

  • Online ISBN: 978-3-319-28228-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics