Skip to main content

Adams’ Trees Revisited

Correctness Proof and Efficient Implementation

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 7193))

Abstract

We present a correctness proof of Adams’ trees of bounded balance, which are used in Haskell to implement Data.Map and Data.Set. Our analysis includes the previously ignored join operation, and also guarantees trees with smaller depth than the original one. Because the Adams’ trees can be parametrized, we use benchmarking to find the best choice of parameters. Finally, a saving memory technique based on introducing additional data constructor is evaluated.

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

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   54.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   72.00
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

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Adams, S.: Implementing sets efficiently in a functional language (Technical Report CSTR 92-10) (1992)

    Google Scholar 

  2. Adams, S.: Efficient sets – a balancing act. J. Funct. Program. 3(4), 553–561 (1993)

    Article  Google Scholar 

  3. Adelson-Velskii, G.M., Landis, E.M.: An algorithm for the organization of information. Dokladi Akademia Nauk SSSR 146 (1962)

    Google Scholar 

  4. Guibas, L.J., Sedgewick, R.: A dichromatic framework for balanced trees. In: Annual IEEE Symposium on Foundations of Computer Science, pp. 8–21 (1978)

    Google Scholar 

  5. Hirai, Y., Yamamoto, K.: Balancing weight-balanced trees. J. Funct. Program 21(3), 287–307 (2011), http://dx.doi.org/10.1017/S0956796811000104

    Article  MathSciNet  MATH  Google Scholar 

  6. Knuth, D.: 6.2.2: Binary Tree Searching. In: The Art of Computer Programming, 3rd edn. Sorting and Searching, vol. 3, pp. 426–458. Addison-Wesley (1997)

    Google Scholar 

  7. Marlow, S., Yakushev, A.R., Jones, S.P.: Faster laziness using dynamic pointer tagging. In: Proceedings of the 12th ACM SIGPLAN International Conference on Functional Programming, ICFP 2007, pp. 277–288. ACM, New York (2007), http://doi.acm.org/10.1145/1291151.1291194

    Chapter  Google Scholar 

  8. Nievergelt, J., Reingold, E.M.: Binary search trees of bounded balance. In: Proceedings of the Fourth Annual ACM Symposium on Theory of Computing, STOC 1972, pp. 137–142. ACM, New York (1972), http://doi.acm.org/10.1145/800152.804906

    Chapter  Google Scholar 

  9. Straka, M.: The performance of the haskell containers package. In: Proceedings of the Third ACM Haskell Symposium on Haskell 2010, pp. 13–24. ACM, New York (2010), http://doi.acm.org/10.1145/1863523.1863526

    Chapter  Google Scholar 

  10. The containers package, http://hackage.haskell.org/package/containers

  11. The criterion package, http://hackage.haskell.org/package/criterion

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2012 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Straka, M. (2012). Adams’ Trees Revisited. In: Peña, R., Page, R. (eds) Trends in Functional Programming. TFP 2011. Lecture Notes in Computer Science, vol 7193. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-32037-8_9

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-32037-8_9

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-32036-1

  • Online ISBN: 978-3-642-32037-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics