The history of programming languages may be characterized as the genesis of increasingly powerful abstractions to aid the development of reliable programs.
Additional keywords and phrases:
control abstractions, data abstractions,
compiler support,
description systems,
behavioral specification,
implementation specification
The kind of abstraction provided by ADTs can be supported
by any language with a procedure call mechanism
(given that appropriate protocols are developed
and observed by the programmer). A foundational perspective -- types as constraints
Object-oriented programming may be regarded as
a declarative method of programming,
in the sense that it provides a computation model
(expressed by the metaphor of encapsulation and message
passing) that is independent of a particular implementation model.
In particular, the inheritance subtype relation may
be regarded as a pure description of the relations
between the entities represented by the classes.
Moreover, an object-oriented approach favors the
development of an object model that bears close resemblance
to the entities and their relations living in the
application domain.
However, the object-oriented
programming model is rarely introduced with the
mathematical precision characteristic of descriptions
of the other declarative styles,
for example
the functional and logic programming model.
Criticizing,
empty
right append
left append
concatenation
lifting
multiple arguments
attribute
method
function n : ctr -> nat
method incr : ctr -> ctr
axioms
n(new(C)) = 0
n(incr(C)) = n(C) + 1
end
nil | cons(h,t) | |
---|---|---|
empty(l) | true | false |
head(l) | error | h |
tail(l) | error | t |
list* r = cons(1,cons(2,nil())); while (!empty(r)) { cout << head(r) << endl; r = tail(r); }
list<int>* r = new cons<int>(1, new cons<int>(2, new nil<int>)); while (! r->empty()) { cout << r->head() << endl; r = r->tail(); } delete r;
Discussion
(under)
(right)
(over)
(type)
(signature)
(classes)
There is a vast amount of literature on the algebraic
specification of abstract data types.
You may consult, for example,
draft version 0.1 (15/7/2001)