Arrow Research search
Back to I&C

I&C 2025

A parallel algorithm for counting parse trees

Journal Article journal-article Computer Science · Theoretical Computer Science

Abstract

A parallel algorithm for computing the number of parse trees of a given string according to a fixed context-free grammar is defined. More generally, the algorithm applies to computing the weight of a string in a weighted grammar over any semiring. The algorithm is first implemented on an arithmetic circuit of depth at most 6 ( log 2 ⁡ n ) 2 + O ( log ⁡ n ) and with O ( n 6 ) elements, where the constant factors in the big-O notation depend on the grammar. Then, the circuit is improved using fast matrix multiplication to use only O ( n 5. 38 ) elements, while preserving depth O ( ( log ⁡ n ) 2 ).

Authors

Keywords

  • Context-free grammars
  • Weighted grammars
  • Parsing
  • Parallel algorithms
  • Matrix multiplication

Context

Venue
Information and Computation
Archive span
1987-2026
Indexed papers
3021
Paper id
386187427467306840
v2026.09.13