Stack (abstract Data Type) - Abstract Definition

Abstract Definition

A stack is a basic computer science data structure and can be defined in an abstract, implementation-free manner, or it can be generally defined as a linear list of items in which all additions and deletion are restricted to one end that is Top.

This is a VDM (Vienna Development Method) description of a stack:

Function signatures:

init: -> Stack push: N x Stack -> Stack top: Stack -> (N U ERROR) remove: Stack -> Stack isempty: Stack -> Boolean

(where N indicates an element (natural numbers in this case), and U indicates set union)

Semantics:

top(init) = ERROR top(push(i,s)) = i remove(init) = init remove(push(i, s)) = s isempty(init) = true isempty(push(i, s)) = false

Read more about this topic:  Stack (abstract Data Type)

Famous quotes containing the words abstract and/or definition:

    The whole body of what is now called moral or ethical truth existed in the golden age as abstract science. Or, if we prefer, we may say that the laws of Nature are the purest morality.
    Henry David Thoreau (1817–1862)

    The very definition of the real becomes: that of which it is possible to give an equivalent reproduction.... The real is not only what can be reproduced, but that which is always already reproduced. The hyperreal.
    Jean Baudrillard (b. 1929)