3 research outputs found
Certified Context-Free Parsing: A formalisation of Valiant's Algorithm in Agda
Valiant (1975) has developed an algorithm for recognition of context free
languages. As of today, it remains the algorithm with the best asymptotic
complexity for this purpose. In this paper, we present an algebraic
specification, implementation, and proof of correctness of a generalisation of
Valiant's algorithm. The generalisation can be used for recognition, parsing or
generic calculation of the transitive closure of upper triangular matrices. The
proof is certified by the Agda proof assistant. The certification is
representative of state-of-the-art methods for specification and proofs in
proof assistants based on type-theory. As such, this paper can be read as a
tutorial for the Agda system
Efficient parallel and incremental parsing of practical context-free languages
We present a divide-and-conquer algorithm for parsing context-free languages efficiently. Our algorithm is an instance of Valiant\u27s (1975; General context-free recognition in less than cubic time. J. Comput. Syst. Sci. 10(2), 308-314), who reduced the problem of parsing to matrix multiplications. We show that, while the conquer step of Valiant\u27s is O(n(3)), it improves to O(log(2) n) under certain conditions satisfied by many useful inputs that occur in practice, and if one uses a sparse representation of matrices. The improvement happens because the multiplications involve an overwhelming majority of empty matrices. This result is relevant to modern computing: divide-and-conquer algorithms with a polylogarithmic conquer step can be parallelized relatively easily