Book contents
- Frontmatter
- Contents
- Preface
- Part 1 Functions and Foundations
- 1 Introduction
- 2 Computability
- 3 Lisp: Functions, Recursion, and Lists
- 4 Fundamentals
- Part 2 Procedures, Types, Memory Management, and Control
- Part 3 Modularity, Abstraction, and Object-Oriented Programming
- Part 4 Concurrency and Logic Programming
- Appendix A Additional Program Examples
- Glossary
- Index
2 - Computability
from Part 1 - Functions and Foundations
Published online by Cambridge University Press: 05 June 2012
- Frontmatter
- Contents
- Preface
- Part 1 Functions and Foundations
- 1 Introduction
- 2 Computability
- 3 Lisp: Functions, Recursion, and Lists
- 4 Fundamentals
- Part 2 Procedures, Types, Memory Management, and Control
- Part 3 Modularity, Abstraction, and Object-Oriented Programming
- Part 4 Concurrency and Logic Programming
- Appendix A Additional Program Examples
- Glossary
- Index
Summary
Some mathematical functions are computable and some are not. In all general-purpose programming languages, it is possible to write a program for each function that is computable in principle. However, the limits of computability also limit the kinds of things that programming language implementations can do. This chapter contains a brief overview of computability so that we can discuss limitations that involve computability in other chapters of the book.
PARTIAL FUNCTIONS AND COMPUTABILITY
From a mathematical point of view, a program defines a function. The output of a program is computed as a function of the program inputs and the state of the machine before the program starts. In practice, there is a lot more to a program than the function it computes. However, as a starting point in the study of programming languages, it is useful to understand some basic facts about computable functions.
The fact that not all functions are computable has important ramifications for programming language tools and implementations. Some kinds of programming constructs, however useful they might be, cannot be added to real programming languages because they cannot be implemented on real computers.
Expressions, Errors, and Nontermination
In mathematics, an expression may have a defined value or it may not. For example, the expression 3 + 2 has a defined value, but the expression 3/0 does not.
- Type
- Chapter
- Information
- Concepts in Programming Languages , pp. 10 - 17Publisher: Cambridge University PressPrint publication year: 2002