OKlibrary  0.2.1.6
Sequences.mac
Go to the documentation of this file.
```00001 /* Oliver Kullmann, 23.4.2010 (Swansea) */
00002 /* Copyright 2010 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
00024 /* ****************
00025    * Transformers *
00026    ****************
00027 */
00028
00029 okltest_transform_threshold_l(f) := (
00030   assert(f([]) = []),
00031   assert(f([0]) = [1]),
00032   assert(f([0,1]) = [1,2]),
00033   assert(f([1,3]) = [0,1,1,2]),
00034   assert(f([1,3,6]) = [0,1,1,2,2,2,3]),
00035   assert(f([1,3,6,[],[1]]) = [0,1,1,2,2,2,3]),
00036   assert(f([[],1]) = []),
00037   for m : 0 thru 6 do
00038     assert(f([m]) = endcons(1,create_list(0,i,1,m))),
00039   for m : 0 thru 6 do
00040     assert(f(create_list(i,i,0,m-1)) = create_list(i,i,1,m)),
00041   for m : 1 thru 6 do
00042     assert(f(create_list(i,i,1,m)) = create_list(i,i,0,m)),
00043   true)\$
00044
00045 okltest_transform_steps_l(f) := block([LT],
00046   assert(f([]) = []),
00047   assert(f([0]) = []),
00048   assert(f([0,0]) = []),
00049   assert(f([1,1,1]) = []),
00050   assert(f([0,0,0,1,1,2]) = [3,5]),
00051   assert(f([1,1,1,2,2,3]) = [3,5]),
00052   LT : [[],[1],[2],[3],[1,2],[1,3],[1,4],[1,4,6,8,11]],
00053   for L in LT do
00054     assert(f(transform_threshold_l(L)) = L),
00055   LT = [[],[0,1],[0,0,1],[0,0,1,1],[0,1,2,2,2,3],[0,1,2,2,3,3,3,4]],
00056   for L in LT do
00057     assert(f(transform_threshold_l(L)) = L),
00058   true)\$
00059
00060 okltest_alphastep2tau(f) := (
00061   assert(f([1]) = [0]),
00062   assert(f([2]) = [1,1]),
00063   assert(f([3]) = [1,2,2]),
00064   assert(f([1,2]) = [0,0]),
00065   assert(f([1,3]) = [0,1,1]),
00066   /* XXX */
00067   true)\$
00068
00069 okltest_tau2alphastep(f) := (
00070   assert(f([0]) = [1]),
00071   assert(f([0,1,2]) = [1]),
00072   /* XXX */
00073   true)\$
00074
00075
00076 /* ************
00077    * Analysis *
00078    ************
00079 */
00080
00081
00082
```