OKlibrary  0.2.1.6
RandomClauseSets.mac
Go to the documentation of this file.
00001 /* Oliver Kullmann, 17.2.2008 (Swansea) */
00002 /* Copyright 2008, 2013 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/Satisfiability/Lisp/Generators/Pigeonhole.mac")$
00024 oklib_include("OKlib/ComputerAlgebra/Satisfiability/Lisp/Backtracking/DLL_solvers.mac")$
00025 
00026 
00027 kill(f)$
00028 
00029 okltest_probsatrand(f) := block(
00030   assert(f({}) = 1),
00031   assert(f({{}}) = 0),
00032   assert(f({{1}}) = 1/2),
00033   assert(f({{1},{-1}}) = 1/4),
00034   assert(f({{1},{2,3},{4,5,6}}) = 21/64),
00035   for m : 1 thru 3 do
00036    for n : 1 thru 3 do block([F : weak_php_fcs(m,n)],
00037     assert_float_equal(f(F), exp(logprobrand(F)))),
00038   true)$
00039 
00040