We present functional implementations of Koda and Ruskey's algorithm for generating all ideals of a forest poset as a Gray code. Using a continuation-based approach, we give an extremely concise formulation of the algorithm's core. Then, in a number of steps, we derive a first-order version whose efficiency is comparable to that of a C implementation given by Knuth.
CITATION STYLE
Filliâtre, J. C., & Pottier, F. (2003). Producing all ideals of a forest, functionally. Journal of Functional Programming, 13(5), 945–956. https://doi.org/10.1017/S0956796803004763
Mendeley helps you to discover research relevant for your work.