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

Fast and loose reasoning is morally correct

Published: 11 January 2006 Publication 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.
[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.
[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.
[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.
[5]
Richard Bird and Oege de Moor. Algebra of Programming. Prentice Hall, 1996.
[6]
M. Beeson. Recursive models for constructive set theories. Annals of Mathematical Logic, 23:127--178, 1982.
[7]
Andrzej Blikle. MetaSoft Primer, Towards a Metalanguage for Applied Denotational Semantics, volume 288 of LNCS. Springer-Verlag, 1987.
[8]
Andrzej Blikle and Andrzej Tarlecki. Naive denotational semantics. In Information Processing 83, pages 345--355. North-Holland, 1983.
[9]
Nils Anders Danielsson. Personal web page, available at http://www.cs.chalmers.se/~nad/, 2005.
[10]
Edsger W. Dijkstra. A Discipline of Programming. Prentice Hall, 1976.
[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.
[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.
[13]
Peter Dybjer. Representing inductively defined sets by wellorderings in Martin-Löf's type theory. Theoretical Computer Science, 176:329--335, 1997.
[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.
[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.
[16]
Lars Hallnäs. An intensional characterization of the largest bisimulation. Theoretical Computer Science, 53(2--3):335--343, 1987.
[17]
Graham Hutton and Jeremy Gibbons. The generic approximation lemma. Information Processing Letters, 79(4):197--201, 2001.
[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.
[19]
J. Jeuring. Algorithms from theorems. In Programming Concepts and Methods, pages 247--266. North-Holland, 1990.
[20]
Patricia Johann and Janis Voigtländer. Free theorems in the presence of seq. In POPL'04, pages 99--110. ACM Press, 2004.
[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.
[22]
Robin Milner, Mads Tofte, Robert Harper, and David MacQueen. The Definition of Standard ML (Revised). MIT Press, 1997.
[23]
Simon Peyton Jones, editor. Haskell 98 Language and Libraries, The Revised Report. Cambridge University Press, 2003.
[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.
[25]
John C. Reynolds. Types, abstraction and parametric polymorphism. In Information Processing 83, pages 513--523. Elsevier, 1983.
[26]
John C. Reynolds. Polymorphism is not set-theoretic. In Semantics of Data Types, volume 173 of LNCS, pages 145--156. Springer-Verlag, 1984.
[27]
Dana Scott. Data types as lattices. SIAM Journal of Computing, 5(3):522--587, 1976.
[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.
[29]
David Turner. Elementary strong functional programming. In FPLE'95, volume 1022 of LNCS, pages 1--13. Springer-Verlag, 1996.
[30]
Philip Wadler. Theorems for free! In FPCA'89, pages 347--359. ACM Press, 1989.

Cited By

View all
  • (2024)A Cartesian Closed Category for Random VariablesProceedings of the 39th Annual ACM/IEEE Symposium on Logic in Computer Science10.1145/3661814.3662126(1-14)Online publication date: 8-Jul-2024
  • (2023)A Novel Multi-Domain Adaptation-Based Method for Blast Furnace Anomaly DetectionInternational Journal of Web Services Research10.4018/IJWSR.32675320:1(1-14)Online publication date: 24-Jul-2023
  • (2023)User Cold Start Recommendation System Based on Hofstede Cultural TheoryInternational Journal of Web Services Research10.4018/IJWSR.32119920:1(1-17)Online publication date: 19-Apr-2023
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

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
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]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 11 January 2006

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. equational reasoning
  2. inductive and coinductive types
  3. lifted types
  4. non-strict and strict languages
  5. partial and infinite values
  6. partial and total languages

Qualifiers

  • Article

Conference

POPL06

Acceptance Rates

Overall Acceptance Rate 860 of 4,328 submissions, 20%

Upcoming Conference

POPL '26

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)22
  • Downloads (Last 6 weeks)2
Reflects downloads up to 08 Mar 2025

Other Metrics

Citations

Cited By

View all
  • (2024)A Cartesian Closed Category for Random VariablesProceedings of the 39th Annual ACM/IEEE Symposium on Logic in Computer Science10.1145/3661814.3662126(1-14)Online publication date: 8-Jul-2024
  • (2023)A Novel Multi-Domain Adaptation-Based Method for Blast Furnace Anomaly DetectionInternational Journal of Web Services Research10.4018/IJWSR.32675320:1(1-14)Online publication date: 24-Jul-2023
  • (2023)User Cold Start Recommendation System Based on Hofstede Cultural TheoryInternational Journal of Web Services Research10.4018/IJWSR.32119920:1(1-17)Online publication date: 19-Apr-2023
  • (2023)A Services Classification Method Based on Heterogeneous Information Networks and Generative Adversarial NetworksInternational Journal of Web Services Research10.4018/IJWSR.31996020:1(1-17)Online publication date: 17-Mar-2023
  • (2023)Conjuring Fusion Laws via Relational CalculusJournal of Information Processing10.2197/ipsjjip.31.2131(21-32)Online publication date: 2023
  • (2022)Reasonable Agda is correct Haskell: writing verified Haskell using agda2hsProceedings of the 15th ACM SIGPLAN International Haskell Symposium10.1145/3546189.3549920(108-122)Online publication date: 6-Sep-2022
  • (2022)A totally predictable outcome: an investigation of traversals of infinite structuresProceedings of the 15th ACM SIGPLAN International Haskell Symposium10.1145/3546189.3549915(39-53)Online publication date: 6-Sep-2022
  • (2019)A Definitional Implementation of the Lax Logical Framework LLFP in Coq, for Supporting Fast and Loose ReasoningElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.307.3307(8-23)Online publication date: 12-Oct-2019
  • (2019)3D sunken relief generation from a single image by feature line enhancementMultimedia Tools and Applications10.1007/s11042-018-5826-778:4(4989-5002)Online publication date: 1-Feb-2019
  • (2019)Laws of Monadic Error HandlingTheoretical Aspects of Computing – ICTAC 201910.1007/978-3-030-32505-3_21(372-391)Online publication date: 31-Oct-2019
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media