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.
Similar content being viewed by others
Notes
Webpage of project 17-01-00504 of the Russian Foundation for Basic Research: https://forge.ispras.ru/projects/ductilejur.
REFERENCES
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.
Buzdalov, D., Simulation of AADL models with software-in-the-loop execution, ACM SIGAda Ada Lett., 2016, vol. 36, no. 2, pp. 49–53.
Hughes, J., Why functional programming matters, Chalmers University of Technology, 1984. http://www.cse.chalmers.se/~rjmh/Papers/whyfp.pdf. Accessed December 18, 2018.
Jones, S.P., Functional programming languages as a software engineering tool, Lect. Notes Comput. Sci., 1986, vol. 284, pp. 153–173.
Jones, S.P. and Wadler, P., Imperative functional programming, Proc. 20th ACM SIGPLAN-SIGACT Symp. Principles of Programming Languages (POPL), 1993, pp. 71–84.
The IO monad for Scala. https://typelevel.org/cats-effect. Accessed December 18, 2018.
Monix library, Task monad. https://monix.io/docs/3x/eval/task.html. Accessed December 18, 2018.
ZIO, Scala-library for asynchronous and concurrent programming, IO monad. https://scalaz.github.io/scalaz-zio/datatypes/io.html. Accessed December 18, 2018.
Moggi, E., Notions of computation and monads, Inf. Comput., 1991, vol. 93, no. 1, pp. 55–92.
Wadler, P., Comprehending monads, Math. Struct. Comput. Sci., 1992, vol. 2, no. 4, pp. 461–493.
McBride, C. and Paterson, R., Applicative programming with effects, J. Funct. Program., 2008, vol. 18, no. 1, pp. 1–13.
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.
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.
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.
Kiselyov, O., Sabry, A., and Swords, C., Extensible effects: An alternative to monad transformers, Proc. ACM SIGPLAN Symp. Haskell, 2013, pp. 59–70.
Kiselyov, O. and Ishi, H., Freer monads, more extensible effects, Proc. ACM SIGPLAN Symp. Haskell, 2015, pp. 94–105.
Kiselyov, O., Typed tagless final interpreters, Lect. Notes Comput. Sci.e, 2012, vol. 7470, pp. 130–174.
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.
Nizhnikov, O., Modern FP with tagless final, Conf. Joker, St. Petersburg, 2018. http://www.youtube.com/watch?v=sWEtnq0ReZA. Accessed December 18, 2018.
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.
Hughes, J., Generalising monads to arrows, Sci. Comput. Program., 2000, vol. 37, nos. 1–3, pp. 67–111.
Hughes, J., Programming with arrows, Advanced Functional Programming, 2004, pp. 73–129.
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.
Polyulya, Y., Functional programming with arrows, Scala Days Conf., Amsterdam, 2015. http://www.youtube.com/watch?v=ZfAgvAIoUEY. Accessed December 18, 2018.
Foy, J.D., Do it with (free?) arrows!, Typelevel Summit, Copenhagen, 2017. http://www.youtube.com/watch?v=PWBTOhMemxQ. Accessed December 18, 2018.
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.
Parallel typeclass, cats library. https://typelevel.org/cats/typeclasses/parallel.html. Accessed December 18, 2018.
Leontiev, G., There’s a Prolog in your Scala, ScalaIO Conf., Paris, 2014. https://www.youtube.com/watch?v=iYCR2wzfdUs. Accessed December 18, 2018.
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
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.
Funding
This work was supported by the Russian Foundation for Basic Research, project no. 17-01-00504.
Author information
Authors and Affiliations
Corresponding authors
Additional information
Translated by Yu. Kornienko
Rights and permissions
About this article
Cite this article
Buzdalov, D.V., Petrenko, A.K. & Khoroshilov, A.V. On Representation of Simulation Time in Functional Programming Style. Program Comput Soft 45, 485–496 (2019). https://doi.org/10.1134/S0361768819080073
Received:
Revised:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1134/S0361768819080073