Treesets: Efficient Finite Sets with Unique Representations
cs.LO
Submitted: 2026-12-03
Updated: 2026-12-03
Comments: In Proceedings ACL2-2026, arXiv:2612.03645
Journal ref: EPTCS 459, 2026, pp. 70-87
DOI: 10.4204/EPTCS.459.6
License: http://creativecommons.org/licenses/by/4.0/
The gist: Unique representations allow ACL2 users to reason about data structures with ordinary equality rather than weaker equivalence relations.
Terminology
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.
Related papers
- Bit-Precise CHC Satisfiability Using Theory-Modular Reasoning
- interwhen: A Generalizable Framework for Steering Reasoning Models with Test-time Verification
- On Higher-Order Reachability Games vs May Reachability
- A Non-Dichotomy for CSPs of Stable omega-Categorical Structures
- A Deeper Look at Depth: Stable Generation Accounting for Quantifier Reasoning
- Formalizing Hyperspaces and Operations on Subsets of Polish Spaces over Abstract Exact Real Numbers