Algebra of Programming Using Dependent Types

  • Shin-Cheng Mu
  • Hsiang-Shang Ko
  • Patrik Jansson
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5133)

Abstract

Dependent type theory is rich enough to express that a program satisfies an input/output relational specification, but it could be hard to construct the proof term. On the other hand, squiggolists know very well how to show that one relation is included in another by algebraic reasoning. We demonstrate how to encode functional and relational derivations in a dependently typed programming language. A program is coupled with an algebraic derivation from a specification, whose correctness is guaranteed by the type system.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Altenkirch, T., McBride, C., McKinna, J.: Why dependent types matter. Draft (2005)Google Scholar
  2. 2.
    Augustsson, L.: Cayenne – a language with dependent types. In: ICFP 1998, pp. 239–250 (1998)Google Scholar
  3. 3.
    Augustsson, L.: Equality proofs in Cayenne. Chalmers Univ. of Tech. (1999)Google Scholar
  4. 4.
    Backhouse, R.C., et al.: Relational catamorphisms. In: IFIP TC2/WG2.1 Working Conference on Constructing Programs, pp. 287–318. Elsevier, Amsterdam (1991)Google Scholar
  5. 5.
    Backhouse, R.C., Hoogendijk, P.F.: Elements of a relational theory of datatypes. In: Möller, B., Schuman, S., Partsch, H. (eds.) Formal Program Development. LNCS, vol. 755, pp. 7–42. Springer, Heidelberg (1993)Google Scholar
  6. 6.
    Bird, R.S.: Algebraic identities for program calculation. Computer Journal 32(2), 122–126 (1989)CrossRefMathSciNetGoogle Scholar
  7. 7.
    Bird, R.S.: Functional algorithm design. Science of Computer Programming 26, 15–31 (1996)MATHCrossRefMathSciNetGoogle Scholar
  8. 8.
    Bird, R.S., de Moor, O.: Algebra of Programming. International Series in Computer Science. Prentice-Hall, Englewood Cliffs (1997)MATHGoogle Scholar
  9. 9.
    Cheney, J., Hinze, R.: First-class phantom types. Technical Report TR2003-1901, Cornell University (2003)Google Scholar
  10. 10.
    The Coq Development Team, LogiCal Project. The Coq Proof Assistant Reference Manual (2006)Google Scholar
  11. 11.
    de Moor, O., Sittampalam, G.: Higher-order matching for program transformation. Theoretical Computer Science 269(1-2), 135–162 (2001)MATHCrossRefMathSciNetGoogle Scholar
  12. 12.
    Dybjer, P.: Inductive families. Formal Aspects of Computing, 440–465 (1994)Google Scholar
  13. 13.
    Gonzalía, C.: Relations in Dependent Type Theory. PhD thesis, Chalmers Univ. of Tech. (2006)Google Scholar
  14. 14.
    McBride, C., McKinna, J.: The view from the left. Journal of Functional Programming 14(1), 69–111 (2004)MATHCrossRefMathSciNetGoogle Scholar
  15. 15.
    McKinna, J., Burstall, R.M.: Deliverables: A categorial approach to program development in type theory. In: Borzyszkowski, A.M., Sokolowski, S. (eds.) MFCS 1993. LNCS, vol. 711, pp. 32–67. Springer, Heidelberg (1993)Google Scholar
  16. 16.
    Mu, S.-C., Ko, H.-S., Jansson, P.: AoPA: Algebra of programming in Agda, http://www.iis.sinica.edu.tw/~scm/2008/aopa/
  17. 17.
    Norell, U.: Towards a Practical Programming Language Based on Dependent Type Theory. PhD thesis, Chalmers Univ. of Tech. (2007)Google Scholar
  18. 18.
    Paulin-Mohring, C.: Extracting F ω’s programs from proofs in the Calculus of Constructions. In: POPL 1989, Austin. ACM Press, New York (1989)Google Scholar
  19. 19.
    Sheard, T.: Programming in Ωmega. The 2nd Central European Functional Programming School (June 2007)Google Scholar
  20. 20.
    Sweeney, T.: The next mainstream programming language: a game developer’s perspective. In: POPL 2006 (January 2006) (invited talk)Google Scholar
  21. 21.
    The Agda Team. The Agda Wiki (2007), http://www.cs.chalmers.se/~ulfn/Agda/
  22. 22.
    Verhoeven, R., Backhouse, R.C.: Towards tool support for program verification and construction. In: World Congress on Formal Methods, pp. 1128–1146 (1999)Google Scholar
  23. 23.
    Xi, H.: Dependent ML: an approach to practical programming with dependent types. Journal of Functional Programming 17(2), 215–286 (2007)MATHCrossRefGoogle Scholar
  24. 24.
    Yokoyama, T., Hu, Z., Takeichi, M.: Yicho - a system for programming program calculations. In: The 3rd Asian Workshop on Programming Languages and Systems (APLAS 2002), pp. 366–382 (2002)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2008

Authors and Affiliations

  • Shin-Cheng Mu
    • 1
  • Hsiang-Shang Ko
    • 2
  • Patrik Jansson
    • 3
  1. 1.Institute of Information ScienceAcademia SinicaTaiwan
  2. 2.Department of Computer Science and Information EngineeringNational Taiwan UniversityTaiwan
  3. 3.Department of Computer Science and EngineeringChalmers University of Technology & University of GothenburgSweden

Personalised recommendations