OKlibrary  0.2.1.6
PartialAssignments.mac
Go to the documentation of this file.
00001 /* Oliver Kullmann, 10.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 oklib_include("OKlib/ComputerAlgebra/Algebra/Lisp/Groupoids/Commutativity.mac")$
00025 oklib_include("OKlib/ComputerAlgebra/Hypergraphs/Lisp/SetSystems.mac")$
00026 oklib_include("OKlib/ComputerAlgebra/NumberTheory/Lisp/Auxiliary.mac")$
00027 oklib_include("OKlib/ComputerAlgebra/Algebra/Lisp/Groupoids/Operations/BasicNotions.mac")$
00028 
00029 kill(f)$
00030 
00031 /* *******************************
00032    * Boolean partial assignments *
00033    *******************************
00034 */
00035 
00036 okltest_pass_mon(f) := (
00037   for n : 0 thru if oklib_test_level=0 then 2 else 3 do 
00038    block([V : f(setn(n))],
00039     assert(mon_p(V) = true),
00040     assert(length(V[1]) = pow(3,n)),
00041     assert(centre_grd(V) = {{}})
00042   ),
00043   true)$
00044 
00045 okltest_pass_sgr(f) := block(
00046   for n : 0 thru if oklib_test_level=0 then 2 else 3 do 
00047    block([V : f(setn(n))],
00048     assert(sgr_p(V) = true),
00049     assert(length(V[1]) = pow(3,n)-1),
00050     assert(centre_grd(V) = {})
00051   ),
00052   if oklib_test_level=0 then return(true),
00053   okltest_pass_mon(buildq([f],lambda([V],
00054     block([P:f(V)],[adjoin({},P[1]),P[2],{}])))),
00055   true)$
00056 
00057 okltest_natop_pass(f) := block([x,y],
00058   for n : 0 thru if oklib_test_level=0 then 2 else 3 do 
00059    block([V : pass_mon(setn(n)), opr : f(x,y), X : union(setn(n),{x,y})],
00060     assert(opr_ugrdset_p(opr,V,X) = true)),
00061   true)$
00062