OKlibrary  0.2.1.6
TransformationMonoids.mac
Go to the documentation of this file.
```00001 /* Oliver Kullmann, 7.7.2008 (Swansea) */
00002 /* Copyright 2008, 2009, 2011 Oliver Kullmann
00003 This file is part of the OKlibrary. OKlibrary is free software; you can redistribute
00004 it and/or modify it under the terms of the GNU General Public License as published by
00005 the Free Software Foundation and included in this library; either version 3 of the
00006 License, or any later version. */
00007
00026 oklib_include("OKlib/ComputerAlgebra/Hypergraphs/Lisp/SetSystems.mac")\$
00027 oklib_include("OKlib/ComputerAlgebra/DataStructures/Lisp/HashMaps.mac")\$
00028
00029
00030 /* ****************************
00031    * Transformations as lists *
00032    ****************************
00033 */
00034
00035 /* Here only standardised sets, i.e., U = {1, ..., n},
00036    are considered, and then a "transformation as list"
00037    is a list of length n with elements from U.
00038 */
00039
00040 /* Composition of transformations as lists. */
00041 /* Prerequisite: length(x) = length(y). */
00042 /* RENAME: trf_l_compo */
00043 transformation_l_compo(x,y) := if length(x) <= 200 then create_list(x[i], i,y)
00044  else block([a : il2ary(x)],  create_list(a[i], i,y))\$
00045 trf_l_compo(x,y) := transformation_l_compo(x,y)\$
00046
00047 /* The full transformation monoid over n elements (and thus with n^n
00048    transformations): */
00049 /* RENAME: trf_l_mon */
00050 transformations_l_mon(n) :=
00051   [all_transformations_l(setn(n)),
00052    transformation_l_compo,
00053    create_list(i,i,1,n)]\$
00054 trf_l_mon(n) := transformations_l_mon(n)\$
00055
00056
00057 /* ***************
00058    * Conversions *
00059    ***************
00060 */
00061
00062 /* Converting a transformation as list to a transformation as function: */
00063 trfl2trff(x) := buildq([a : il2ary(x)], lambda([n], a[n]))\$
00064
00065 /* Converting a transformation as function over {1,...,n} to a transformation
00066    as list:
00067 */
00068 trff2trfl(t,n) := create_list(t(i),i,1,n)\$
00069
```