skip to main content
10.1145/1111037.1111056acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
Article

Fast and loose reasoning is morally correct

Published:11 January 2006Publication History

ABSTRACT

Functional programmers often reason about programs as if they were written in a total language, expecting the results to carry over to non-total (partial) languages. We justify such reasoning.Two languages are defined, one total and one partial, with identical syntax. The semantics of the partial language includes partial and infinite values, and all types are lifted, including the function spaces. A partial equivalence relation (PER) is then defined, the domain of which is the total subset of the partial language. For types not containing function spaces the PER relates equal values, and functions are related if they map related values to related values.It is proved that if two closed terms have the same semantics in the total language, then they have related semantics in the partial language. It is also shown that the PER gives rise to a bicartesian closed category which can be used to reason about values in the domain of the relation.

References

  1. Michael Abbott, Thorsten Altenkirch, and Neil Ghani. Containers: Constructing strictly positive types. Theoretical Computer Science, 342(1):3--27, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Peter Aczel. The strength of Martin-Löf's intuitionistic type theory with one universe. In Proceedings of Symposia in Mathematical Logic, Oulu, 1974, and Helsinki, 1975, pages 1--32, University of Helsinki, Department of Philosophy, 1977.Google ScholarGoogle Scholar
  3. Marek A. Bednarczyk and Andrzej M. Borzyszkowski. Cpo's do not form a cpo and yet recursion works. In VDM '91, volume 551 of LNCS, pages 268--278. Springer-Verlag, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. R.C. Backhouse, P.J. de Bruin, P. Hoogendijk, G. Malcolm, T.S. Voermans, and J.C.S.P. van~der Woude. Relational catamorphisms. In Constructing Programs from Specifications, pages 287--318. North-Holland, 1991.Google ScholarGoogle Scholar
  5. Richard Bird and Oege de Moor. Algebra of Programming. Prentice Hall, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. M. Beeson. Recursive models for constructive set theories. Annals of Mathematical Logic, 23:127--178, 1982.Google ScholarGoogle ScholarCross RefCross Ref
  7. Andrzej Blikle. MetaSoft Primer, Towards a Metalanguage for Applied Denotational Semantics, volume 288 of LNCS. Springer-Verlag, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Andrzej Blikle and Andrzej Tarlecki. Naive denotational semantics. In Information Processing 83, pages 345--355. North-Holland, 1983.Google ScholarGoogle Scholar
  9. Nils Anders Danielsson. Personal web page, available at http://www.cs.chalmers.se/~nad/, 2005.Google ScholarGoogle Scholar
  10. Edsger W. Dijkstra. A Discipline of Programming. Prentice Hall, 1976. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Nils Anders Danielsson and Patrik Jansson. Chasing bottoms, a case study in program verification in the presence of partial and infinite values. In MPC 2004, volume 3125 of LNCS, pages 85--109. Springer-Verlag, 2004.Google ScholarGoogle Scholar
  12. Peter Dybjer. Program verification in a logical theory of constructions. In FPCA'85, volume 201 of LNCS, pages 334--349. Springer-Verlag, 1985. Appears in revised form as Programming Methodology Group Report 26, University of Göteborg and Chalmers University of Technology, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Peter Dybjer. Representing inductively defined sets by wellorderings in Martin-Löf's type theory. Theoretical Computer Science, 176:329--335, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Maarten M Fokkinga and Erik Meijer. Program calculation properties of continuous algebras. Technical Report CS-R9104, Centre for Mathematics and Computer Science, Amsterdam, The Netherlands, 1991.Google ScholarGoogle Scholar
  15. Harvey Friedman. Equality between functionals. In Logic Colloquium: Symposium on Logic held at Boston, 1972-73, number 453 in Lecture Notes in Mathematics, pages 22--37. Springer, 1975.Google ScholarGoogle Scholar
  16. Lars Hallnäs. An intensional characterization of the largest bisimulation. Theoretical Computer Science, 53(2--3):335--343, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Graham Hutton and Jeremy Gibbons. The generic approximation lemma. Information Processing Letters, 79(4):197--201, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Hagen Huwig and Axel Poigné. A note on inconsistencies caused by fixpoints in a cartesian closed category. Theoretical Computer Science, 73(1):101--112, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. J. Jeuring. Algorithms from theorems. In Programming Concepts and Methods, pages 247--266. North-Holland, 1990.Google ScholarGoogle Scholar
  20. Patricia Johann and Janis Voigtländer. Free theorems in the presence of seq. In POPL'04, pages 99--110. ACM Press, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. E. Meijer, M. Fokkinga, and R. Paterson. Functional programming with bananas, lenses, envelopes and barbed wire. In FPCA'91, volume 523 of LNCS, pages 124--144. Springer-Verlag, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Robin Milner, Mads Tofte, Robert Harper, and David MacQueen. The Definition of Standard ML (Revised). MIT Press, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Simon Peyton Jones, editor. Haskell 98 Language and Libraries, The Revised Report. Cambridge University Press, 2003.Google ScholarGoogle Scholar
  24. Hilary A. Priestley. Ordered sets and complete lattices, a primer for computer science. In Algebraic and Coalgebraic Methods in the Mathematics of Program Construction, volume 2297 of LNCS, chapter~2, pages 21--78. Springer-Verlag, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. John C. Reynolds. Types, abstraction and parametric polymorphism. In Information Processing 83, pages 513--523. Elsevier, 1983.Google ScholarGoogle Scholar
  26. John C. Reynolds. Polymorphism is not set-theoretic. In Semantics of Data Types, volume 173 of LNCS, pages 145--156. Springer-Verlag, 1984.Google ScholarGoogle ScholarCross RefCross Ref
  27. Dana Scott. Data types as lattices. SIAM Journal of Computing, 5(3):522--587, 1976.Google ScholarGoogle ScholarCross RefCross Ref
  28. Jan Smith. An interpretation of Martin-Löf's type theory in a type-free theory of propositions. Journal of Symbolic Logic, 49(3):730--753, 1984.Google ScholarGoogle ScholarCross RefCross Ref
  29. David Turner. Elementary strong functional programming. In FPLE'95, volume 1022 of LNCS, pages 1--13. Springer-Verlag, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Philip Wadler. Theorems for free! In FPCA'89, pages 347--359. ACM Press, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Fast and loose reasoning is morally correct

        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
        • Published in

          cover image ACM Conferences
          POPL '06: Conference record of the 33rd ACM SIGPLAN-SIGACT symposium on Principles of programming languages
          January 2006
          432 pages
          ISBN:1595930272
          DOI:10.1145/1111037
          • cover image ACM SIGPLAN Notices
            ACM SIGPLAN Notices  Volume 41, Issue 1
            Proceedings of the 2006 POPL Conference
            January 2006
            421 pages
            ISSN:0362-1340
            EISSN:1558-1160
            DOI:10.1145/1111320
            Issue’s Table of Contents

          Copyright © 2006 ACM

          Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 11 January 2006

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • Article

          Acceptance Rates

          Overall Acceptance Rate824of4,130submissions,20%

          Upcoming Conference

          POPL '25

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader