TY - GEN
T1 - Sharing equality is linear
AU - Condoluci, Andrea
AU - Accattoli, Beniamino
AU - Coen, Claudio Sacerdoti
N1 - Publisher Copyright:
© 2019 ACM.
PY - 2019/10/7
Y1 - 2019/10/7
N2 - The λ-calculus is a handy formalism to specify the evaluation of higher-order programs. It is not very handy, however, when one interprets the specification as an execution mechanism, because terms can grow exponentially with the number of β-steps. This is why implementations of functional languages and proof assistants always rely on some form of sharing of subterms. These frameworks however do not only evaluate λ-terms, they also have to compare them for equality. In presence of sharing, one is actually interested in equality of the underlying unshared λ-terms. The literature contains algorithms for such a sharing equality, that are polynomial in the sizes of the shared terms. This paper improves the bounds in the literature by presenting the first linear time algorithm. As others before us, we are inspired by Paterson and Wegman's algorithm for first-order unification, itself based on representing terms with sharing as DAGs, and sharing equality as bisimulation of DAGs. Beyond the improved complexity, a distinguishing point of our work is a dissection of the involved concepts. In particular, we show that the algorithm computes the smallest bisimulation between the given DAGs, if any.
AB - The λ-calculus is a handy formalism to specify the evaluation of higher-order programs. It is not very handy, however, when one interprets the specification as an execution mechanism, because terms can grow exponentially with the number of β-steps. This is why implementations of functional languages and proof assistants always rely on some form of sharing of subterms. These frameworks however do not only evaluate λ-terms, they also have to compare them for equality. In presence of sharing, one is actually interested in equality of the underlying unshared λ-terms. The literature contains algorithms for such a sharing equality, that are polynomial in the sizes of the shared terms. This paper improves the bounds in the literature by presenting the first linear time algorithm. As others before us, we are inspired by Paterson and Wegman's algorithm for first-order unification, itself based on representing terms with sharing as DAGs, and sharing equality as bisimulation of DAGs. Beyond the improved complexity, a distinguishing point of our work is a dissection of the involved concepts. In particular, we show that the algorithm computes the smallest bisimulation between the given DAGs, if any.
KW - Alpha-equivalence
KW - Bisimulation
KW - Lambda-calculus
KW - Sharing
U2 - 10.1145/3354166.3354174
DO - 10.1145/3354166.3354174
M3 - Conference contribution
AN - SCOPUS:85083366413
T3 - ACM International Conference Proceeding Series
BT - Proceedings of the 21st International Symposium on Principles and Practice of Declarative Programming, PPDP 2019
PB - Association for Computing Machinery
T2 - 21st International Symposium on Principles and Practice of Declarative Programming, PPDP 2019
Y2 - 7 October 2019 through 9 October 2019
ER -