The Parikh Property for Weighted Context-Free Grammars

Authors Pierre Ganty , Elena Gutiérrez

Thumbnail PDF


  • Filesize: 0.56 MB
  • 20 pages

Document Identifiers

Author Details

Pierre Ganty
  • IMDEA Software Institute, Madrid, Spain
Elena Gutiérrez
  • IMDEA Software Institute, Madrid, Spain, Universidad Politécnica de Madrid, Spain

Cite AsGet BibTex

Pierre Ganty and Elena Gutiérrez. The Parikh Property for Weighted Context-Free Grammars. In 38th IARCS Annual Conference on Foundations of Software Technology and Theoretical Computer Science (FSTTCS 2018). Leibniz International Proceedings in Informatics (LIPIcs), Volume 122, pp. 32:1-32:20, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2018)


Parikh's Theorem states that every context-free grammar (CFG) is equivalent to some regular CFG when the ordering of symbols in the words is ignored. The same is not true for the so-called weighted CFGs, which additionally assign a weight to each grammar rule. If the result holds for a given weighted CFG G, we say that G satisfies the Parikh property. We prove constructively that the Parikh property holds for every weighted nonexpansive CFG. We also give a decision procedure for the property when the weights are over the rationals.

Subject Classification

ACM Subject Classification
  • Theory of computation → Grammars and context-free languages
  • Weighted Context-Free Grammars
  • Algebraic Language Theory
  • Parikh Image


  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    PDF Downloads


  1. Gerd Baron and Werner Kuich. The Characterization of Nonexpansive Grammars by Rational Power Series. Information and Control, 48(2):109-118, 1981. URL:
  2. Vijay Bhattiprolu, Spencer Gordon, and Mahesh Viswanathan. Extending Parikh’s Theorem to Weighted and Probabilistic Context-Free Grammars. In QEST 2017, pages 3-19, 2017. URL:
  3. David A. Cox, John Little, and Donal O'Shea. Ideals, varieties, and algorithms - an introduction to computational algebraic geometry and commutative algebra (2. ed.). Undergraduate texts in mathematics. Springer, 1997. Google Scholar
  4. Javier Esparza. Petri Nets, Commutative Context-Free Grammars, and Basic Parallel Processes. Fundam. Inform., 31(1):13-25, 1997. URL:
  5. Javier Esparza, Pierre Ganty, Stefan Kiefer, and Michael Luttenberger. Parikh’s theorem: A simple and direct automaton construction. Inf. Process. Lett., 111(12):614-619, 2011. URL:
  6. Javier Esparza, Peter Rossmanith, and Stefan Schwoon. A Uniform Framework for Problems on Context-Free Grammars. Bulletin of the EATCS, 72:169-177, 2000. Google Scholar
  7. Pierre Ganty and Elena Gutiérrez. The Parikh Property for Weighted Context-Free Grammars (extended version). arXiv, 2018. URL:
  8. Pierre Ganty and Rupak Majumdar. Algorithmic Verification of Asynchronous Programs. CoRR, abs/1011.0551, 2010. URL:
  9. Stefan Göller, Richard Mayr, and Anthony Widjaja To. On the Computational Complexity of Verifying One-Counter Processes. In LICS 2009, pages 235-244, 2009. URL:
  10. Jozef Gruska. A Few Remarks on the Index of Context-Free Grammars and Languages. Information and Control, 19(3):216-223, 1971. URL:
  11. Dung T. Huynh. The Complexity of Equivalence Problems for Commutative Grammars. Information and Control, 66(1/2):103-121, 1985. URL:
  12. Thiet-Dung Huynh. The Complexity of Semilinear Sets. In ICALP 1980, pages 324-337, 1980. URL:
  13. Thiet-Dung Huynh. Deciding the Inequivalence of Context-Free Grammars with 1-Letter Terminal Alphabet is Σ^P₂-complete. In FOCS 1982, pages 21-31, 1982. URL:
  14. Werner Kuich. The Kleene and the Parikh Theorem in Complete Semirings. In ICALP 1987, pages 212-225, 1987. URL:
  15. Werner Kuich and Arto Salomaa. Semirings, Automata, Languages, volume 5 of EATCS Monographs on Theoretical Computer Science. Springer, 1986. URL:
  16. Michael Luttenberger and Maximilian Schlund. Convergence of Newton’s Method over Commutative Semirings. Inf. Comput., 246:43-61, 2016. URL:
  17. Rohit Parikh. On Context-Free Languages. J. ACM, 13(4):570-581, 1966. URL:
  18. Ion Petre. Parikh’s theorem does not hold for multiplicities. Journal of Automata, Languages and Combinatorics, 4(1):17-30, 1999. Google Scholar
  19. Thomas W. Reps, Stefan Schwoon, Somesh Jha, and David Melski. Weighted pushdown systems and their application to interprocedural dataflow analysis. Sci. Comput. Program., 58(1-2):206-263, 2005. URL:
  20. Koushik Sen and Mahesh Viswanathan. Model Checking Multithreaded Programs with Asynchronous Atomic Methods. In CAV 2006, pages 300-314, 2006. URL:
  21. Kumar Neeraj Verma, Helmut Seidl, and Thomas Schwentick. On the Complexity of Equational Horn Clauses. In CADE 2005, pages 337-352, 2005. URL:
Questions / Remarks / Feedback

Feedback for Dagstuhl Publishing

Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail