Abstract

For any given binary relation ϱ defined on the context-free grammars, there is the associated computational problem of determining, for a pair of grammars ( G, H), if G ϱ H. We study the complexity of this problem for a number of grammatical similarity relations whose definitions involve mappings between the symbols of related grammars. The relations considered include Reynolds covering, weak Reynolds covering, onto grammar homomorphism, grammar isomorphism, interpretation of grammar forms, and weak interpretation of grammar forms. A single general theorem is used to show that the computational problem associated with each of these grammatical relations, except grammar isomorphism, is NP-complete. In contrast, deterministic polynomial time algorithms are presented for testing if G ϱ H, when H is structurally unambiguous and the relation ϱ is Reynolds covering, onto grammar homomorphism, or grammar isomorphism. These results provide a rare example of a nontrivial natural algebraic and/or combinatorial structure, namely the unambiguous context-free grammars, with polynomial time algorithms for homomorphism, onto homomorphism, and isomorphism. We also show that the grammar isomorphism problem is polynomially equivalent to the graph isomorphism problem.

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.