skip to main content
research-article

Abstraction and invariance for algebraically indexed types

Published:23 January 2013Publication History
Skip Abstract Section

Abstract

Reynolds' relational parametricity provides a powerful way to reason about programs in terms of invariance under changes of data representation. A dazzling array of applications of Reynolds' theory exists, exploiting invariance to yield "free theorems", non-inhabitation results, and encodings of algebraic datatypes. Outside computer science, invariance is a common theme running through many areas of mathematics and physics. For example, the area of a triangle is unaltered by rotation or flipping. If we scale a triangle, then we scale its area, maintaining an invariant relationship between the two. The transformations under which properties are invariant are often organised into groups, with the algebraic structure reflecting the composability and invertibility of transformations.

In this paper, we investigate programming languages whose types are indexed by algebraic structures such as groups of geometric transformations. Other examples include types indexed by principals--for information flow security--and types indexed by distances--for analysis of analytic uniform continuity properties. Following Reynolds, we prove a general Abstraction Theorem that covers all these instances. Consequences of our Abstraction Theorem include free theorems expressing invariance properties of programs, type isomorphisms based on invariance properties, and non-definability results indicating when certain algebraically indexed types are uninhabited or only inhabited by trivial programs. We have fully formalised our framework and most examples in Coq.

Skip Supplemental Material Section

Supplemental Material

r1d1_talk8.mp4

References

  1. M. Abadi, A. Banerjee, N. Heintze, and J. G. Riecke. A Core Calculusof Dependency. Proceedings, POPL, pp.147--160, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. R. Atkey. Syntax for Free: Representing Syntax with Binding UsingParametricity. Proceedings, TLCA,pp. 35--49, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. N. Benton, C.-K. Hur, A. J. Kennedy, C. McBride.Strongly Typed Term Representations in Coq. Journal of Automated Reasoning 49(2), pp. 141--159, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. N. Benton, A. Kennedy, M. Hofmann, L. Beringer.Reading, Writing and Relations.Proceedings, APLAS,pp. 114--130, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. J.-P. Bernardy, P. Jansson, R. Paterson.Proofs for Free: Parametricity for Dependent Types. Journal of Functional Programming 22(2), pp. 107--152, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. L. Cardelli, P. Gardner.Processes in Space. Programs, Proofs, Processes: Proceedings, CiE, pp. 78--87, %LNCS vol. 6158, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Computational Geometry Algorithms Library (CGAL): User and ReferenceManual. Available at http://www.cgal.org.Google ScholarGoogle Scholar
  8. S. Chaudhuri, S. Gulwani, and R. Lublinerman. Continuity Analysis ofPrograms. Proceedings, POPL, pp. 57--70, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. J. Gallier. Geometric Methods and Applications For ComputerScience and Engineering. Springer, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. J. Harrison.Without Loss of Generality.Proceedings, TPHOLs,pp. 43--59, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. M. Hofmann. Correctness of Effect-based ProgramTransformations. Formal Logical Methods for System Security andCorrectness, pp. 149--173, 2008.Google ScholarGoogle Scholar
  12. M. P. Jones. Functional Programming with Overloading and Higher-OrderPolymorphism. Proceedings, AFP,pp. 97--136, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. A. J. Kennedy. Relational Parametricity and Units of Measure.Proceedings, POPL, pp. 442--455, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. A. J. Kennedy. Types for Units-of-Measure: Theory and Practice.Central European Functional Programming school (CEFP), pp. 268--305, LNCS vol. 6299, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. S. Mann, N. Litke, T. DeRose. A Coordinate Free Geometry ADT.Technical Report CS-97--15, University of Waterloo, 1997.Google ScholarGoogle Scholar
  16. A. M. Pitts. Parametric Polymorphism and Operational Equivalence. Mathematical Structures in Computer Science 10(3), pp. 321--359,2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. J. Reed and B. C. Pierce. Distance Makes the Types Grow Stronger.Proceedings, ICFP, pp. 157--169, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. J. C. Reynolds. Types, Abstraction and Parametric Polymorphism. Information Processing 83, pp. 513--523, 1983.Google ScholarGoogle Scholar
  19. A. Sabelfeld and D. Sands. A PER Model of Secure Information Flow inSequential Programs. Higher-Order and Symbolic Computation 14(1), pp. 59--91, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. N. Shikuma and A.Igarahsi. Proving Noninterference by a FullyComplete Translation to the Simply Typed lambda-calculus. Logical Methods in Computer Science 4(3), 2008.Google ScholarGoogle Scholar
  21. S. Tse and S. Zdancewic. Translating Dependency into Parametricity.Proceedings, ICFP, pp.115--125, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. P. Wadler. Theorems for Free!. Proceedings, FPCA,pp. 347--359, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Abstraction and invariance for algebraically indexed types

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!