To introduce this idea, consider the set U of all authorised
users of a main-frame machine. User
has a user-number
which we suppose is a positive integer which we can denote by
a(u). For instance if John Smith is an authorised user
(and so is a member of the set U) and has user-number 2136,
then we can write
.
We observe that, in
general, each element
will give rise to a specific and unique
element
.
This relationship is an instance of a
mapping of U to
,
where in this example, a is the
user-number mapping. Formally, we use the notation
The application of functions and mappings is one of the most commonly used techniques in formal specification methodologies and indeed, the concept of mappings plays a key role in computer science with wide-ranging applications. One way to think of a mapping f is to treat it as a function which takes an input and transforms this input into an output, so that symbolically
On a more concrete level, use of finite maps such as finite sets
of (index,value) or (key,value) pairs underlies the
implementation of such data structures as arrays, hash-tables,
keyed files and colour look-up tables. Mappings also play a
crucial role in operating systems, for
example dynamic address translation mechanisms need to maintain
address translation maps illustrating which virtual storage
locations are currently in real storage and exactly where they
are.