List (abstract Data Type) - Abstract Definition

Abstract Definition

The abstract list type L with elements of some type E (a monomorphic list) is defined by the following functions:

nil: → L
cons: E × LL
first: LE
rest: LL

with the axioms

first (cons (e, l)) = e
rest (cons (e, l)) = l

for any element e and any list l. It is implicit that

cons (e, l) ≠ l
cons (e, l) ≠ e
cons (e1, l1) = cons (e2, l2) if e1 = e2 and l1 = l2

Note that first (nil ) and rest (nil ) are not defined.

These axioms are equivalent to those of the abstract stack data type.

In type theory, the above definition is more simply regarded as an inductive type defined in terms of constructors: nil and cons. In algebraic terms, this can be represented as the transformation 1 + E × LL. first and rest are then obtained by pattern matching on the cons constructor and separately handling the nil case.

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

Famous quotes containing the words abstract and/or definition:

    What a cheerful rhyme! Clean not mean!
    Been not seen! Not tired—expired!
    We must now decide about place.
    We decide that place is the big weeping face
    And the other abstract lace of the race.
    Allen Tate (1899–1979)

    Beauty, like all other qualities presented to human experience, is relative; and the definition of it becomes unmeaning and useless in proportion to its abstractness. To define beauty not in the most abstract, but in the most concrete terms possible, not to find a universal formula for it, but the formula which expresses most adequately this or that special manifestation of it, is the aim of the true student of aesthetics.
    Walter Pater (1839–1894)