Advertisement

Programming and Computer Software

, Volume 45, Issue 8, pp 485–496 | Cite as

On Representation of Simulation Time in Functional Programming Style

  • D. V. BuzdalovEmail author
  • A. K. PetrenkoEmail author
  • A. V. KhoroshilovEmail author
Article
  • 13 Downloads

Abstract

Functional programming is becoming increasingly useful in the modern computerized world. This approach helps create code that is more reliable, easier to reason about, and automatically verifiable. However, these techniques are rarely employed for developing design tools and modeling critical systems. In this work, we try to apply some suitable techniques of functional programming to create a modeling system, namely, a simulation system for analyzing temporal behavioral properties of critical systems. As the first step, we design a representation of simulation time in terms of abstractions used in functional programming and try to investigate its compositionability.

Notes

FUNDING

This work was supported by the Russian Foundation for Basic Research, project no. 17-01-00504.

REFERENCES

  1. 1.
    Buzdalov, D. and Khoroshilov, A., A discrete-event simulator for early validation of avionics systems, Proc. 1st Int. Workshop Architecture Centric Virtual Integration co-located with 17th Int. Conf. Model Driven Engineering Languages and Systems (MoDELS), 2014, vol. 1233.Google Scholar
  2. 2.
    Buzdalov, D., Simulation of AADL models with software-in-the-loop execution, ACM SIGAda Ada Lett., 2016, vol. 36, no. 2, pp. 49–53.CrossRefGoogle Scholar
  3. 3.
    Hughes, J., Why functional programming matters, Chalmers University of Technology, 1984. http://www.cse.chalmers.se/~rjmh/Papers/whyfp.pdf. Accessed December 18, 2018.Google Scholar
  4. 4.
    Jones, S.P., Functional programming languages as a software engineering tool, Lect. Notes Comput. Sci., 1986, vol. 284, pp. 153–173.CrossRefGoogle Scholar
  5. 5.
    Jones, S.P. and Wadler, P., Imperative functional programming, Proc. 20th ACM SIGPLAN-SIGACT Symp. Principles of Programming Languages (POPL), 1993, pp. 71–84.Google Scholar
  6. 6.
    The IO monad for Scala. https://typelevel.org/cats-effect. Accessed December 18, 2018.Google Scholar
  7. 7.
    Monix library, Task monad. https://monix.io/docs/3x/eval/task.html. Accessed December 18, 2018.Google Scholar
  8. 8.
    ZIO, Scala-library for asynchronous and concurrent programming, IO monad. https://scalaz.github.io/scalaz-zio/datatypes/io.html. Accessed December 18, 2018.Google Scholar
  9. 9.
    Moggi, E., Notions of computation and monads, Inf. Comput., 1991, vol. 93, no. 1, pp. 55–92.MathSciNetCrossRefGoogle Scholar
  10. 10.
    Wadler, P., Comprehending monads, Math. Struct. Comput. Sci., 1992, vol. 2, no. 4, pp. 461–493.MathSciNetCrossRefGoogle Scholar
  11. 11.
    McBride, C. and Paterson, R., Applicative programming with effects, J. Funct. Program., 2008, vol. 18, no. 1, pp. 1–13.CrossRefGoogle Scholar
  12. 12.
    Kiselyov, O., Having an effect, Presentation at the Seminar at the Institute of Information Science, Taipei, 2016. http://okmij.org/ftp/Computation/having-effect.html. Accessed December 18, 2018.Google Scholar
  13. 13.
    Guy, L. and Steele, Jr., Building interpreters by composing monads, Proc. 21st ACM SIGPLAN-SIGACT Symp. Principles of Programming Languages (POPL), 1994, pp. 472–492.Google Scholar
  14. 14.
    Liang, S., Hudak, P., and Jonest, M., Monad transformers and modular interpreters, Proc. 22nd ACM SIGPLAN-SIGACT Symp. Principles of Programming Languages (POPL), 1995, pp. 333–343.Google Scholar
  15. 15.
    Kiselyov, O., Sabry, A., and Swords, C., Extensible effects: An alternative to monad transformers, Proc. ACM SIGPLAN Symp. Haskell, 2013, pp. 59–70.Google Scholar
  16. 16.
    Kiselyov, O. and Ishi, H., Freer monads, more extensible effects, Proc. ACM SIGPLAN Symp. Haskell, 2015, pp. 94–105.CrossRefGoogle Scholar
  17. 17.
    Kiselyov, O., Typed tagless final interpreters, Lect. Notes Comput. Sci.e, 2012, vol. 7470, pp. 130–174.CrossRefGoogle Scholar
  18. 18.
    Welsh, N., Uniting Church and State: FP and OO together, Scala Days Conf., Copenhagen, 2017. http://www.youtube.com/watch?v=IO5MD62dQbI. Accessed December 18, 2018.Google Scholar
  19. 19.
    Nizhnikov, O., Modern FP with tagless final, Conf. Joker, St. Petersburg, 2018. http://www.youtube.com/watch?v=sWEtnq0ReZA. Accessed December 18, 2018.Google Scholar
  20. 20.
    Bjarnason, R., Introduction to the Unison programming language, Lambda World Conf., Seattle, 2018. http://www.youtube.com/watch?v=rp_Eild1aq8. Accessed December 18, 2018.Google Scholar
  21. 21.
    Hughes, J., Generalising monads to arrows, Sci. Comput. Program., 2000, vol. 37, nos. 1–3, pp. 67–111.MathSciNetCrossRefGoogle Scholar
  22. 22.
    Hughes, J., Programming with arrows, Advanced Functional Programming, 2004, pp. 73–129.zbMATHGoogle Scholar
  23. 23.
    Lindley, S., Wadler, P., and Yallop, J., Idioms are oblivious, arrows are meticulous, monads are promiscuous, Electron. Notes Theor. Comput. Sci., 2011, vol. 229, no. 5, pp. 97–117.MathSciNetCrossRefGoogle Scholar
  24. 24.
    Polyulya, Y., Functional programming with arrows, Scala Days Conf., Amsterdam, 2015. http://www.youtube.com/watch?v=ZfAgvAIoUEY. Accessed December 18, 2018.Google Scholar
  25. 25.
    Foy, J.D., Do it with (free?) arrows!, Typelevel Summit, Copenhagen, 2017. http://www.youtube.com/watch?v=PWBTOhMemxQ. Accessed December 18, 2018.Google Scholar
  26. 26.
    De Goes, J.A., Blazing fast, pure effects without monads, LambdaConf Conf., Boulder, USA, 2018. http://www.youtube.com/watch?v=L8AEj6IRNEE. Accessed December 18, 2018.Google Scholar
  27. 27.
    Parallel typeclass, cats library. https://typelevel.org/cats/typeclasses/parallel.html. Accessed December 18, 2018.Google Scholar
  28. 28.
    Leontiev, G., There’s a Prolog in your Scala, ScalaIO Conf., Paris, 2014. https://www.youtube.com/watch?v=iYCR2wzfdUs. Accessed December 18, 2018.Google Scholar
  29. 29.
    Troitskiy, A.M. and Buzdalov, D.V., A static approach to estimation of execution time of components in AADL models, Tr. Inst. Sistemnogo Program. Ross. Akad. Nauk (Proc. Inst. Syst. Program. Russ. Acad. Sci.), 2016, vol. 28, no. 2, pp. 157–172.  https://doi.org/10.15514/ISPRAS-2016-28(2)-10 CrossRefGoogle Scholar
  30. 30.
    Amin, N., Rompf, T., and Odersky, M., Foundations of path-dependent types, Proc. ACM Int. Conf. Object-Oriented Programming Systems Languages and Applications, 2014, pp. 233–249.CrossRefGoogle Scholar

Copyright information

© Pleiades Publishing, Ltd. 2019

Authors and Affiliations

  1. 1.Ivannikov Institute for System Programming, Russian Academy of SciencesMoscowRussia
  2. 2.Moscow Institute of Physics and TechnologyDolgoprudnyiRussia
  3. 3.Moscow State UniversityMoscowRussia
  4. 4.National Research University Higher School of EconomicsMoscowRussia

Personalised recommendations