Prime Normal Form and Equivalence of Simple Grammars

A prefix-free language is a prime if it cannot be decomposed into a concatenation of two prefix-free languages. We show that we can check in polynomial time if a language generated by a simple context-free grammar is a prime. Our algorithm computes a canonical representation of a simple language, co...

Full description

Saved in:
Bibliographic Details
Published inImplementation and Application of Automata pp. 78 - 89
Main Authors Bastien, Cédric, Czyzowicz, Jurek, Fraczak, Wojciech, Rytter, Wojciech
Format Book Chapter Conference Proceeding
LanguageEnglish
Published Berlin, Heidelberg Springer Berlin Heidelberg 2006
Springer
SeriesLecture Notes in Computer Science
Subjects
Online AccessGet full text

Cover

Loading…
More Information
Summary:A prefix-free language is a prime if it cannot be decomposed into a concatenation of two prefix-free languages. We show that we can check in polynomial time if a language generated by a simple context-free grammar is a prime. Our algorithm computes a canonical representation of a simple language, converting its arbitrary simple grammar into Prime Normal Form (PNF); a simple grammar is in PNF if all its nonterminals define primes. We also improve the complexity of testing the equivalence of simple grammars. The best previously known algorithm for this problem worked in O(n13) time. We improve it to O(n7 log2n) and O(n5 polylog v) deterministic time, and O(n4 polylog n) randomized time, where n is the total size of the grammars involved, and v is the length of a shortest string derivable from a nonterminal, maximized over all nonterminals. Our improvement is based on a version of Caucal’s algorithm from [1].
Bibliography:The research of the first three authors was supported by NSERC and the research of the fourth author was supported by the grants KBN 4T11C04425 and ITR-CCR-0313219.
ISBN:3540310231
9783540310235
ISSN:0302-9743
1611-3349
DOI:10.1007/11605157_7