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)) = falseRead more about this topic: Stack (abstract Data Type)
Famous quotes containing the words abstract and/or definition:
“O reason, reason, abstract phantom of the waking state, I had already expelled you from my dreams, now I have reached a point where those dreams are about to become fused with apparent realities: now there is only room here for myself.”
—Louis Aragon (18971982)
“The definition of good prose is proper words in their proper places; of good verse, the most proper words in their proper places. The propriety is in either case relative. The words in prose ought to express the intended meaning, and no more; if they attract attention to themselves, it is, in general, a fault.”
—Samuel Taylor Coleridge (17721834)