Skip to main content

Generation of a Reversible Semantics for Erlang in Maude

  • Conference paper
  • First Online:
Formal Methods and Software Engineering (ICFEM 2022)

Abstract

In recent years, reversibility in concurrent settings has attracted interest thanks to its diverse applications in areas such as error recovery, debugging, and biological modeling. Also, it has been studied in many formalisms, including Petri nets, process algebras, and programming languages like Erlang. However, most attempts made so far suffer from the same limitation: they define the reversible semantics in an ad-hoc fashion. To address this limit, Lanese et al. have recently proposed a novel general method to derive a concurrent reversible semantics from a non-reversible one. However, in most interesting instances the method relies on infinite sets of reductions, making doubtful its practical applicability. We bridge the gap between theory and practice by implementing the above method in Maude. The key insight is that infinite sets of reductions can be captured by a small number of schemas in many relevant cases. This happens indeed for our application: the functional and concurrent fragment of Erlang. We extend the framework with a general rollback operator, allowing one to undo an action far in the past, including all and only its consequences. We can thus use our tool, e.g., as an oracle against which to test the reversible debugger CauDEr for Erlang, or as an executable specification for new reversible debuggers.

The work has been partially supported by French ANR project DCore ANR-18-CE25-0007. We thank the anonymous referees for their helpful comments and suggestions. We also thank Roberto Bruni for the useful comments and discussions provided. The second author also thanks INdAM-GNCS Project CUP_E55F22000270001 “Proprietà qualitative e quantitative di sistemi reversibili”.

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.

    In truth, \(\theta \) is a stack of environments, such design choice is discussed in Sect. 3.2.

  2. 2.

    Technicalities have been omitted, we refer to [22] for further details.

References

  1. Carlsson, R.: An introduction to core erlang. In: Erlang Workshop (2001)

    Google Scholar 

  2. Cristescu, I., Krivine, J., Varacca, D.: A compositional semantics for the reversible \(\pi \)-calculus. In: LICS, pp. 388–397 (2013)

    Google Scholar 

  3. Danos, V., Krivine, J.: Reversible communicating systems. In: Gardner, P., Yoshida, N. (eds.) CONCUR 2004. LNCS, vol. 3170, pp. 292–307. Springer, Heidelberg (2004). https://doi.org/10.1007/978-3-540-28644-8_19

    Chapter  Google Scholar 

  4. Danos, V., Krivine, J.: Formal molecular biology done in CCS-R. LNCS 180(3), 31–49 (2007)

    Google Scholar 

  5. Fabbretti, G., Lanese, I., Stefani, J.-B.: Causal-consistent debugging of distributed erlang programs. In: Yamashita, S., Yokoyama, T. (eds.) RC 2021. LNCS, vol. 12805, pp. 79–95. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-79837-6_5

    Chapter  Google Scholar 

  6. Fabbretti, G., Lanese, I., Stefani, JB.: Generation of a reversible semantics for Erlang in Maude. Research Report RR-9468, Inria (2022)

    Google Scholar 

  7. Giachino, E., Lanese, I., Mezzina, C.A.: Causal-consistent reversible debugging. In: Gnesi, S., Rensink, A. (eds.) FASE 2014. LNCS, vol. 8411, pp. 370–384. Springer, Heidelberg (2014). https://doi.org/10.1007/978-3-642-54804-8_26

    Chapter  Google Scholar 

  8. Giachino, E., Lanese, I., Mezzina, C.A., Tiezzi, F.: Causal-consistent rollback in a tuple-based language. J. Log. Algebraic Methods Program. 88, 99–120 (2017)

    Article  MATH  Google Scholar 

  9. González-Abril, J.J., Vidal, G.: Causal-consistent reversible debugging: improving CauDEr. In: Morales, J.F., Orchard, D. (eds.) PADL 2021. LNCS, vol. 12548, pp. 145–160. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-67438-0_9

    Chapter  Google Scholar 

  10. Hewitt, C., Bishop, P., Steiger, R.: A universal modular actor formalism for artificial intelligence. In: IJCAI 1973 (1973)

    Google Scholar 

  11. Kőszegi, J.: KErl: Executable semantics for erlang. In: CEUR Workshop Proceedings, vol. 2046, pp. 144–166 (2018)

    Google Scholar 

  12. Lami, P., Lanese, I., Stefani, J., Coen, C.S., Fabbretti, G.: Reversibility in erlang: imperative constructs. In: Mezzina, C.A., Podlaski, K. (eds.) RC 2022. LNCS, vol. 13354, pp. 187–203. Springer, Cham (2022). https://doi.org/10.1007/978-3-031-09005-9_13

    Chapter  Google Scholar 

  13. Lanese, I.: From reversible semantics to reversible debugging. In: Kari, J., Ulidowski, I. (eds.) RC 2018. LNCS, vol. 11106, pp. 34–46. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-99498-7_2

    Chapter  MATH  Google Scholar 

  14. Lanese, I., Medic, D.: A general approach to derive uncontrolled reversible semantics. In: CONCUR, vol. 171, pp. 33:1–33:24 (2020)

    Google Scholar 

  15. Lanese, I., Mezzina, C.A., Schmitt, A., Stefani, J.-B.: Controlling reversibility in higher-order Pi. In: Katoen, J.-P., König, B. (eds.) CONCUR 2011. LNCS, vol. 6901, pp. 297–311. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-23217-6_20

    Chapter  Google Scholar 

  16. Lanese, I., Mezzina, C.A., Stefani, J.-B.: Controlled reversibility and compensations. In: Glück, R., Yokoyama, T. (eds.) RC 2012. LNCS, vol. 7581, pp. 233–240. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-36315-3_19

    Chapter  Google Scholar 

  17. Lanese, I., Mezzina, C.A., Stefani, J.: Reversibility in the higher-order \(\pi \)-calculus. Theor. Comput. Sci. 625, 25–84 (2016)

    Article  MATH  Google Scholar 

  18. Lanese, I., Nishida, N., Palacios, A., Vidal, G.: CauDEr website (2018). https://github.com/mistupv/cauder-v2

  19. Lanese, I., Nishida, N., Palacios, A., Vidal, G.: A theory of reversibility for Erlang. J. Log. Algebraic Methods Program. 100, 71–97 (2018)

    Article  MATH  Google Scholar 

  20. Lanese, I., Schultz, U.P., Ulidowski, I.: Reversible computing in debugging of Erlang programs. IT Prof. 24(1), 74–80 (2022)

    Article  Google Scholar 

  21. Laursen, J.S., Schultz, U.P., Ellekilde, L.-P.: Automatic error recovery in robot assembly operations using reverse execution. In: IROS, pp. 1785–1792 (2015)

    Google Scholar 

  22. All about maude (2007)

    Google Scholar 

  23. Melgratti, H.C., Mezzina, C.A., Ulidowski, I.: Reversing place transition nets. Log. Methods Comput. Sci. 16(4) (2020)

    Google Scholar 

  24. Meseguer, J.: Rewriting logic as a semantic framework for concurrency: a progress report. In: Montanari, U., Sassone, V. (eds.) CONCUR 1996. LNCS, vol. 1119, pp. 331–372. Springer, Heidelberg (1996). https://doi.org/10.1007/3-540-61604-7_64

    Chapter  Google Scholar 

  25. Neuhäußer, M., Noll, T.: Abstraction and model checking of Core Erlang programs in Maude. ENTCS 176(4), 147–163 (2007)

    MATH  Google Scholar 

  26. Perumalla, K.S., Park, A.J.: Reverse computation for rollback-based fault tolerance in large parallel systems: evaluating the potential gains and systems effects. Clust. Comput. 17(2), 303–313 (2014)

    Article  Google Scholar 

  27. Philippou, A., Psara, K.: Reversible computation in petri nets. In: Kari, J., Ulidowski, I. (eds.) RC 2018. LNCS, vol. 11106, pp. 84–101. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-99498-7_6

    Chapter  MATH  Google Scholar 

  28. Phillips, I.C.C., Ulidowski, I.: Reversing algebraic process calculi. J. Log. Algebraic Methods Program. 73(1–2), 70–96 (2007)

    Article  MATH  Google Scholar 

  29. Automatic generation of reversible semantics in Maude. https://bit.ly/3RQgGsu

  30. Svensson, H., Fredlund, L., Earle, C.B.: A unified semantics for future Erlang. In: ACM SIGPLAN Workshop on Erlang, pp. 23–32. ACM (2010)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding authors

Correspondence to Giovanni Fabbretti , Ivan Lanese or Jean-Bernard Stefani .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2022 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Fabbretti, G., Lanese, I., Stefani, JB. (2022). Generation of a Reversible Semantics for Erlang in Maude. In: Riesco, A., Zhang, M. (eds) Formal Methods and Software Engineering. ICFEM 2022. Lecture Notes in Computer Science, vol 13478. Springer, Cham. https://doi.org/10.1007/978-3-031-17244-1_7

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-17244-1_7

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-17243-4

  • Online ISBN: 978-3-031-17244-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics