OKlibrary  0.2.1.6
LinearAutarkies.mac
Go to the documentation of this file.
00001 /* Oliver Kullmann, 19.7.2008 (Swansea) */
00002 /* Copyright 2008 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    * Basic operations *
00029    ********************
00030 */
00031 
00032 okltest_laut_paocs_p(f) := (
00033   assert(f({},[]) = true),
00034   assert(f({},[{}]) = true),
00035   assert(f({1},[{},{1},{1,2}]) = true),
00036   assert(f({1,2},[{1,2},{-1,2},{-2,1}]) = true),
00037   assert(f({1,-2,3},[{1,2,-3},{-1,-2,-3},{3}]) = false),
00038   true)$
00039 
00040 okltest_all_laut_ocs(f) := block(
00041   assert(f([]) = {{}}),
00042   assert(f([{}]) = {{}}),
00043   assert(f([{1}]) = {{},{1}}),
00044   assert(f([{1},{-1}]) = {{}}),
00045   assert(f([{1},{-1,2}]) = {{},{2},{1,2}}),
00046   if oklib_test_level = 0 then return(true),
00047   assert(f([{1,2,-3},{-1,-2,-3},{3}]) = {{},{1,-2},{-1,2}}),
00048   true)$
00049 
00050 okltest_lautmon_ocs(f) := block(
00051     exm : [
00052    [], [{}],
00053    [{1},{2}]
00054   ],
00055   for F in exm do
00056     assert(mon_p(f(F))),
00057   if oklib_test_level = 0 then return(true),
00058   exm1 : [
00059    [{1,-2},{2,-3},{3,4}]
00060   ],
00061   for F in exm1 do
00062     assert(mon_p(f(F))),
00063   true)$
00064 
00065 okltest_extlaut_paocs_p(f) := (
00066 
00067   true)$
00068 
00069 okltest_find_linearautarky_ocs(f) := block(
00070   assert(f([]) = false),
00071   assert(f([{}]) = false),
00072   assert(f([{1}]) = {1}),
00073   assert(f([{1},{-1}]) = false),
00074   assert(f([{1},{1,2},{-2}]) = {1,-2}),
00075   assert(f([{1,2},{-1,2},{1,-2}]) = {1,2}),
00076   true)$
00077