Simple grammar bisimilarity, with an application to session type equivalence
Diogo Poças, Gil Silva, Vasco T. Vasconcelos
TL;DR
This work resolves the simple grammar bisimilarity problem with a basis-updating algorithm whose running time is polynomial in the grammar size, valuation, and input seminorms, yielding a single-exponential overall bound since the valuation is at most exponential in the grammar size. It also provides a linear-valuation translation from context-free session types to simple grammars, yielding the first polynomial-time algorithm for context-free session type equivalence. The core theoretical contributions include a unique tail-recursion characterization, a coinductive congruence framework via self-bisimulation bases, and a concrete algorithm with proven YES/NO soundness and termination. Practical impact is demonstrated by numerical experiments showing competitive performance against prior 2-EXPTIME approaches, and the methodology enables efficient type equivalence checking in compilers and tooling for session-typed languages. The work leaves open the question of a possible polynomial-time algorithm in general and motivates further study of coinductive congruence structures in infinite-state bisimilarity problems.
Abstract
We provide an algorithm for deciding simple grammar bisimilarity whose complexity is polynomial in the valuation of the grammar (maximum seminorm among production rules). Since the valuation is at most exponential in the size of the grammar, this gives rise to a (single) exponential running time. Previously only a double-exponential algorithm was known. As an application, we provide a conversion from context-free session types to simple grammars whose valuation is linear in the size of the type. In this way, we provide the first polynomial-time algorithm for deciding context-free session type equivalence.
