Skip to main content

A Flexible Framework for Integrating Maude and SMT Solvers Using Python

  • Conference paper
  • First Online:
Rewriting Logic and Its Applications (WRLA 2024)

Abstract

This paper presents a new implementation of Maude-SE that provides a flexible yet efficient framework for connecting Maude to SMT solvers. There exist previous implementations to integrate Maude and SMT solvers at the C++ level, but they do not support uninterpreted functions and folding reduction, and are very difficult to customize. The new version of Maude-SE supports uninterpreted functions, symbolic reachability analysis with folding, and an abstract Python connector that makes it easy to integrate and customize SMT solving with Maude using its Python API, without having to understand Maude’s internal implementation and recompile the source code.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

Notes

  1. 1.

    To ensure that all rewrite rules take place at the top of the term, we assume that sort \( State \) is at the top of one of the connected component of poset of sorts, and no operator in \(\Sigma \) has \( State \) or any of its subsorts as an argument sort.

  2. 2.

    As usual, each command has a corresponding metalevel function implemented at the C++ level, and the meta-interpreter invokes these metalevel functions.

  3. 3.

    For SMT solvers with automatic theory detection, ‘using \( Th \)’ can be omitted.

  4. 4.

    To illustrate, consider two terms f(1) and \(f(x + 1)\), where 1 and x + 1 are terms of built-in sorts. f(1) does not match \(f(x + 1)\), but for \(\theta = \{x \mapsto 0\}\), f(1) and \(f(x + 1)\theta \) are equivalent modulo SMT. Using the abstractions of built-ins \((f(y), \{y \mapsto 1\})\) and \((f(z), \{z \mapsto x + 1\})\), we can easily check \((f(y) \mathbin {;} y = 1) \sqsubseteq (f(z) \mathbin {;} z = x + 1)\).

References

  1. Aires Urquiza, A., Alturki, M.A., Ban Kirigin, T., Kanovich, M., Nigam, V., Scedrov, A., Talcott, C.: Resource and timing aspects of security protocols. J. Comput. Secur. 29(3), 299–340 (2021). https://doi.org/10.3233/JCS-200012

  2. Arias, J., Bae, K., Olarte, C., Ölveczky, P.C., Petrucci, L., Rømming, F.: Rewriting logic semantics and symbolic analysis for parametric timed automata. In: International Workshop on Formal Techniques for Safety-Critical Systems, pp. 3–15. ACM (2022). https://doi.org/10.1145/3563822.3569923

  3. Arias, J., Bae, K., Olarte, C., Ölveczky, P.C., Petrucci, L., Rømming, F.: Symbolic analysis and parameter synthesis for time Petri nets using Maude and SMT solving. In: International Conference on Applications and Theory of Petri Nets and Concurrency. LNCS, vol. 13929, pp. 369–392. Springer, Cham (2023). https://doi.org/10.1007/978-3-031-33620-1_20

  4. Arias, J., Bae, K., Olarte, C., Ölveczky, P.C., Petrucci, L., Rømming, F.: Symbolic analysis and parameter synthesis for networks of parametric timed automata with global variables using Maude and SMT solving. Sci. Comput. Programm. 233, 103074 (2024). https://doi.org/10.1016/j.scico.2023.103074

  5. Bae, K., Escobar, S., Meseguer, J.: Abstract logical model checking of infinite-state systems using narrowing. In: International Conference on Rewriting Techniques and Applications. LIPIcs, vol. 21, pp. 81–96. Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2013). https://doi.org/10.4230/LIPIcs.RTA.2013.81

  6. Bae, K., Rocha, C.: Guarded terms for rewriting modulo SMT. In: International Conference on Formal Aspects of Component Software. LNCS, vol. 10487, pp. 78–97. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-68034-7_5

  7. Bae, K., Rocha, C.: Symbolic state space reduction with guarded terms for rewriting modulo SMT. Sci. Comput. Program. 178, 20–42 (2019). https://doi.org/10.1016/j.scico.2019.03.006

  8. Barbosa, H., Barrett, C., Brain, M., Kremer, G., Lachnitt, H., Mann, M., Mohamed, A., Mohamed, M., Niemetz, A., Nötzli, A., et al.: cvc5: A versatile and industrial-strength SMT solver. In: International Conference on Tools and Algorithms for the Construction and Analysis of Systems. LNCS, vol. 13243, pp. 415–442. Springer, Cham (2022). https://doi.org/10.1007/978-3-030-99524-9_24

  9. Barrett, C., Conway, C.L., Deters, M., Hadarean, L., Jovanović, D., King, T., Reynolds, A., Tinelli, C.: CVC4. In: International Conference on Computer Aided Verification. LNCS, vol. 6806, pp. 171–177. Springer, Berlin (2011). https://doi.org/10.1007/978-3-642-22110-1_14

  10. Barrett, C., Stump, A., Tinelli, C.: The SMT-LIB standard: Version 2.0. Technical report, Department of Computer Science, The University of Iowa (2010). Available at www.SMT-LIB.org

  11. Cimatti, A., Griggio, A., Schaafsma, B.J., Sebastiani, R.: The MathSAT5 SMT solver. In: International Conference on Tools and Algorithms for the Construction and Analysis of Systems. LNCS, vol. 7795, pp. 93–107. Springer, Berlin (2013). https://doi.org/10.1007/978-3-642-36742-7_7

  12. Clavel, M., Durán, F., Eker, S., Escobar, S., Lincoln, P., Martí-Oliet, N., Meseguer, J., Rubio, R., Talcott, C.: Maude manual (version 3.3.1). Technical report SRI International, Menlo Park (2023)

    Google Scholar 

  13. De Moura, L., Bjørner, N.: Z3: An efficient SMT solver. In: International Conference on Tools and Algorithms for the Construction and Analysis of Systems. LNCS, vol. 4963, pp. 337–340. Springer, Berlin (2008). https://doi.org/10.1007/978-3-540-78800-3_24

  14. Durán, F., Eker, S., Escobar, S., Martí-Oliet, N., Meseguer, J., Rubio, R., Talcott, C.: Equational unification and matching, and symbolic reachability analysis in Maude 3.2 (system description). In: International Joint Conference on Automated Reasoning. LNCS, vol. 13385, pp. 529–540. Springer, Cham (2022). https://doi.org/10.1007/978-3-031-10769-6_31

  15. Durán, F., Rocha, C., Salaün, G.: Symbolic specification and verification of data-aware BPMN processes using rewriting modulo SMT. In: International Workshop on Rewriting Logic and its Applications. LNCS, vol. 11152, pp. 76–97. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-99840-4_5

  16. Dutertre, B.: Yices 2.2. In: International Conference on Computer Aided Verification. LNCS, vol. 8559, pp. 737–744. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-08867-9_49

  17. Gao, S., Kong, S., Clarke, E.M.: dReal: An SMT solver for nonlinear theories over the reals. In: International Conference on Automated Deduction. LNCS, vol. 7898, pp. 208–214. Springer, Berlin (2013). https://doi.org/10.1007/978-3-642-38574-2_14

  18. Lee, J., Bae, K., Ölveczky, P.C.: An extension of HybridSynchAADL and its application to collaborating autonomous UAVs. In: International Symposium on Leveraging Applications of Formal Methods, Verification and Validation. Adaptation and Learning. LNCS, vol. 13703, pp. 47–64. Springer, Cham (2022). https://doi.org/10.1007/978-3-031-19759-8_4

  19. Lee, J., Bae, K., Ölveczky, P.C., Kim, S., Kang, M.: Modeling and formal analysis of virtually synchronous cyber-physical systems in AADL. Int. J. Softw. Tools Technol. Transfer 24(6), 911–948 (2022). https://doi.org/10.1007/s10009-022-00665-z

  20. Lee, J., Kim, S., Bae, K., Ölveczky, P.C.: HybridSynchAADL: Modeling and formal analysis of virtually synchronous CPSs in AADL. In: International Conference on Computer Aided Verification. LNCS, vol. 12759, pp. 491–504. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-81685-8_23

  21. Lee, J., Kim, S., Bae, K.: Bounded model checking of PLC ST programs using rewriting modulo SMT. In: International Workshop on Formal Techniques for Safety-Critical Systems, pp. 56–67. ACM (2022).https://doi.org/10.1145/3563822.3568016

  22. Meseguer, J.: Generalized rewrite theories, coherence completion, and symbolic methods. J. Logical Algebraic Methods Program. 110, 100483 (2020). https://doi.org/10.1016/j.jlamp.2019.100483

  23. Microsoft Corporation: Strategies. https://microsoft.github.io/z3guide. Accessed 25 Mar 2022

  24. Nigam, V., Talcott, C.: Automating safety proofs about cyber-physical systems using rewriting modulo SMT. In: International Workshop on Rewriting Logic and its Applications, LNCS, vol. 13252, pp. 212–229. Springer, Cham (2022). https://doi.org/10.1007/978-3-031-12441-9_11

  25. Rocha, C., Meseguer, J., Muñoz, C.: Rewriting modulo SMT and open system analysis. J. Logical Algebraic Methods Program. 86(1), 269–297 (2017). https://doi.org/10.1016/j.jlamp.2016.10.001

  26. Rubio, R.: Maude as a library: An efficient all-purpose programming interface. In: International Workshop on Rewriting Logic and its Applications. LNCS, vol. 13252, pp. 274–294. Springer, Cham (2022). https://doi.org/10.1007/978-3-031-12441-9_14

  27. Urquiza, A.A., AlTurki, M.A., Kanovich, M., Kirigin, T.B., Nigam, V., Scedrov, A., Talcott, C.: Resource-bounded intruders in denial of service attacks. In: Computer Security Foundations Symposium, pp. 382–38214. IEEE (2019). https://doi.org/10.1109/CSF.2019.00033

  28. Wang, Q., Datta, P., Yang, W., Liu, S., Bates, A., Gunter, C.A.: Charting the attack surface of trigger-action IoT platforms. In: ACM Conference on Computer and Communications Security, pp. 1439–1453. ACM (2019). https://doi.org/10.1145/3319535.3345662

  29. Whitters, G., Nigam, V., Talcott, C.: Incremental rewriting modulo SMT. In: International Conference on Automated Deduction. LNCS, vol. 14132, pp. 560–576. Springer, Cham (2023). https://doi.org/10.1007/978-3-031-38499-8_32

  30. Yu, G., Bae, K.: Maude-SE: a tight integration of Maude and SMT solvers. In: International Workshop on Rewriting Logic and its Applications (2020)

    Google Scholar 

Download references

Acknowledgements

This work was supported in part by the National Research Foundation of Korea (NRF) grants funded by the Korea government (MSIT) (No. 2021R1A5A1021944 and No. RS-2023-00251577), and by the NATO Science for Peace and Security Programme project SymSafe (grant number G6133).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Kyungmin Bae .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2024 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Yu, G., Bae, K. (2024). A Flexible Framework for Integrating Maude and SMT Solvers Using Python. In: Ogata, K., Martí-Oliet, N. (eds) Rewriting Logic and Its Applications. WRLA 2024. Lecture Notes in Computer Science, vol 14953. Springer, Cham. https://doi.org/10.1007/978-3-031-65941-6_10

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-65941-6_10

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-65940-9

  • Online ISBN: 978-3-031-65941-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics