OKlibrary  0.2.1.6
certificates.mac
Go to the documentation of this file.
00001 /* Oliver Kullmann, 12.1.2011 (Swansea) */
00002 /* Copyright 2011 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/RamseyTheory/Lisp/VanderWaerden/Numbers.mac")$
00024 oklib_include("OKlib/ComputerAlgebra/RamseyTheory/Lisp/VanderWaerden/Certificates.mac")$
00025 oklib_include("OKlib/ComputerAlgebra/MaximaInternals/MemoryManagement.mac")$
00026 oklib_include("OKlib/ComputerAlgebra/RamseyTheory/Lisp/VanderWaerden/data/3k.mac")$
00027 
00028 kill(f)$
00029 
00030 
00031 okltest_certificates_vdw_3k(f) := block([maxk : length(f)],
00032   for k : 1 thru maxk do block([C : f[k]],
00033     if not emptyp(C) then block([v : vanderwaerden3k(k)],
00034       assert(listp(v) or integerp(v)),
00035       if listp(v) then (
00036         assert(length(v) = 2),
00037         assert(integerp(first(v)) = true)
00038     )
00039   )),
00040   if oklib_test_level=0 then maxk : 10
00041   elseif oklib_test_level=1 then maxk : 25,
00042   for k : 1 thru maxk do block([C : f[k]],
00043     if not emptyp(C) then block(
00044      [n : vanderwaerden3k(k)],
00045       if listp(n) then n : first(n),
00046       n : n-1,
00047       for c in C do block([P : create_certificate2_vdw(c,n)],
00048         assert(certificate_vdw_p([3,k],n,P) = true)
00049       ) 
00050     )
00051   ),
00052   true)$
00053 
00054 
00055 okltest_certificates_pdvdw_3k(f) := block([maxk : length(f)],
00056   if oklib_test_level=0 then maxk : 7
00057   elseif oklib_test_level=1 then maxk : 30,
00058   for k : 1 thru maxk do block([C : check_certificates_pdvdw_3k(k),  A,B],
00059     assert(listp(C) = true),
00060     assert(length(C) = 2),
00061     [A,B] : C,
00062     assert(listp(A) = true),
00063     assert(listp(B) = true),
00064     assert(emptyp(A) = false),
00065     assert(emptyp(B) = false),
00066     assert(every_s(identity, A) = true),
00067     assert(every_s(identity, B) = true)
00068   ),
00069   true)$
00070