Hashing Modulo Context-Sensitive $\alpha$-Equivalence
Abstract
The notion of -equivalence between -terms is commonly used to identify terms that are considered equal. However, due to the primitive treatment of free variables, this notion falls short when comparing subterms occurring within a larger context. Depending on the usage of the Barendregt convention (choosing different variable names for all involved binders), it will equate either too few or too many subterms. We introduce a formal notion of context-sensitive -equivalence, where two open terms can be compared within a context that resolves their free variables. We show that this equivalence coincides exactly with the notion of bisimulation equivalence. Furthermore, we present an efficient runtime hashing scheme that identifies -terms modulo context-sensitive -equivalence, generalizing over traditional bisimulation partitioning algorithms and improving upon a previously established bound for a hashing modulo ordinary -equivalence by Maziarz et al. Hashing -terms is useful in many applications that require common subterm elimination and structure sharing. We have employed the algorithm to obtain a large-scale, densely packed, interconnected graph of mathematical knowledge from the Coq proof assistant for machine learning purposes.
Keywords
Cite
@article{arxiv.2401.02948,
title = {Hashing Modulo Context-Sensitive $\alpha$-Equivalence},
author = {Lasse Blaauwbroek and Miroslav Olšák and Herman Geuvers},
journal= {arXiv preprint arXiv:2401.02948},
year = {2024}
}
Comments
33 pages