arXiv · 2612.05743
Treesets: Efficient Finite Sets with Unique Representations
Abstract
Unique representations allow ACL2 users to reason about data structures with ordinary equality rather than weaker equivalence relations. The osets library uses totally ordered lists to uniquely model finite sets, but this representation results in linear time for core primitives like membership, insertion, and deletion. We present the new treeset library, an alternative representation of ordered finite sets based on hash-ordered treaps. Like osets, the data structure is purely functional with a unique representation, while achieving expected logarithmic time for the basic search and update primitives. The core operations are functionally verified and an isomorphism is established with osets. Performance is supported empirically through benchmarking. Finally, we implement and verify a bidirectional iterator over treesets based on zippers.
Explore related subjects
Keep this discovery
Explore connections, maps & timelines
Grant Jurgensen. 2026-12-03. Treesets: Efficient Finite Sets with Unique Representations. https://doi.org/10.4204/eptcs.459.6. https://searcharxiv.org/abs/2612.05743
Citations retain the original authors and DOI and include this site’s record URL. If this discovery service contributed to your research, you can also cite Search arXiv by Indiciae: BibTeX · RIS.