OKlibrary  0.2.1.6
Stratification.mac
Go to the documentation of this file.
```00001 /* Oliver Kullmann, 18.10.2009 (Swansea) */
00002 /* Copyright 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
00024
00025 kill(f)\$
00026
00027
00028 /* **********************************
00029    * Strata in monotone hypergraphs *
00030    **********************************
00031 */
00032
00033 okltest_sizes_strata_mon_ohg(f) := block([V],
00034   assert(f([V,[]]) = []),
00035   assert(f([V,[{1,2,3}]]) = [[3,1]]),
00036   assert(f([V,[{-1,-3,-5}]]) = [[-1,1]]),
00037   assert(f([V,[{3,4,5},{2,-1,5}]]) = [[5,2]]),
00038   assert(f([V,[{0,2,4},{2,4,6}]]) = [[4,1],[6,1]]),
00039   assert(f([V,[{0,2,4},{2,4,6},{-1,-2,6}]]) = [[4,1],[6,2]]),
00040   true)\$
00041
00042 okltest_sizes_strata_indmon_ohg(f) := (
00043   assert(f([[],[]]) = []),
00044   assert(f([[1,2,3],[{1,2,3}]]) = [[3,1]]),
00045   assert(f([[-5,-3,-1],[{-1,-3,-5}]]) = [[3,1]]),
00046   assert(f([[-5,-3,-1,1],[{-1,-3,-5}]]) = [[3,1]]),
00047   assert(f([[-1,2,3,4,5],[{3,4,5},{2,-1,5}]]) = [[5,2]]),
00048   assert(f([[0,2,4,6],[{0,2,4},{2,4,6}]]) = [[3,1],[4,1]]),
00049   assert(f([[0,2,4,6],[{0,2,4},{2,4,6},{-1,-2,6}]]) = [[3,1],[4,2]]),
00050   true)\$
00051
00052 okltest_accumulate_l(f) := block([x,y,a,b],
00053   assert(f([]) = []),
00054   assert(f([[x,y]]) = [[x,y]]),
00055   assert(f([[a,x],[b,y]]) = [[a,x],[b,x+y]]),
00056   true)\$
00057
00058
00059 /* *************************************
00060    * Stratifying arbitrary hypergraphs *
00061    *************************************
00062 */
00063
00064 okltest_strata_ses(f) := (
00065   /* XXX */
00066   true)\$
00067
00068
00069 /* **************
00070    * Heuristics *
00071    **************
00072 */
00073
00074
00075
```