English

Parsing as a lifting problem and the Chomsky-Sch\"utzenberger representation theorem

Category Theory 2023-06-22 v5 Formal Languages and Automata Theory

Abstract

We begin by explaining how any context-free grammar encodes a functor of operads from a freely generated operad into a certain "operad of spliced words". This motivates a more general notion of CFG over any category CC, defined as a finite species SS equipped with a color denoting the start symbol and a functor of operads p:Free[S]W[C]p : Free[S] \to W[C] into the operad of spliced arrows in CC. We show that many standard properties of CFGs can be formulated within this framework, and that usual closure properties of CF languages generalize to CF languages of arrows. We also discuss a dual fibrational perspective on the functor pp via the notion of "displayed" operad, corresponding to a lax functor of operads W[C]Span(Set)W[C] \to Span(Set). We then turn to the Chomsky-Sch\"utzenberger Representation Theorem. We describe how a non-deterministic finite state automaton can be seen as a category QQ equipped with a pair of objects denoting initial and accepting states and a functor of categories QCQ \to C satisfying the unique lifting of factorizations property and the finite fiber property. Then, we explain how to extend this notion of automaton to functors of operads, which generalize tree automata, allowing us to lift an automaton over a category to an automaton over its operad of spliced arrows. We show that every CFG over a category can be pulled back along a ND finite state automaton over the same category, and hence that CF languages are closed under intersection with regular languages. The last important ingredient is the identification of a left adjoint C[]:OperadCatC[-] : Operad \to Cat to the operad of spliced arrows functor, building the "contour category" of an operad. Using this, we generalize the C-S representation theorem, proving that any context-free language of arrows over a category CC is the functorial image of the intersection of a CC-chromatic tree contour language and a regular language.

Keywords

Cite

@article{arxiv.2212.09060,
  title  = {Parsing as a lifting problem and the Chomsky-Sch\"utzenberger representation theorem},
  author = {Paul-André Melliès and Noam Zeilberger},
  journal= {arXiv preprint arXiv:2212.09060},
  year   = {2023}
}

Comments

reformatted for publication in ENTICS, proceedings of MFPS 2022

R2 v1 2026-06-28T07:40:52.970Z