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 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
00022 oklib_include("OKlib/ComputerAlgebra/TestSystem/Lisp/Asserts.mac")\$
00023 oklib_include("OKlib/ComputerAlgebra/Algebra/Lisp/Groupoids/BasicNotions.mac")\$
00024
00025 kill(f)\$
00026
00027 /* ****************************
00028    * Transformations as lists *
00029    ****************************
00030 */
00031
00032 okltest_trf_l_compo(f) := (
00033   assert(f([],[]) = []),
00034   assert(f([1],[1]) = [1]),
00035   assert(f([1,2],[1,2]) = [1,2]),
00036   assert(f([1,2],[2,1]) = [2,1]),
00037   assert(f([2,1],[2,1]) = [1,2]),
00038   assert(f([2,1,3],[3,2,1]) = [3,1,2]),
00039   true)\$
00040
00041 okltest_trf_l_mon(f) := (
00042   for n : 0 thru if oklib_test_level=0 then 2 else 3 do block([M : f(n)],
00043     assert(length(M[1]) = if n=0 then 1 else n^n),
00044     assert(mon_p(M) = true)
00045   ),
00046   true)\$
00047
```