OKlibrary  0.2.1.6
NullElements.mac
Go to the documentation of this file.
```00001 /* Oliver Kullmann, 14.1.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 oklib_include("OKlib/ComputerAlgebra/Algebra/Lisp/Groupoids/Semigroups/BasicExamples.mac")\$
00024
00025 kill(f)\$
00026
00027
00028 okltest_leftnull_el_grd(f) := (
00029   assert(f(singleton_sgr,1) = true),
00030   for x in {1,2,3} do block([V : leftnull_sgr({1,2,3})],
00031     assert(f(V,x) = true)),
00032   for x in {1,2,3} do block([V : rightnull_sgr({1,2,3})],
00033     assert(f(V,x) = false)),
00034   true)\$
00035
00036 okltest_rightnull_el_grd(f) := (
00037   assert(f(singleton_sgr,1) = true),
00038   for x in {1,2,3} do block([V : leftnull_sgr({1,2,3})],
00039     assert(f(V,x) = false)),
00040   for x in {1,2,3} do block([V : rightnull_sgr({1,2,3})],
00041     assert(f(V,x) = true)),
00042   true)\$
00043
00044 okltest_null_el_grd(f) := (
00045   assert(f(singleton_sgr,1) = true),
00046   for x in {1,2,3} do block([V : leftnull_sgr({1,2,3})],
00047     assert(f(V,x) = false)),
00048   for x in {1,2,3} do block([V : rightnull_sgr({1,2,3})],
00049     assert(f(V,x) = false)),
00050   for x in {1,2,3} do block([V : null_sgr({1,2,3},1)],
00051     assert(f(V,x) = is(x = 1))),
00052   true)\$
00053
00054 okltest_has_leftnull_el_grd(f) := (
00055   assert(f(empty_sgr) = false),
00056   assert(f(singleton_sgr) = true),
00057   assert(f(leftnull_sgr({1,2,3})) = true),
00058   assert(f(rightnull_sgr({1,2,3})) = false),
00059   true)\$
00060
00061 okltest_has_rightnull_el_grd(f) := (
00062   assert(f(empty_sgr) = false),
00063   assert(f(singleton_sgr) = true),
00064   assert(f(leftnull_sgr({1,2,3})) = false),
00065   assert(f(rightnull_sgr({1,2,3})) = true),
00066   true)\$
00067
00068 okltest_has_null_el_grd(f) := (
00069   assert(f(empty_sgr) = false),
00070   assert(f(singleton_sgr) = true),
00071   assert(f(leftnull_sgr({1,2,3})) = false),
00072   assert(f(rightnull_sgr({1,2,3})) = false),
00073   assert(f(null_sgr({1,2,3},1)) = true),
00074   true)\$
00075
00076
```