arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2105.02856cs.PLcs.DS
收藏

Hashing Modular Alpha-Equivalence

Hashing Modulo Alpha-Equivalence

Krzysztof Maziarz, Tom Ellis, Alan Lawrence, Andrew Fitzgibbon, Simon Peyton Jones

摘要:

在许多应用中,人们希望标识程序语法树的相同子树。理想情况下,这种识别应该对程序的alpha重命名具有鲁棒性,但没有现有技术显示出以良好的效率实现这一点(在表达大小上优于$\mathcal{O}(n^2)$)。我们提出了一种新的,渐近有效的方式来散列模α-等价。我们的方法的一个关键见解是使用弱(可交换)散列组合器在建设中的一个点,这承认一个算法与$\mathcal{O}(n (\log n)^2)$时间复杂度。我们证明,使用的交换组合器,但产生一个强大的哈希低碰撞概率。数值基准证明了该方法的渐近行为。

英文摘要:

In many applications one wants to identify identical subtrees of a program syntax tree. This identification should ideally be robust to alpha-renaming of the program, but no existing technique has been shown to achieve this with good efficiency (better than $\mathcal{O}(n^2)$ in expression size). We present a new, asymptotically efficient way to hash modulo alpha-equivalence. A key insight of our method is to use a weak (commutative) hash combiner at exactly one point in the construction, which admits an algorithm with $\mathcal{O}(n (\log n)^2)$ time complexity. We prove that the use of the commutative combiner nevertheless yields a strong hash with low collision probability. Numerical benchmarks attest to the asymptotic behaviour of the method.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑