Abstract
Spider spinning is a snappy name for the problem of listing the ideals of a totally acyclic poset in such a way that each ideal is computed from its predecessor in constant time. Such an algorithm is said to be loopless. Our aim in these lectures is to show how to calculate a loopless algorithm for spider spinning. The calculation makes use of the fundamental laws of functional programming and the real purpose of the exercise is to show these laws in action.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Ehrlich, G.: Loopless algorithms for generating permutations, combinations, and other combinatorial configurations. J. ACM 20, 500–513 (1973)
Filliâtre, J.-C., Pottier, F.: Producing all ideals of a forest, functionally. Journal of Functional Programming 13(5), 945–956 (2003)
Koda, Y., Ruskey, R.: A Gray code for the ideals of a forest poset. Journal of Algorithms 15, 324–340 (1993)
Knuth, D.E.: SPIDERS: (2001), http://www-cs-faculty.stanford.edu/~knuth/programs.html
Knuth, D.E.: The Art of Computer Programming, vol. 4, Fascicles 2,3,4. Addison-Wesley, Reading (2005)
Knuth, D.E., Ruskey, F.: Efficient Coroutine Generation of Constrained Gray Sequences (aka Deconstructing Coroutines). In: Owe, O., Krogdahl, S., Lyche, T. (eds.) From Object-Orientation to Formal Methods. LNCS, vol. 2635, pp. 183–208. Springer, Heidelberg (2004)
Okasaki, C.: Simple and efficient purely functional queues and deques. Journal of Functional Programming 5(4), 583–592 (1995)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2009 Springer-Verlag Berlin Heidelberg
About this chapter
Cite this chapter
Bird, R.S. (2009). Spider Spinning for Dummies. In: Koopman, P., Plasmeijer, R., Swierstra, D. (eds) Advanced Functional Programming. AFP 2008. Lecture Notes in Computer Science, vol 5832. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-04652-0_2
Download citation
DOI: https://doi.org/10.1007/978-3-642-04652-0_2
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-04651-3
Online ISBN: 978-3-642-04652-0
eBook Packages: Computer ScienceComputer Science (R0)