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
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Adams, S.: Implementing sets efficiently in a functional language (Technical Report CSTR 92-10) (1992)
Adams, S.: Efficient sets – a balancing act. J. Funct. Program. 3(4), 553–561 (1993)
Adelson-Velskii, G.M., Landis, E.M.: An algorithm for the organization of information. Dokladi Akademia Nauk SSSR 146 (1962)
Guibas, L.J., Sedgewick, R.: A dichromatic framework for balanced trees. In: Annual IEEE Symposium on Foundations of Computer Science, pp. 8–21 (1978)
Hirai, Y., Yamamoto, K.: Balancing weight-balanced trees. J. Funct. Program 21(3), 287–307 (2011), http://dx.doi.org/10.1017/S0956796811000104
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)
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
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
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
The containers package, http://hackage.haskell.org/package/containers
The criterion package, http://hackage.haskell.org/package/criterion
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)