Abstract
Computer simulations are essential in virtually every scientific discipline, even more so in those such as economics or climate change where the ability to make laboratory experiments is limited. Therefore, it is important to ensure that the models are implemented correctly, that they can be re-implemented and that the results can be reproduced. Typically, though, the models are described by a mixture of prose and mathematics which is insufficient for these purposes. We argue that using dependent types allows us to gradually reduce the gap between the mathematical description and the implementation, and we give examples from economic modelling. We discuss the consequences that our incremental approach has on programming style and the requirements it imposes on the dependently-typed programming languages used.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
And explore environments that could assist them in this task, such as Coq.
References
Agda wiki page. http://wiki.portal.chalmers.se/agda/
Formalisation of Mathematics. http://wiki.portal.chalmers.se/cse/pmwiki.php/ForMath/ForMath
GEM-E3 Website. http://www.gem-e3.net/
ReMIND-R. http://www.pik-potsdam.de/research/sustainable-solutions/models/remind
Bellman, R.E.: Dynamic Programming. Princeton University Press, Princeton (1957)
Bertsekas, D.P.: Dynamic Programming and Optimal Control, 2nd edn. Athena Scientific, Belmont (2000)
Brady, E., Hammond, K.: Correct-by-construction concurrency: using dependent types to verify implementations of effectful resource usage protocol. Fundamenta Informaticae 102, 145–176 (2010)
Dijkstra, E.W.: A constructive approach to the problem of program correctness. BIT Numer. Math. 8(3), 174–186 (1968)
Evensen, P., Märdin, M.: An extensible and scalable agent-based simulation of barter economics. Master’s thesis 2009/04a, Chalmers University of Technology and University of Gothenburg (2009)
Gintis, H.: The emergence of a price system from decentralized bilateral exchange. B.E. J. Theor. Econ. 6(1), 13 (2006)
Kreinovich, V.: Designing, understanding, and analyzing unconventional computation: the important role of logic and constructive mathematics. Appl. Math. Sci. 6(13–16), 645–649 (2012)
Martin-Löf, P.: Constructive mathematics and computer programming. Philos. Trans. R. Soc. Lond. 312(1522), 501–518 (1984)
McBride, C.: Dependently typed programming. http://www.cs.uoregon.edu/Research/summerschool/summer10/curriculum.htm
Mu, S.-C., Ko, H.-S., Jansson, P.: Algebra of programming in Agda: dependent types for relational program derivation. J. Funct. Program. 19, 545–579 (2009)
Nordström, B., Petersson, K., Smith, J.: Programming in Martin-Löf’s Type Theory. Oxford University Press, Oxford (1990)
Nordström, B., Petersson, K., Smith, J.: Martin-Löf type theory. In: Handbook of Logic in Computer Science, vol. 5, pp. 1–37. Oxford University Press, Oxford (2000)
Nordström, B., Smith, J.: Propositions and specifications of programs in Martin-Löf’s type theory. BIT Numer. Math. 24, 288–301 (1984)
Suppes, P.: Introduction to Logic. Dover Books on Mathematics Series. Dover, New York (1999). (Reprint of the 1957 edition from Van Nostrand)
Swierstra, W.: A Hoare logic for the state monad. In: Berghofer, S., Nipkow, T., Urban, C., Wenzel, M. (eds.) TPHOLs 2009. LNCS, vol. 5674, pp. 440–451. Springer, Heidelberg (2009)
Thompson, S.: Type Theory and Functional Programming. Addison-Wesley, Redwood (1991)
Thompson, S.: Are subsets necessary in Martin-Löf type theory? In: Myers Jr, J.P., O’Donnell, M.J. (eds.) Constructivity in CS 1991. LNCS, vol. 613. Springer, Heidelberg (1992)
Turner, R.: Computable Models. Springer, London (2009)
Varian, H.R.: Microeconomic Analysis. Norton, New York (1992)
Velupillai, K.: Computable Economics: The Arne Ryde Memorial Lectures. Oxford University Press, Oxford (2000)
Velupillai, K.V.: Algorithmic foundations of computable general equilibrium theory. Appl. Math. Comput. 179, 360–369 (2006)
Velupillai, K.V.: Taming the incomputable, reconstructing the nonconstructive and deciding the undecidable in mathematical economics. New Math. Nat. Comput. (NMNC) 8(01), 5–51 (2012)
Walras, L.: Elements of Pure Economics: Or the Theory of Social Wealth. Routledge Library Editions-Economics. Taylor & Francis Group, London (1954)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2013 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Ionescu, C., Jansson, P. (2013). Dependently-Typed Programming in Scientific Computing. In: Hinze, R. (eds) Implementation and Application of Functional Languages. IFL 2012. Lecture Notes in Computer Science(), vol 8241. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-41582-1_9
Download citation
DOI: https://doi.org/10.1007/978-3-642-41582-1_9
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-41581-4
Online ISBN: 978-3-642-41582-1
eBook Packages: Computer ScienceComputer Science (R0)