OKlibrary  0.2.1.6
Domains.mac
Go to the documentation of this file.
00001 /* Oliver Kullmann, 21.11.2009 (Swansea) */
00002 /* Copyright 2009, 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 /* ********************
00028    * Helper functions *
00029    ********************
00030 */
00031 
00032 okltest_dom_lengths(f) := (
00033   assert(f([{}]) = [0]),
00034   assert(f([{1}]) = [1]),
00035   assert(f([{2}]) = [1]),
00036   assert(f([{2,3},{},{1}]) = [2,0,1]),
00037   true)$
00038 
00039 okltest_log_dom_lengths(f) := (
00040   assert(f([{1}]) = [0.0]),
00041   assert(f([{1},{1}]) = [0.0, 0.0]),
00042   /* XXX */
00043   true)$
00044 
00045 
00046 /* ***************************
00047    * Heuristical evaluations *
00048    ***************************
00049 */
00050 
00051 okltest_log_prod_dom_size(f) := (
00052   assert(f([]) = 0),
00053   assert(f([{1},{1}]) = 0),
00054   assert(f([{1,2},{1,2},{1}]) = log(4)),
00055   true)$
00056 
00057