Skip to main content

Type Theory as a Framework for Modelling and Programming

  • Conference paper
  • First Online:
Leveraging Applications of Formal Methods, Verification and Validation. Modeling (ISoLA 2018)

Abstract

In the context provided by the proceedings of the UVMP track of ISoLA 2016, we propose Type Theory as a suitable framework for both modelling and programming. We show that it fits most of the requirements put forward on such frameworks by Broy et al. and discuss some of the objections that can be raised against it.

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.

    We have used the British spelling throughout the document, except in literal quotes.

  2. 2.

    Here, formal is in the OED’s sense 5.a: “Done or made with the forms recognized as ensuring validity; explicit and definite, as opposed to what is matter of tacit understanding”.

References

  1. Altenkirch, T.: Naive type theory (2017). http://www.cs.nott.ac.uk/~psztxa/mgs-17/notes-mgs17.pdf. Lecture Notes for a course at MGS 2017

  2. Bar, K., Kissinger, A., Vicary, J.: Globular: an online proof assistant for higher-dimensional rewriting. Logical Methods Comput. Sci. 14(1) (2018). https://doi.org/10.23638/LMCS-14(1:8)2018. http://arxiv.org/abs/1612.01093

  3. Barendregt, H.P.: Lambda calculi with types. In: Abramsky, S., Gabbay, D.M., Maibaum, S.E. (eds.) Handbook of Logic in Computer Science, vol. 2, pp. 117–309. Oxford University Press Inc., New York (1992). http://dl.acm.org/citation.cfm?id=162552.162561

  4. Berry, G.: Formally unifying modeling and design for embedded systems - a personal view. In: Margaria and Steffen [38], pp. 134–149. https://doi.org/10.1007/978-3-319-47169-3_11

  5. Bishop, E., Bridges, D.: Constructive Analysis. Springer, Heidelberg (1985). https://doi.org/10.1007/978-3-642-61667-9

  6. Botta, N., Jansson, P., Ionescu, C.: Contributions to a computational theory of policy advice and avoidability. J. Funct. Program. 27, 1–52 (2017). https://doi.org/10.1017/S0956796817000156

    Article  MathSciNet  MATH  Google Scholar 

  7. Bourbaki, N.: Éléments de mathématique: Fasc. I. Livre 1, Théorie des ensembles; [5], Fascicule de résultats. Hermann (1964)

    Google Scholar 

  8. Bourbaki, N.: Théorie des ensembles. Springer, Heidelberg (2006). https://doi.org/10.1007/978-3-540-34035-5

    Book  MATH  Google Scholar 

  9. Brady, E.: The IDRIS programming language – implementing embedded domain specific languages with dependent types. In: Central European Functional Programming School - 5th Summer School, CEFP 2013, Cluj-Napoca, Romania, 8 July–20 2013, Revised Selected Papers, pp. 115–186 (2013). https://doi.org/10.1007/978-3-319-15940-9_4

  10. Brady, E.: Type-driven development of concurrent communicating systems. Comput. Sci. 18(3) (2017). https://doi.org/10.7494/csci.2017.18.3.1413. https://journals.agh.edu.pl/csci/article/view/1413

  11. Brady, E., Hammond, K.: Resource-safe systems programming with embedded domain specific languages. In: Russo, C., Zhou, N.F. (eds.) PADL 2012. LNCS, vol. 7149, pp. 242–257. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-27694-1_18

    Chapter  Google Scholar 

  12. Broy, M., Havelund, K., Kumar, R.: Towards a unified view of modeling and programming. In: Margaria and Steffen [38], pp. 238–257. https://doi.org/10.1007/978-3-319-47169-3_17

  13. Chlipala, A.: Ur: Statically-typed metaprogramming with type-level record computation. In: Proceedings of the 31st ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2010, pp. 122–133. ACM, New York (2010). https://doi.org/10.1145/1806596.1806612

  14. Coecke, B., Kissinger, A.: Picturing Quantum Processes: A First Course in Quantum Theory and Diagrammatic Reasoning. Cambridge University Press, Cambridge (2017)

    Book  Google Scholar 

  15. Elaasar, M., Badreddin, O.: Modeling meets programming: a comparative study in model driven engineering action languages. In: Margaria and Steffen [38], pp. 50–67. https://doi.org/10.1007/978-3-319-47169-3_5

  16. Elmqvist, H., Henningsson, T., Otter, M.: Systems modeling and programming in a unified environment based on Julia. In: Margaria and Steffen [38], pp. 198–217. https://doi.org/10.1007/978-3-319-47169-3_15

  17. ForMath project team: Papers and slides from the “formalisation of mathematics” (ForMath) project. http://wiki.portal.chalmers.se/cse/pmwiki.php/ForMath/PapersAndSlides

  18. Fritzson, P.: Principles of Object-oriented Modeling and Simulation with Modelica 2.1. Wiley, Hoboken (2010)

    Google Scholar 

  19. Halmos, P.: Naive Set Theory. Van Nostrand (1960). Reprinted by Springer-Verlag, Undergraduate Texts in Mathematics (1974)

    Google Scholar 

  20. Haxthausen, A.E., Peleska, J.: On the feasibility of a unified modelling and programming paradigm. In: Margaria and Steffen [38], pp. 32–49. https://doi.org/10.1007/978-3-319-47169-3_4

  21. Igried, B., Setzer, A.: Programming with monadic CSP-style processes in dependent type theory. In: Proceedings of the 1st International Workshop on Type-Driven Development, TyDe 2016, pp. 28–38. ACM, New York (2016). https://doi.org/10.1145/2976022.2976032

  22. Ionescu, C.: Vulnerability modelling and monadic dynamical systems. Ph.D. thesis, Freie Universität Berlin (2009)

    Google Scholar 

  23. Ionescu, C.: Vulnerability modelling with functional programming and dependent types. Math. Struct. Comput. Sci. 26(01), 114–128 (2016). https://doi.org/10.1017/S0960129514000139

    Article  MathSciNet  MATH  Google Scholar 

  24. Ionescu, C., Jansson, P.: Domain-specific languages of mathematics: presenting mathematical analysis using functional programming. In: Proceedings of the 4th and 5th International Workshop on Trends in Functional Programming in Education, TFPIE 2016, Sophia-Antipolis, France and University of Maryland College Park, USA, 2nd June 2015 and 7th June 2016, pp. 1–15 (2016). https://doi.org/10.4204/EPTCS.230.1

  25. Jansson, P., Einarsdóttir, S.H., Ionescu, C.: Examples and results from a BSc-level course on domain specific languages of mathematics. In: Proceedings 7th International Workshop on Trends in Functional Programming in Education. EPTCS, Open Publishing Association (2018, in submission). Presented at TFPIE 2018

    Google Scholar 

  26. Jansson, P., Ionescu, C.: Domain specific languages of mathematics: Lecture notes (2018). https://github.com/DSLsofMath/DSLsofMath

  27. Jeffrey, A.: Dependently typed web client applications. In: Sagonas, K. (ed.) Practical Aspects of Declarative Languages (PADL), pp. 228–243. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-45284-0_16

  28. Kugler, H.: Unifying modelling and programming: a systems biology perspective. In: Margaria and Steffen [38], pp. 131–133. https://doi.org/10.1007/978-3-319-47169-3_10

  29. Lamport, L.: How to write a 21st century proof. J. Fixed Point Theor. Appl., November 2011. https://doi.org/10.1007/s11784-012-0071-6. https://www.microsoft.com/en-us/research/publication/write-21st-century-proof/

  30. Landin, P.J.: The next 700 programming languages. Commun. ACM 9(3), 157–166 (1966)

    Article  Google Scholar 

  31. Larsen, P.G., Fitzgerald, J.S., Woodcock, J., Nilsson, R., Gamble, C., Foster, S.: Towards semantically integrated models and tools for cyber-physical systems design. In: Margaria and Steffen [38], pp. 171–186. https://doi.org/10.1007/978-3-319-47169-3_13

  32. Larsen, P.G., et al.: VDM-10 Language Manual. Technical report TR-001, The Overture Initiative, April 2013. www.overturetool.org

  33. Lattmann, Z., Kecskés, T., Meijer, P., Karsai, G., Völgyesi, P., Lédeczi, Á.: Abstractions for modeling complex systems. In: Margaria and Steffen [38], pp. 68–79. https://doi.org/10.1007/978-3-319-47169-3_6

  34. Leavens, G.T., Naumann, D.A., Rajan, H., Aotani, T.: Specifying and verifying advanced control features. In: Margaria and Steffen [38], pp. 80–96. https://doi.org/10.1007/978-3-319-47169-3_7

  35. Leroy, X.: Formal verification of a realistic compiler. Commun. ACM 52(7), 107–115 (2009). https://doi.org/10.1145/1538788.1538814

    Article  Google Scholar 

  36. Lethbridge, T.C., Abdelzad, V., Orabi, M.H., Orabi, A.H., Adesina, O.: Merging modeling and programming using Umple. In: Margaria and Steffen [38], pp. 187–197. https://doi.org/10.1007/978-3-319-47169-3_14

  37. Ludewig, J.: Models in software engineering - an introduction. Softw. Syst. Model 2, 5–14 (2003). https://doi.org/10.1007/s10270-003-0020-3

    Article  Google Scholar 

  38. Margaria, T., Steffen, B. (eds.): ISoLA 2016. LNCS, vol. 9953. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-47169-3

    Book  Google Scholar 

  39. Marlow, S.: Parallel and concurrent programming in Haskell. In: Zsók, V., Horváth, Z., Plasmeijer, R. (eds)Central European Functional Programming School: 4th Summer School. LNCS, vol. 7241, pp. 339–401. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-32096-5_7

  40. MBE Visual Glossary project: Model-based engineering visual glossary (2017). http://modelbasedengineering.com/glossary/

  41. Morgenstern, J., Licata, D.: Security-typed programming within dependently-typed programming. In: International Conference on Functional Programming. ACM (2010). https://doi.org/10.1145/1863543.1863569

  42. Naujokat, S., Neubauer, J., Margaria, T., Steffen, B.: Meta-level reuse for mastering domain specialization. In: Margaria and Steffen [38], pp. 218–237. https://doi.org/10.1007/978-3-319-47169-3_16

  43. Object Management Group (OMG): Unified modeling language. OMG Document Number formal/17-12-05 (2017). https://www.omg.org/spec/UML/2.5.1/

  44. Oury, N., Swierstra, W.: The power of Pi. In: Proceedings of ICFP 2008, pp. 39–50. ACM (2008). https://doi.org/10.1145/1411204.1411213

  45. Pierce, B.C.: Types and Programming Languages, 1st edn. MIT Press, Cambridge (2002)

    MATH  Google Scholar 

  46. Prinz, A., Møller-Pedersen, B., Fischer, J.: Modelling and testing of real systems. In: Margaria and Steffen [38], pp. 119–130. https://doi.org/10.1007/978-3-319-47169-3_9

  47. Protzenko, J., et al.: Verified low-level programming embedded in F*. In: Proceedings of the ACM on Programming Languages 1(ICFP), pp. 17:1–17:29, August 2017. https://doi.org/10.1145/3110261. http://arxiv.org/abs/1703.00053

  48. Rouquette, N.F.: Simplifying OMG MOF-based metamodeling. In: Margaria and Steffen [38], pp. 97–118. https://doi.org/10.1007/978-3-319-47169-3_8

  49. Rybicki, F., Smyth, S., Motika, C., Schulz-Rosengarten, A., von Hanxleden, R.: Interactive model-based compilation continued - incremental hardware synthesis for SCCharts. In: Margaria and Steffen [38], pp. 150–170. https://doi.org/10.1007/978-3-319-47169-3_12

  50. Seidewitz, E.: On a unified view of modeling and programming position paper. In: Margaria and Steffen [38], pp. 27–31. https://doi.org/10.1007/978-3-319-47169-3_3

  51. Selic, B.: Programming \(\subset \) modeling \(\subset \) engineering. In: Margaria and Steffen [38], pp. 11–26. https://doi.org/10.1007/978-3-319-47169-3_2

  52. Swamy, N., Chen, J., Fournet, C., Strub, P.Y., Bhargavan, K., Yang, J.: Secure distributed programming with value-dependent types. Proc. ICFP 2011, 266–278 (2011). https://doi.org/10.1145/2034773.2034811

    Article  MATH  Google Scholar 

  53. Turner, R.: Computable Models. Springer, Heidelberg (2009). https://doi.org/10.1007/978-1-84882-052-4

  54. Wells, C.: Communicating mathematics: useful ideas from computer science. Am. Math. Monthl., 397–408 (1995). https://doi.org/10.2307/2975030

Download references

Acknowledgements

The work presented in this paper heavily relies on free software, among others on Idris, Agda, GHC, git, vi, Emacs, and on the FreeBSD and Debian GNU/Linux operating systems. It is our pleasure to thank all developers of these excellent products. This work was partially supported by the CoeGSS project (grant agreement No. 676547), which has received funding from the European Union’s Horizon 2020 research and innovation programme.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Patrik Jansson .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Ionescu, C., Jansson, P., Botta, N. (2018). Type Theory as a Framework for Modelling and Programming. In: Margaria, T., Steffen, B. (eds) Leveraging Applications of Formal Methods, Verification and Validation. Modeling. ISoLA 2018. Lecture Notes in Computer Science(), vol 11244. Springer, Cham. https://doi.org/10.1007/978-3-030-03418-4_8

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-03418-4_8

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-03417-7

  • Online ISBN: 978-3-030-03418-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics