Skip to main content Accessibility help
×
Hostname: page-component-5c6d5d7d68-pkt8n Total loading time: 0 Render date: 2024-08-14T22:27:43.926Z Has data issue: false hasContentIssue false

6 - Proofs

Published online by Cambridge University Press:  05 November 2014

Richard Bird
Affiliation:
University of Oxford
Get access

Summary

We have seen a lot of laws in the previous two chapters, though perhaps the word ‘law’ is a little inappropriate because it suggests something that is given to us from on high and which does not have to be proved. At least the word has the merit of being short. All of the laws we have encountered so far assert the equality of two functional expressions, possibly under subsidiary conditions; in other words, laws have been equations or identities between functions, and calculations have been point-free calculations (see Chapter 4, and the answer to Exercise K for more on the point-free style). Given suitable laws to work with, we can then use equational reasoning to prove other laws. Equational logic is a simple but powerful tool in functional programming because it can guide us to new and more efficient definitions of the functions and other values we have constructed. Efficiency is the subject of the following chapter. This one is about another aspect of equational reasoning, proof by induction. We will also show how to shorten proofs by introducing a number of higher-order functions that capture common patterns of computations. Instead of proving properties of similar functions over and over again, we can prove more general results about these higher-order functions, and appeal to them instead.

Type
Chapter
Information
Publisher: Cambridge University Press
Print publication year: 2014

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

  • Proofs
  • Richard Bird, University of Oxford
  • Book: Thinking Functionally with Haskell
  • Online publication: 05 November 2014
  • Chapter DOI: https://doi.org/10.1017/CBO9781316092415.007
Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

  • Proofs
  • Richard Bird, University of Oxford
  • Book: Thinking Functionally with Haskell
  • Online publication: 05 November 2014
  • Chapter DOI: https://doi.org/10.1017/CBO9781316092415.007
Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

  • Proofs
  • Richard Bird, University of Oxford
  • Book: Thinking Functionally with Haskell
  • Online publication: 05 November 2014
  • Chapter DOI: https://doi.org/10.1017/CBO9781316092415.007
Available formats
×