Loading…
The expressive power of higher-order types or, life without CONS
Compare first-order functional programs with higher-order programs allowing functions as function parameters. Can the the first program class solve fewer problems than the second? The answer is no: both classes are Turing complete, meaning that they can compute all partial recursive functions. In pa...
Saved in:
Published in: | Journal of functional programming 2001-01, Vol.11 (1), p.55-94 |
---|---|
Main Author: | |
Format: | Article |
Language: | English |
Subjects: | |
Citations: | Items that cite this one |
Online Access: | Get full text |
Tags: |
Add Tag
No Tags, Be the first to tag this record!
|
Summary: | Compare first-order functional programs with higher-order programs allowing functions as
function parameters. Can the the first program class solve fewer problems than the second?
The answer is no: both classes are Turing complete, meaning that they can compute all
partial recursive functions. In particular, higher-order values may be first-order simulated
by use of the list constructor ‘cons’ to build function closures. This paper uses complexity
theory to prove some expressivity results about small programming languages that are less
than Turing complete. Complexity classes of decision problems are used to characterize the
expressive power of functional programming language features. An example: second-order
programs are more powerful than first-order, since a function f of type [Bool]-〉Bool is
computable by a cons-free first-order functional program if and only if f is in PTIME, whereas
f is computable by a cons-free second-order program if and only if f is in EXPTIME. Exact
characterizations are given for those problems of type [Bool]-〉Bool solvable by programs
with several combinations of operations on data: presence or absence of constructors; the
order of data values: 0, 1, or higher; and program control structures: general recursion, tail
recursion, primitive recursion. |
---|---|
ISSN: | 0956-7968 1469-7653 |
DOI: | 10.1017/S0956796800003889 |