Sciweavers

ICFP
2008
ACM

Efficient nondestructive equality checking for trees and graphs

14 years 4 months ago
Efficient nondestructive equality checking for trees and graphs
The Revised6 Report on Scheme requires its generic equivalence predicate, equal?, to terminate even on cyclic inputs. While the terminating equal? can be implemented via a DFA-equivalence or union-find algorithm, these algorithms usually require an additional pointer to be stored in each object, are not suitable for multithreaded code due to their destructive nature, and may be unacceptably slow for the small acyclic values that are the most likely inputs to the predicate. This paper presents a variant of the union-find algorithm for equal? that addresses these issues. It performs well on large and small, cyclic and acyclic inputs by interleaving a low-overhead algorithm that terminates only for acyclic inputs with a more general algorithm that handles cyclic inputs. The algorithm terminates for all inputs while never being more than a small factor slower than whichever of the acyclic or union-find algorithms would have been faster. Several intermediate algorithms are also presented, ...
Michael D. Adams, R. Kent Dybvig
Added 13 Dec 2009
Updated 13 Dec 2009
Type Conference
Year 2008
Where ICFP
Authors Michael D. Adams, R. Kent Dybvig
Comments (0)