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:

    “What persuades men and women to mistake each other from time to time for gods or vermin is ideology. One can understand well enough how human beings may struggle and murder for good material reasons—reasons connected, for instance, with their physical survival. It is much harder to grasp how they may come to do so in the name of something as apparently abstract as ideas. Yet ideas are what men and women live by, and will occasionally die for.”
    —Terry Eagleton (b. 1943)

    “Scientific method is the way to truth, but it affords, even in
    principle, no unique definition of truth. Any so-called pragmatic
    definition of truth is doomed to failure equally.”
    —Willard Van Orman Quine (b. 1908)