OKlibrary  0.2.1.6
Auxiliary.mac
Go to the documentation of this file.
```00001 /* Oliver Kullmann, 14.12.2011 (Swansea) */
00002 /* Copyright 2011, 2012 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
00025 kill(f)\$
00026
00027 /* ***********************
00028    * Properties of terms *
00029    ***********************
00030 */
00031
00032 okltest_tcre_p(f) := (
00033   /* XXX */
00034   true)\$
00035
00036
00037 /* ***************************
00038    * Simplification of terms *
00039    ***************************
00040 */
00041
00042 okltest_simplify_t(f) := block([x,n,p,q],
00043   assert(f(log(4)/log(2)) = 2),
00044   assert(f({log(4)/log(2)}) = {2}),
00045   assert(f({log(4)/log(2)}) # {}),
00046   assert(f(log(4)/log(2) = 2) = true),
00047   assert(f(sin(x)^2+cos(x)^2) = 1),
00048   assert(f(sin(x)^2+cos(x)^2 = 1) = true),
00049   assert(f((y1-y2)^2+(x1-x2)^2 = (y2-y1)^2+(x2-x1)^2) = true),
00050   assert(f(sum(i,i,1,n)) = n*(n+1)/2),
00051   assert(f(1+1) = 2),
00052   assert(f(n!/(n-1)!) = n),
00053   assert(f(gamma(x+1)/gamma(x)) = x),
00054   assert(f(gamma(x)) = (x-1)!),
00055   assert(f(1/(1+q/p) = p/(p+q)) = true),
00056   assert(f([] = []) = true),
00057   assert(f([] = [0]) = false),
00058   assert(f([log(4)/log(2),sin(x)^2+cos(x)^2] = [2,1]) = true),
00059   assert(f([] = {}) = false),
00060   assert(f({log(4)/log(2),sin(x)^2+cos(x)^2,gamma(1)}) = {1,2}),
00061   assert(f({} = []) = false),
00062   assert(f([] = 0) = false),
00063   assert(f({} = 0) = false),
00064   assert(f(0 = []) = false),
00065   assert(f(0 = {}) = false),
00066   true)\$
00067
00068
```