OKlibrary  0.2.1.6
Homomorphisms.mac
Go to the documentation of this file.
00001 /* Oliver Kullmann, 25.6.2008 (Swansea) */
00002 /* Copyright 2008, 2010 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 kill(f)$
00025 
00026 /* ***************************
00027    * Checking the properties *
00028    ***************************
00029 */
00030 
00031 okltest_homomorphism_gl_p(f) := block([h,G1,G2,E],
00032   G1 : [{},{}],
00033   assert(f(G1,G2,h) = true),
00034   G1 : [{1},{}],
00035   assert(f(G1,[{1},E],identity) = true),
00036   assert(f(G1,[{1,2},{{1,2}}],identity) = true),
00037   G1 : [{1},{{1}}],
00038   assert(f(G1,[{1},{}],identity) = false),
00039   assert(f(G1,[{1},{{1}}],identity) = true),
00040   assert(f(G1,[{1,2},{{1}}],identity) = true),
00041   assert(f(G1,[{1,2},{{1,2}}],identity) = false),
00042   assert(f(G1,[{1,2},{{1,2},{1}}],identity) = true),
00043   G1 : [{1,2},{{1,2}}],
00044   assert(f(G1,[{1,2},{}],identity) = false),
00045   assert(f(G1,[{1,2},{{1},{2}}],identity) = false),
00046   assert(f(G1,[{1,2},{{1,2}}],identity) = true),
00047   true)$
00048 
00049 
00050 /* ****************************
00051    * Brute-force enumerations *
00052    ****************************
00053 */
00054 
00055 okltest_all_pisomorphisms_bydef_stgl(f) := block(
00056   assert(f([{},{}]) = [[]]),
00057   assert(f([{1},{}]) = [[1]]),
00058   assert(f([{1,2},{}]) = [[1,2],[2,1]]),
00059   assert(f([{1,2},{{1,2}}]) = [[1,2],[2,1]]),
00060   assert(f([{1,2},{{1},{2}}]) = [[1,2],[2,1]]),
00061   assert(f([{1,2},{{1},{1,2}}]) = [[1,2]]),
00062   assert(f([{1,2,3},{{1},{1,2},{2,3},{1,3}}]) = [[1,2,3],[1,3,2]]),
00063   true)$
00064 
00065