Partial mappings are very much like normal mappings (see Maps) except that there is no need for an image to be defined for every element of the domain. The pmap constructor has the syntax
pmap< A -> B | IDENTIFIER :-> EXPRESSION >
or
pmap< A -> B | G >
Here G must be a subgraph of A x B, but need not be a graph of A x B. In other words, in the first parts of the tuples of G, no element of A can appear more than once, but not every element need appear.
In the first of these forms, EXPRESSION may be such that it is illegal for some values in A of IDENTIFIER, but if the partial mapping is not evaluated for those elements of A then there will never be an error.
The partial mapping from F9 onto Z/8Z defined by taking the multiplicative order of the field element (impossible for the zero element). > F<z> := FiniteField(9); > Zm := IntegerRing(8); > o := pmap< F -> Zm | x :-> Order(x) >; > print [ <x, o(x)> : x in F | x ne 0 ]; [ <1, 1>, <z, 0>, <z^2, 4>, <z^3, 0>, <2, 2>, <z^5, 0>, <z^6, 4>, <z^7, 0> ]The same partial mapping defined as a list of images of every element of F except 0. > o2 := pmap< F -> Zm | > <1, 1>, <z, 0>, <z^2, 4>, <z^3, 0>, <2, 2>, <z^5, 0>, <z^6, 4>, <z^7, 0> >; > print o2; Mapping from: GF(3^2) to Integers(8) <1, 1> <z, 0> <z^2, 4> <z^3, 0> <2, 2> <z^5, 0> <z^6, 4> <z^7, 0>
[Next] [Prev] [_____] [Left] [Up] [Index] [Root]