OKlibrary  0.2.1.6
Heuristics.mac
Go to the documentation of this file.
00001 /* Oliver Kullmann, 20.5.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 
00024 kill(f)$
00025 
00026 
00027 /* *********************
00028    * Greedy approaches *
00029    *********************
00030 */
00031 
00032 okltest_greedy_bcp_gl(f) := block(
00033   assert(setify(f([{1,2},{{1,2}}])) = {[{1},{2}]}),
00034   assert(setify(f([{1,2,3,4},{{1,3},{2,4}}]))={[{1},{3}],[{2},{4}]}),
00035   assert(setify(f([{1,2,3,4},{{1,3},{2,4},{1,4},{2,3}}]))={[{1,2},{3,4}]}),
00036   assert(setify(f([{1,2,3,4,5,6},{{1,3},{2,4},{1,4},{2,3},{5,6},{1,6},{4,5}}]))={[{1,2},{3,4}],[{1,5},{6}],[{4},{5}]}),
00037   assert(setify(f([{1,2,3,4,5,6,7},{{1,3},{2,4},{1,4},{2,3},{5,6},{1,6},{4,5},{2,7}}]))={[{1,2},{3,4}],[{1,5},{6}],[{2},{7}],[{4},{5}]}),
00038   true) $
00039