OKlibrary  0.2.1.6
Basics.mac
Go to the documentation of this file.
00001 /* Oliver Kullmann, 26.5.2012 (Swansea) */
00002 /* Copyright 2012 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/Hypergraphs/Lisp/SetSystems.mac")\$
00024
00025
00026 kill(f)\$
00027
00028 /* ***********************
00029    * Fundamental notions *
00030    ***********************
00031 */
00032
00033 okltest_grdfs_p(f) := (
00034   assert(f(0) = false),
00035   assert(f([]) = false),
00036   assert(f([{}]) = false),
00037   assert(f([{},{}]) = false),
00038   assert(f([{},{{}}]) = true),
00039   assert(f([{1,2},{{},{1,2}}]) = false),
00040   for n : 0 thru 5 do block([N : setn(n), M],
00041     M : [N, setify(create_list(setn(i),i,0,n))],
00042     assert(f(M) = true)
00043   ),
00044   for n : 0 thru 4 do block([N : setn(n), M],
00046     assert(f(M) = true)
00047   ),
00048   for n : 0 thru 3 do block([N : setn(n), M],
00049     M : [N,powerset(N)],
00050     assert(f(M) = true)
00051   ),
00052   true)\$
00053
00054 okltest_rank_grdfs(f) := (
00055   assert(f([{},{{}}]) = 0),
00056   /* XXX */
00057   true)\$
00058
00059 okltest_bases_grdfs(f) := (
00060   assert(f([{},{{}}]) = {{}}),
00061   /* XXX */
00062   true)\$
00063
00064 okltest_restriction_grdfs(f) := (
00065   assert(f([{},{{}}],{}) = [{},{{}}]),
00066   /* XXX */
00067   true)\$
00068
00069
00070 /* ******************************
00071    * Special forms of greedoids *
00072    ******************************
00073 */
00074
00075 okltest_antimtrfs_p(f) := (
00076   assert(f([{},{}]) = false),
00077   assert(f([{},{{}}]) = true),
00078   assert(f([{1},{{}}]) = true),
00079   assert(f([{1,2},{{},{1},{2}}]) = false),
00080   assert(f([{1,2,3},{{},{1},{1,2},{1,2,3}}]) = true),
00081   true)\$
00082
00083 okltest_intervalgrdfs_p(f) := (
00084   assert(f([{},{{}}]) = true),
00085   assert(f([{1},{{}}]) = true),
00086   assert(f([{1,2},{{},{1},{1,2}}]) = true),
00087   assert(f([{1,2,3},{{},{1},{2},{3},{1,2},{1,3},{2,3}}]) = true),
00088   assert(f([{1,2,3},{{},{1},{1,2},{1,2,3},{3},{2,3}}]) = false),
00089   true)\$
00090
00091 okltest_gaussian_ss_p(f) := (
00092   assert(f({}) = true),
00093   assert(f({{}}) = true),
00094   assert(f({{1}}) = true),
00095   assert(f({{},{1}}) = true),
00096   assert(f({{},{1},{2}}) = true),
00097   assert(f({{},{1},{1,2},{1,2,3}}) = true),
00098   assert(f({{},{1},{1,2},{1,2,3},{2,3}}) = false),
00099   assert(f({{},{1},{1,2},{1,2,3},{2,3},{1,3}}) = false),
00100   assert(f({{},{1},{1,2},{1,2,3},{2,3},{3}}) = true),
00101   true)\$
00102