OKlibrary  0.2.1.6
Order.mac
Go to the documentation of this file.
00001 /* Oliver Kullmann, 18.5.2010 (Swansea) */
00002 /* Copyright 2010, 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/Algebra/Lisp/Ringframes/Rings/ResidueClasses.mac")$
00024 oklib_include("OKlib/ComputerAlgebra/Algebra/Lisp/Groupoids/tests/Idempotency.mac")$
00025 oklib_include("OKlib/ComputerAlgebra/Algebra/Lisp/Groupoids/tests/InvertibleElements.mac")$
00026 
00027 kill(f)$
00028 
00029 okltest_closure_element_sgr(f) := (
00030   assert(f(mod_mul(1),0) = {0}),
00031   assert(f(mod_mul(3),0) = {0}),
00032   assert(f(mod_mul(3),1) = {1}),
00033   assert(f(mod_mul(3),2) = {1,2}),
00034   assert(f(mod_mul(4),2) = {0,2}),
00035   assert(f(mod_mul(4),3) = {1,3}),
00036   assert(okltest_order_element_sgr(buildq([f],lambda([comp_,a],length(f(comp_,a))))) = true),
00037   true)$
00038 
00039 okltest_order_element_sgr(f) := (
00040   for p in [2,3,5,7] do
00041     for i : 1 thru p-1 do
00042       assert(f(mod_add(p),i) = p),
00043   true)$
00044 
00045 okltest_test_order_element_sgr(f) := (
00046   /* XXX */
00047   true)$
00048 
00049 okltest_subset_order_sgr(f) := (
00050   assert(okltest_idempotents_grd(buildq([f], lambda([V], f(V,1)))) = true),
00051   assert(okltest_involutions_ugrd(buildq([f], lambda([V], f(V,2)))) = true),
00052   /* XXX */
00053   true)$
00054 
00055 okltest_ipo_element_sgr(f) := (
00056   assert(f(mod_mul(6),2) = [1,2,2]),
00057   assert(f(mod_mul(6),3) = [1,1,1]),
00058   assert(f(mod_mul(6),4) = [1,1,1]),
00059   assert(f(mod_mul(6),5) = [1,2,2]),
00060   assert(okltest_order_element_sgr(buildq([f],lambda([comp_,a],f(comp_,a)[3]))) = true),
00061   true)$
00062 
00063 okltest_ipokernel_element_sgr(f) := (
00064   assert(f(mod_mul(8),2) = [[3,1,3],[0]]),
00065   assert(f(mod_mul(8),3) = [[1,2,2],[3,1]]),
00066   assert(f(mod_mul(8),4) = [[2,1,2],[0]]),
00067   assert(f(mod_mul(8),5) = [[1,2,2],[5,1]]),
00068   assert(f(mod_mul(8),6) = [[3,1,3],[0]]),
00069   assert(f(mod_mul(8),7) = [[1,2,2],[7,1]]),
00070   assert(okltest_ipo_element_sgr(buildq([f],lambda([comp_,a],f(comp_,a)[1]))) = true),
00071   true)$
00072