Abstract
A discriminator partitions values associated with keys into groups listed in ascending order. Discriminators can be defined generically by structural recursion on representations of ordering relations. Employing type-indexed families we demonstrate how tries with an optimal-time lookup function can be constructed generically in worst-case linear time. We provide generic implementations of comparison, sorting, discrimination and trie building functions and give equational proofs of correctness that highlight core relations between these algorithms.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Strachey, C.: Fundamental concepts in programming languages. Higher-order and Symbolic Computation 13(1), 11–49 (2000)
Henglein, F.: Generic discrimination: Sorting and partitioning unshared data in linear time. In: Hook, J., Thiemann, P. (eds.) Proc. 13th ACM SIGPLAN Int’l Conf. on Functional Programming (ICFP), pp. 91–102. ACM (September 2008)
Henglein, F.: Generic top-down discrimination for sorting and partitioning in linear time. Journal of Functional Programming (JFP) 22(3), 300–374 (2012)
Bentley, J.L., Sedgewick, R.: Fast algorithms for sorting and searching strings. In: SODA 1997: Proceedings of the Eighth Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 360–369. Society for Industrial and Applied Mathematics, Philadelphia (1997)
Hinze, R.: Generalizing generalized tries. Journal of Functional Programming 10(4), 327–351 (2000)
Hoare, C.A.: Quicksort. The Computer Journal 5(1), 10–16 (1962)
Bayer, R.: Symmetric binary B-trees: Data structure and maintenance algorithms. Acta Informatica 1(4), 290–306 (1972)
Guibas, L.J., Sedgewick, R.: A dichromatic framework for balanced trees. In: Proc. 19th Annual Symposium on Foundations of Computer Science (FOCS), pp. 8–21. IEEE (1978)
Cai, J., Paige, R.: Using multiset discrimination to solve language processing problems without hashing. Theoretical Computer Science (TCS) 145(1-2), 189–228 (1995)
Connelly, R.H., Morris, F.L.: A generalization of the trie data structure. Mathematical Structures in Computer Science 5(3), 381–418 (1995)
Wadler, P.: Theorems for free! In: Proc. Functional Programming Languages and Computer Architecture (FPCA), pp. 347–359. ACM Press, London (1989)
Day, N.A., Launchbury, J., Lewis, J.: Logical abstractions in Haskell. In: Proc. Haskell Workshop. Number UU-CS-1999-28 in Technical Report, Utrecht, The Netherlands, Utrecht University (1999)
Knuth, D.: The Art of Computer Programming: Sorting and Searching, 2nd edn., vol. 3. Addison Wesley (1998)
Henglein, F.: What is a sorting function? J. Logic and Algebraic Programming (JLAP) 78(5), 381–401 (2009)
Gibbons, J.: A pointless derivation of radix sort. Journal of Functional Programming 9(3), 339–346 (1999)
Paige, R., Tarjan, R.E.: Three partition refinement algorithms. SIAM Journal of Computing 16(6), 973–989 (1987)
Sinha, R., Zobel, J.: Efficient trie-based sorting of large sets of strings. In: Proc. 26th Australasian Computer Science Conference (ACSC), pp. 11–18 (2003)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2013 Springer International Publishing Switzerland
About this paper
Cite this paper
Henglein, F., Hinze, R. (2013). Sorting and Searching by Distribution: From Generic Discrimination to Generic Tries. In: Shan, Cc. (eds) Programming Languages and Systems. APLAS 2013. Lecture Notes in Computer Science, vol 8301. Springer, Cham. https://doi.org/10.1007/978-3-319-03542-0_23
Download citation
DOI: https://doi.org/10.1007/978-3-319-03542-0_23
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-03541-3
Online ISBN: 978-3-319-03542-0
eBook Packages: Computer ScienceComputer Science (R0)