Document Open Access Logo

Counting Computations with Formulae: Logical Characterisations of Counting Complexity Classes

Authors Antonis Achilleos , Aggeliki Chalki

Thumbnail PDF


  • Filesize: 0.95 MB
  • 15 pages

Document Identifiers

Author Details

Antonis Achilleos
  • Department of Computer Science, Reykjavik University, Iceland
Aggeliki Chalki
  • Department of Computer Science, Reykjavik University, Iceland


The authors would like to thank Stathis Zachos and Aris Pagourtzis for fruitful discussions and Luca Aceto for sound advice. We also thank the anonymous reviewers for their suggestions and constructive comments.

Cite AsGet BibTex

Antonis Achilleos and Aggeliki Chalki. Counting Computations with Formulae: Logical Characterisations of Counting Complexity Classes. In 48th International Symposium on Mathematical Foundations of Computer Science (MFCS 2023). Leibniz International Proceedings in Informatics (LIPIcs), Volume 272, pp. 7:1-7:15, Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2023)


We present quantitative logics with two-step semantics based on the framework of quantitative logics introduced by Arenas et al. (2020) and the two-step semantics defined in the context of weighted logics by Gastin & Monmege (2018). We show that some of the fragments of our logics augmented with a least fixed point operator capture interesting classes of counting problems. Specifically, we answer an open question in the area of descriptive complexity of counting problems by providing logical characterisations of two subclasses of #P, namely SpanL and TotP, that play a significant role in the study of approximable counting problems. Moreover, we define logics that capture FPSPACE and SpanPSPACE, which are counting versions of PSPACE.

Subject Classification

ACM Subject Classification
  • Theory of computation → Complexity theory and logic
  • Theory of computation → Complexity classes
  • descriptive complexity
  • quantitative logics
  • counting problems
  • #P


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


  1. Antonis Achilleos and Mathias Ruggaard Pedersen. Axiomatizations and computability of weighted monadic second-order logic. In Proc. of the 36th Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2021, pages 1-13. IEEE, 2021. URL:
  2. Carme Àlvarez and Birgit Jenner. A very hard log-space counting class. Theoretical Computer Science, 107(1):3-30, 1993. URL:
  3. Antonis Antonopoulos, Eleni Bakali, Aggeliki Chalki, Aris Pagourtzis, Petros Pantavos, and Stathis Zachos. Completeness, approximability and exponential time results for counting problems with easy decision version. Theoretical Computer Science, 915:55-73, 2022. URL:
  4. Marcelo Arenas, Luis Alberto Croquevielle, Rajesh Jayaram, and Cristian Riveros. Efficient logspace classes for enumeration, counting, and uniform generation. SIGMOD Record, 49(1):52-59, 2020. URL:
  5. Marcelo Arenas, Martin Muñoz, and Cristian Riveros. Descriptive complexity for counting complexity classes. Logical Methods in Computer Science, 16(1), 2020. URL:
  6. Sanjeev Arora, Carsten Lund, Rajeev Motwani, Madhu Sudan, and Mario Szegedy. Proof verification and hardness of approximation problems. In Proc. of the 33rd Annual Symposium on Foundations of Computer Science, FOCS 1992, pages 14-23. IEEE Computer Society, 1992. URL:
  7. Albert Atserias, Anuj Dawar, and Joanna Ochremiak. On the power of symmetric linear programs. Journal of the ACM, 68(4):26:1-26:35, 2021. URL:
  8. Eleni Bakali, Aggeliki Chalki, and Aris Pagourtzis. Characterizations and approximability of hard counting classes below #P. In Proc. of the 16th International Conference on Theory and Applications of Models of Computation, TAMC 2020, volume 12337 of Lecture Notes in Computer Science, pages 251-262, 2020. URL:
  9. J. Richard Büchi. Weak second‐order arithmetic and finite automata. Mathematical Logic Quarterly, 6:66-92, 1960. URL:
  10. Kevin J. Compton and Erich Grädel. Logical definability of counting functions. Journal of Computer and System Sciences, 53(2):283-297, 1996. URL:
  11. Manfred Droste and Paul Gastin. Weighted automata and weighted logics. Theoretical Computer Science, 380(1):69-86, 2007. URL:
  12. Arnaud Durand, Anselm Haak, Juha Kontinen, and Heribert Vollmer. Descriptive complexity of #P functions: A new perspective. Journal of Computer and System Sciences, 116:40-54, 2021. URL:
  13. Martin E. Dyer, Leslie Ann Goldberg, Catherine S. Greenhill, and Mark Jerrum. The relative complexity of approximate counting problems. Algorithmica, 38(3):471-500, 2004. URL:
  14. Martin E. Dyer, Leslie Ann Goldberg, and Mark Jerrum. An approximation trichotomy for boolean #CSP. Journal of Computer and System Sciences, 76(3-4):267-277, 2010. URL:
  15. Calvin C. Elgot. Decision problems of finite automata design and related arithmetics. Transactions of the American Mathematical Society, 98:21-51, 1962. URL:
  16. Herbert B. Enderton. A Mathematical Introduction to Logic. Academic Press, 1972. URL:
  17. Ronald Fagin. Generalized first-order spectra, and polynomial. time recognizable sets. SIAM-AMS Proceedings, 7:43-73, 1974. URL:
  18. Paul Gastin and Benjamin Monmege. A unifying survey on weighted logics and weighted automata - core weighted logic: minimal and versatile specification of quantitative properties. Soft Computing, 22(4):1047-1065, 2018. URL:
  19. Vivek Gore, Mark Jerrum, Sampath Kannan, Z. Sweedyk, and Stephen R. Mahaney. A quasi-polynomial-time algorithm for sampling words from a context-free language. Information and Computation, 134(1):59-74, 1997. URL:
  20. Erich Grädel and Wied Pakusa. Rank logic is dead, long live rank logic! The Journal of Symbolic Logic, 84(1):54-87, 2019. URL:
  21. Neil Immerman. Descriptive complexity. Springer, 1999. URL:
  22. Mark Jerrum, Alistair Sinclair, and Eric Vigoda. A polynomial-time approximation algorithm for the permanent of a matrix with nonnegative entries. Journal of the ACM, 51(4):671-697, July 2004. URL:
  23. Richard M Karp, Michael Luby, and Neal Madras. Monte-carlo approximation algorithms for enumeration problems. Journal of Algorithms, 10(3):429-448, 1989. URL:
  24. Johannes Köbler, Uwe Schöning, and Jacobo Torán. On counting and approximation. Acta Informatica, 26(4):363-379, 1989. URL:
  25. Richard E. Ladner. Polynomial space counting problems. SIAM Journal on Computing, 18(6):1087-1097, 1989. URL:
  26. Leonid Libkin. Elements of Finite Model Theory. Springer, 2004. URL:
  27. Aris Pagourtzis and Stathis Zachos. The complexity of counting functions with easy decision version. In Proc. of the 31st International Symposium on Mathematical Foundations of Computer Science 2006, MFCS 2006, pages 741-752. Springer, 2006. URL:
  28. Christos H. Papadimitriou. Computational Complexity. Addison-Wesley, 1994. URL:
  29. Christos H. Papadimitriou and Mihalis Yannakakis. Optimization, approximation, and complexity classes. Journal of Computer and System Sciences, 43(3):425-440, 1991. URL:
  30. Sanjeev Saluja, K. V. Subrahmanyam, and Madhukar N. Thakur. Descriptive complexity of #P functions. Journal of Computer and System Sciences, 50(3):493-505, 1995. URL:
  31. Boris A. Trakhtenbrot. Finite automata and the logic of monadic predicates. Doklady Akademii Nauk SSSR, 140:326-329, 1961. Google Scholar
  32. Leslie G. Valiant. The complexity of computing the permanent. Theoretical Computer Science, 8(2):189-201, 1979. URL:
  33. Nils Vortmeier and Thomas Zeume. Dynamic complexity of parity exists queries. Logical Methods in Computer Science, 17(4), 2021. 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