Skip to main content

Formal verification of cP systems using Coq


P systems are widely used to solve computationally hard problems. In this study, we formally verify cP systems (P systems with complex objects) in the Coq proof assistant, and provide a corresponding open source library. To help transform cP notation into Gallina, we propose two sets of modelling guidelines. Comparing to existing P system formal verification studies, our approach shows many advantages and has great potential. To the best of our knowledge, this is the first study to formally verify membrane computing models using an interactive theorem prover.

This is a preview of subscription content, access via your institution.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9


  1. 1.

    cP-Coq and verification examples can be found in


  1. 1.

    Păun, G. (2000). Computing with membranes. Journal of Computer and System Sciences, 61(1), 108–143.

    MathSciNet  Article  Google Scholar 

  2. 2.

    Păun, G. (2003). Membrane computing. In International Symposium on Fundamentals of Computation Theory (pp. 284–295).Malmö, Sweden.

  3. 3.

    Martín-Vide, C., Păun, G., Pazos, J., & Rodríguez-Patón, A. (2003). Tissue P systems. Theoretical Computer Science, 296(2), 295–326.

    MathSciNet  Article  Google Scholar 

  4. 4.

    Ionescu, M., Păun, G., & Yokomori, T. (2006). Spiking neural P systems. Fundamenta informaticae, 71(2–3), 279–308.

  5. 5.

    Gheorgue, M., Ipate, F., Dragomir, C., Mierla, L., Valencia Cabrera, L., García Quismondo, M., & Pérez Jiménez, M. D. J. (2013). Kernel P systems-version 1. In Proceedings of the Eleventh Brainstorming Week on Membrane Computing (pp. 97–124). Sevilla: Spain.

  6. 6.

    Nicolescu, R., Ipate, F., & Wu, H. (2013). Programming P systems with complex objects. In International conference on membrane computing (pp. 280–300). Chişinău: Republic of Moldova.

  7. 7.

    Nicolescu, R., & Henderson, A. (2018). An introduction to cP systems. In Enjoying natural computing (pp.204–227).

  8. 8.

    Dang, Z., Ibarra, O. H., Li, C., & Xie, G. (2006). On the decidability of model-checking for P systems. Journal of Automata, Languages and combinatorics, 11(3), 279–298.

    MathSciNet  MATH  Google Scholar 

  9. 9.

    Gheorghe, M., Ipate, F., Lefticaru, R., Pérez-Jiménez, M. J., Ţurcanu, A., Cabrera, L. Valencia., et al. (2013). 3-Col problem modelling using simple kernel P systems. International Journal of Computer Mathematics, 90(4), 816–830.

    MathSciNet  Article  Google Scholar 

  10. 10.

    Ipate, F., Lefticaru, R., & Tudose, C. (2011). Formal verification of P systems using Spin. International Journal of Foundations of Computer Science, 22(01), 133–142.

    MathSciNet  Article  Google Scholar 

  11. 11.

    Lefticaru, R., Tudose, C., & Ipate, F. (2011). Towards automated verification of P systems using Spin. International Journal of Natural Computing Research (IJNCR), 2(3), 1–12.

    Article  Google Scholar 

  12. 12.

    Gheorghe, M., Ceterchi, R., Ipate, F., Konur, S., & Lefticaru, R. (2018). Kernel P systems: from modelling to verification and testing. Theoretical Computer Science, 724, 45–60.

    MathSciNet  Article  Google Scholar 

  13. 13.

    Konur, S., Mierlă, L., Ipate, F., & Gheorghe, M. (2020). kPWorkbench: A software suit for membrane systems. SoftwareX, 11, 100407.

    Article  Google Scholar 

  14. 14.

    Lefticaru, R., Ipate, F., Cabrera, L. Valencia., Turcanu, A., Tudose, C., Gheorgue, M., Pérez Jiménez, M. d. J., Niculescu, I. M., & Dragomir, C. (2012). Towards an Integrated Approach for Model Simulation, Property Extraction and Veri cation of P Systems. In Proceedings of the Tenth Brainstorming Week on Membrane Computing (pp. 291–318). Sevilla: Spain.

  15. 15.

    Ipate, F., Gheorghe, M., & Lefticaru, R. (2010). Test generation from P systems using model checking. The Journal of Logic and Algebraic Programming, 79(6), 350–362.

    MathSciNet  Article  Google Scholar 

  16. 16.

    Ipate, F., & Turcanu, A. (2011). Modeling, verification and testing of P systems using Rodin and ProB. In Proceedings of the Ninth Brainstorming Week on Membrane Computing (pp. 209–219). Sevilla: Spain.

  17. 17.

    Liu, Y., Nicolescu, R., & Sun, J. (2020). Formal verification of cP systems using PAT3 and ProB. Journal of Membrane Computing, 2(2), 80–94.

  18. 18.

    Aman, B., & Ciobanu, G. (2016). Modelling and verification of weighted spiking neural systems. Theoretical Computer Science, 623, 92–102.

    MathSciNet  Article  Google Scholar 

  19. 19.

    Gheorghe, M., Lefticaru, R., Konur, S., Niculescu, I. M., & Adorna, H. N. (2021). Spiking neural P systems: matrix representation and formal verification. Journal of Membrane Computing, 3(2), 133–148.

    MathSciNet  Article  Google Scholar 

  20. 20.

    Barras, B., Boutin, S., Cornes, C., Courant, J., Filliatre, J. C., Gimenez, E., Herbelin, H., Huet, G., Munoz, C., Murthy, C., & et al. (1997). The Coq proof assistant reference manual: Version 6.1. PhD thesis, Inria.

  21. 21.

    Kästner, D., Barrho, J., Wünsche, U., Schlickling, M., Schommer, B., Schmidt, M., Ferdinand, C., Leroy, X., & Blazy, S. (2018). CompCert: Practical experience on integrating and qualifying a formally verified optimizing compiler. In ERTS2 2018-9th European Congress Embedded Real-Time Software and Systems (pp. 1–9).

  22. 22.

    Gonthier, G. (2008). Formal proof-the four-color theorem. Notices of the AMS, 55(11), 1382–1393.

    MathSciNet  MATH  Google Scholar 

  23. 23.

    Gonthier, G., Asperti, A., Avigad, J., Bertot, Y., Cohen, C., Garillot, F., Roux, S. Le., Mahboubi, A., O’Connor, R., Biha, S. O., & et al. (2013). A machine-checked proof of the odd order theorem. In International Conference on Interactive Theorem Proving (pp. 163–179).

  24. 24.

    Cooper, J., & Nicolescu, R. (2019). The Hamiltonian cycle and travelling salesman problems in cP systems. Fundamenta Informaticae, 164(2–3), 157–180.

    MathSciNet  Article  Google Scholar 

  25. 25.

    Liu, Y., Nicolescu, R., Sun, J., & Henderson, A. (2021). A Sublinear Sudoku Solution in cP Systems and its Formal Verification. Computer Science Journal of Moldova, 29(1), 85–107.

  26. 26.

    Henderson, A., Nicolescu, R., & Dinneen, M. J. (2020). Solving a PSPACE-complete problem with cP systems. Journal of Membrane Computing, 2(4), 311–322.

  27. 27.

    Liu, Y., Nicolescu, R., & Sun, J. (2021). An efficient labelled nested multiset unification algorithm. Journal of Membrane Computing (pp. 1–11).

  28. 28.

    Paulin-Mohring, C. (2011) Introduction to the Coq proof-assistant for practical software verification. In LASER Summer School on Software Engineering (pp. 45–95).

Download references

Author information



Corresponding author

Correspondence to Yezhou Liu.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.


Appendix 1.A: A simulation of the minimum finding cP system, input = {3, 7, 6, 8}


Appendix 1.B: The subset sum cP system in Gallina


The Coq representation of R1, R2, and R3


The Coq representation of R4 and R5

Appendix 1.C: A simulation of the subset sum cP system, S = {1, 2, 3, 4}, T = 10


A simulation of the subset sum cP system, S = {1, 2, 3, 4}, T = 10.

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Liu, Y., Nicolescu, R. & Sun, J. Formal verification of cP systems using Coq. J Membr Comput 3, 205–220 (2021).

Download citation


  • Membrane computing
  • P systems
  • cP systems
  • Formal verification
  • Theorem prover
  • Coq