Abstract
We present a polynomial time algorithm for testing if two morphisms are equal on every word of a context-free language. The input to the algorithm are a context-free grammar with constant size productions and two morphisms. The best previously known algorithm had exponential time complexity. Our algorithm can be also used to test in polynomial tiime whether or not n first elements of two sequences of words defined by recurrence formulae are the same. In particular, if the well known 2n conjecture for D0L sequences holds, the algorithm can test in polynomial time equivalence of two D0L sequences.
Additionally, we extend the result from [5] by proving the existence of polynomial size test sets for context-free languages not only in free monoids but in free groups as well. The main points of our proof are the same as in [6, 5]. The main change is a new short proof of the main lemma. The previous proof took 10 pages. It was complicated since it considered many cases and used advanced properties of periodicity of words. Our proof takes only 2 pages. The simplification is a consequence of embedding a free monoid into a free group.
Supported by the grant EC Cooperation Action IC 1000 Algorithms for Future Technologies ALTEC.
Preview
Unable to display preview. Download preview PDF.
References
J. Aho, J. Hopcroft, J. Ullman, “The design and analysis of computer algorithms”, Addison-Wesley, 1974.
J. Albert, K. Culik II, J. Karhumäki, Test sets for context-free languages and algebraic systems of equations, Inform. Control 52(1982), 172–186.
J. Jaffar, Minimal and complete word unification, JACM 37(1), 47–85.
S. Jarominek, J. Karhumäki, W. Rytter, Efficient construction of test sets for regular and context-free languages, Theoret. Comp. Science (to appear).
J. Karhumäki, W. Plandowski, W. Rytter, Polynomial size test sets for contextfree languages, JCSS (to appear).
J. Karhumäki, W. Plandowski, W. Rytter, Polynomial size test sets for contextfree languages, in Proceedings of ICALP'92, Lect. Notes in Comp. Science 623 (1992), 53–64.
A. Koscielski, L. Pacholski, Complexity of unification in free groups and free semigroups, in Proc. 3st Annual IEEE Symposium on Foundations of Computer Science, Los Alamitos 1990, 824–829.
M. Lothaire, “Combinatorics on words”, Addison-Wesley Publishing Company, Massachussets, 1983.
G.S. Makanin, The problem of solvability of equations in a free semigroup, Math. USSR Sbornik 32, 2(1977), 129–198.
J.P. Pecuchet, Equations avec constantes et algorithme de Makanin, These de doctorat, Laboratoire d'informatique, Rouen, 1981.
K.U. Schultz, Makanin's algorithm for word equations — two improvements and a generalization, CS Report 91-39, Centrum für Informations und Sprachverarbeitung, University of Munique, 1991.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1994 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Plandowski, W. (1994). Testing equivalence of morphisms on context-free languages. In: van Leeuwen, J. (eds) Algorithms — ESA '94. ESA 1994. Lecture Notes in Computer Science, vol 855. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0049431
Download citation
DOI: https://doi.org/10.1007/BFb0049431
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-58434-6
Online ISBN: 978-3-540-48794-4
eBook Packages: Springer Book Archive