Book contents
- Frontmatter
- Contents
- Preface to the Second Edition
- Preface
- 1 Standard ML
- 2 Names, Functions and Types
- 3 Lists
- 4 Trees and Concrete Data
- 5 Functions and Infinite Data
- 6 Reasoning About Functional Programs
- 7 Abstract Types and Functors
- 8 Imperative Programming in ML
- 9 Writing Interpreters for the λ-Calculus
- 10 A Tactical Theorem Prover
- Project Suggestions
- Bibliography
- Syntax Charts
- Index
- PREDECLARED IDENTIFIERS
6 - Reasoning About Functional Programs
Published online by Cambridge University Press: 05 June 2012
- Frontmatter
- Contents
- Preface to the Second Edition
- Preface
- 1 Standard ML
- 2 Names, Functions and Types
- 3 Lists
- 4 Trees and Concrete Data
- 5 Functions and Infinite Data
- 6 Reasoning About Functional Programs
- 7 Abstract Types and Functors
- 8 Imperative Programming in ML
- 9 Writing Interpreters for the λ-Calculus
- 10 A Tactical Theorem Prover
- Project Suggestions
- Bibliography
- Syntax Charts
- Index
- PREDECLARED IDENTIFIERS
Summary
Most programmers know how hard it is to make a program work. In the 1970s, it became apparent that programmers could no longer cope with software projects that were growing ever more complex. Systems were delayed and cancelled; costs escalated. In response to this software crisis, several new methodologies have arisen — each an attempt to master the complexity of large systems.
Structured programming seeks to organize programs into simple parts with simple interfaces. An abstract data type lets the programmer view a data structure, with its operations, as a mathematical object. The next chapter, on modules, will say more about these topics.
Functional programming and logic programming aim to express computations directly in mathematics. The complicated machine state is made invisible; the programmer has to understand only one expression at a time.
Program correctness proofs are introduced in this chapter. Like the other responses to the software crisis, formal methods aim to increase our understanding. The first lesson is that a program only ‘works’ if it is correct with respect to its specification. Our minds cannot cope with the billions of steps in an execution. If the program is expressed in a mathematical form, however, then each stage of the computation can be described by a formula. Programs can be verified — proved correct — or derived from a specification. Most of the early work on program verification focused on Pascal and similar languages; functional programs are easier to reason about because they involve no machine state.
- Type
- Chapter
- Information
- ML for the Working Programmer , pp. 213 - 256Publisher: Cambridge University PressPrint publication year: 1996