pith. sign in

arxiv: 1702.06698 · v2 · pith:Y2S7GRPOnew · submitted 2017-02-22 · 💻 cs.FL

Computing the longest common prefix of a context-free language in polynomial time

classification 💻 cs.FL
keywords commonlongestprefixlanguagecontext-freegrammarlanguagespolynomial
0
0 comments X
read the original abstract

We present two structural results concerning longest common prefixes of non-empty languages. First, we show that the longest common prefix of the language generated by a context-free grammar of size $N$ equals the longest common prefix of the same grammar where the heights of the derivation trees are bounded by $4N$. Second, we show that each nonempty language $L$ has a representative subset of at most three elements which behaves like $L$ w.r.t. the longest common prefix as well as w.r.t. longest common prefixes of $L$ after unions or concatenations with arbitrary other languages. From that, we conclude that the longest common prefix, and thus the longest common suffix, of a context-free language can be computed in polynomial time.

This paper has not been read by Pith yet.

discussion (0)

Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.