OKlibrary  0.2.1.6
LinearEquations.mac
Go to the documentation of this file.
00001 /* Oliver Kullmann, 11.5.2013 (Swansea) */
00002 /* Copyright 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 
00024 kill(f)$
00025 
00026 
00027 /* *********************
00028    * Parity conditions *
00029    *********************
00030 */
00031 
00032 okltest_even_parity_cl(f) := (
00033   assert(f(0) = []),
00034   assert(f(1) = [{-1}]),
00035   assert(f(2) = [{-2,1},{-1,2}]),
00036   assert(f(3) = [{-3,-2,-1},{-3,2,1},{3,-2,1},{3,2,-1}]),
00037   true)$
00038 
00039 okltest_even_parity_wv_cl(f) := (
00040   assert(okltest_even_parity_cl(buildq([f], lambda([n], f(create_list(i,i,1,n))))) = true),
00041   assert(f([5,7]) = [{-7,5},{-5,7}]),
00042   assert(f([4,5,6]) = [{-6,-5,-4},{-6,5,4},{-5,4,6},{-4,5,6}]),
00043   assert(f([6,5,4]) = [{-6,-5,-4},{-6,5,4},{-5,4,6},{-4,5,6}]),
00044   assert(f([2,4,6]) = [{-6,-4,-2},{-6,4,2},{-4,2,6},{-2,4,6}]),
00045   true)$
00046 
00047 okltest_even_parity_fcl(f) := (
00048   assert(okltest_even_parity_cl(buildq([f], lambda([n], fcl2cl(f(n))))) = true),
00049   assert(f(0) = [[],[]]),
00050   assert(f(1) = [[1],[{-1}]]),
00051   assert(f(2) = [[1,2],[{-2,1},{-1,2}]]),
00052   true)$
00053 
00054 okltest_odd_parity_cl(f) := (
00055   assert(f(0) = [{}]),
00056   assert(f(1) = [{1}]),
00057   assert(f(2) = [{-1,-2},{2,1}]),
00058   assert(f(3) = [{-3,-2,1},{-3,2,-1},{3,-2,-1},{1,2,3}]),
00059   true)$
00060 
00061 okltest_odd_parity_wv_cl(f) := (
00062   assert(okltest_odd_parity_cl(buildq([f], lambda([n], f(create_list(i,i,1,n))))) = true),
00063   assert(f([5,7]) = [{-7,-5},{5,7}]),
00064   assert(f([4,5,6]) = [{-6,-5,4},{-6,-4,5},{-5,-4,6},{4, 5, 6}]),
00065   assert(f([6,5,4]) = [{-6,-5,4},{-6,-4,5},{-5,-4,6},{4, 5, 6}]),
00066   assert(f([2,4,6]) = [{-6,-4,2},{-6,-2,4},{-4,-2,6},{2, 4, 6}]),
00067   true)$
00068 
00069 okltest_odd_parity_fcl(f) := (
00070   assert(okltest_odd_parity_cl(buildq([f], lambda([n], fcl2cl(f(n))))) = true),
00071   assert(f(0) = [[],[{}]]),
00072   assert(f(1) = [[1],[{1}]]),
00073   assert(f(2) = [[1,2],[{-1,-2},{2,1}]]),
00074   true)$
00075 
00076 
00077 /* **********************
00078    * Parity constraints *
00079    **********************
00080 */
00081 
00082 okltest_gprt2prt(f) := (
00083   assert(f([[],0]) = []),
00084   assert(f([[],1]) = false),
00085   assert(f([[1],0]) = [1]),
00086   assert(f([[1],1]) = [-1]),
00087   assert(f([[1,1],0]) = []),
00088   assert(f([[1,1],1]) = false),
00089   assert(f([[1,-1],0]) = false),
00090   assert(f([[1,-1],1]) = []),
00091   assert(f([[1,1,-1],0]) = [-1]),
00092   assert(f([[1,1,-1],1]) = [1]),
00093   assert(f([[1,1,-1,-1],0]) = []),
00094   assert(f([[1,1,-1,-1],1]) = false),
00095   assert(f([[1,1,2,-1,-1],0]) = [2]),
00096   assert(f([[1,1,2,-1,-1],1]) = [-2]),
00097   assert(f([[1,1,2,-1,-1,2],0]) = []),
00098   assert(f([[1,1,2,-1,-1,2],1]) = false),
00099   assert(f([[-2,1,1,2,-1,-1,2],0]) = [-2]),
00100   assert(f([[-2,1,1,2,-1,-1,2],1]) = [2]),
00101   assert(f([[-2,1,1,2,-1,-1,2,1,3],0]) = [-1,2,3]),
00102   assert(f([[-2,1,1,2,-1,-1,2,-1,-3],1]) = [1,2,3]),
00103   assert(f([[-2,1,1,2,-1,-1,2,-1,-3],0]) = [-1,2,3]),
00104   assert(f([[-2,1,1,2,-1,-1,2,-1,-3,-1,3,-3],0]) = [-2,3]),
00105   assert(f([[-2,1,1,2,-1,-1,2,-1,-3,-1,3,-3,1],0]) = [-1,2,3]),
00106   true)$
00107 
00108 okltest_equiv_gprt(f) := (
00109   assert(f([[],0],[[],0]) = true),
00110   assert(f([[],1],[[],1]) = true),
00111   assert(f([[],0],[[],1]) = false),
00112   assert(f([[],1],[[],0]) = false),
00113   assert(f([[1,1],0],[[],0]) = true),
00114   assert(f([[1,1],0],[[2,2],0]) = true),
00115   assert(f([[1,-1],0],[[],1]) = true),
00116   assert(f([[1,-1],0],[[2,-2],0]) = true),
00117   assert(f([[1,-1,1],0],[[2,-2],0]) = false),
00118   assert(f([[1,-1,1],0],[[2,-2,-1],1]) = true),
00119   true)$
00120 
00121 okltest_equiv_prt(f) := (
00122   assert(f([],[]) = true),
00123   assert(f([],[1]) = false),
00124   assert(f([1],[]) = false),
00125   assert(f([1],[1]) = true),
00126   assert(f([1],[-1]) = false),
00127   assert(f([1,2],[-1,-2]) = true),
00128   assert(f([-1,2],[1,-2]) = true),
00129   true)$
00130 
00131 okltest_addgprt2prt(f) := (
00132   assert(f([]) = []),
00133   assert(f([[[],0]]) = []),
00134   assert(f([[[],1]]) = false),
00135   assert(f([[[1],0],[[1],0]]) = []),
00136   assert(f([[[1],0],[[-1],1]]) = []),
00137   assert(f([[[1],0],[[-1],0]]) = false),
00138   assert(f([[[1,2],0],[[1,2],1]]) = false),
00139   assert(f([[[1,2],0],[[-1,2],1]]) = []),
00140   assert(f([[[1,2,3],0],[[-1,2,4],1]]) = [3,4]),
00141   assert(f([[[1,2,3],0],[[-1,-2,4],1]]) = [-3,4]),
00142   assert(f([[[1,2,3],0],[[-1,-2,4,4],1]]) = [-3]),
00143   true)$
00144 
00145 okltest_addprt2prt(f) := (
00146   assert(okltest_addgprt2prt(buildq([f], lambda([L], block([S:map(gprt2prt,L)], if member(false,S) then false else f(S))))) = true),
00147   assert(f([[1,2],[-1,-2]]) = []),
00148   assert(f([[1,2],[-1,2]]) = false),
00149   true)$
00150 
00151 
00152 /* **********************************
00153    * Translating parity constraints *
00154    **********************************
00155 */
00156 
00157 okltest_prt2cl_0(f) := (
00158   assert(okltest_even_parity_wv_cl(f) = true),
00159   assert(f([-1]) = [{1}]),
00160   assert(f([1]) = [{-1}]),
00161   assert(f([-1,-2]) = [{-2,1},{-1,2}]),
00162   assert(f([1,-2]) = [{-2,-1},{1,2}]),
00163   assert(f([1,2,3]) = [{-3,-2,-1}, {-3, 2, 1}, {3, -2, 1}, {3, 2, -1}]),
00164   assert(f([-4,-5,-6]) = [{-6,-5,4},{-6,5,-4},{6,-5,-4},{4,5,6}]),
00165   assert(f([-6,-5,-4]) = [{-6,-5,4},{-6,5,-4},{6,-5,-4},{4,5,6}]),
00166   true)$
00167 
00168 okltest_prt2cl_aux_1(f) := (
00169   assert(f([],[]) = []),
00170   assert(f([5],[]) = [{-5}]),
00171   assert(f([-2,3],[]) = [{-3,-2},{2,3}]),
00172   assert(f([1,2,3],[4]) = [{-1,-2,-4},{1,2,-4},{1,-2,4},{-1,2,4}, {-4,3},{-3,4}]),
00173   assert(f([1,2,3,4],[5,6]) = [{-1,-2,-5},{1,2,-5},{1,-2,5},{-1,2,5}, {-5,-6,-3},{-6,5,3},{-5,6,3},{-3,5,6}, {-6,4},{-4,6}]),
00174   true)$
00175 
00176 okltest_gen_2xor_fcl(f) := (
00177   assert(f(0) = [[],[{}]]),
00178   assert(f(1) = [[1],[{-1},{1}]]),
00179   assert(f(2) = [[1,2],[{-1,-2},{-1,2},{-2,1},{1,2}]]),
00180   assert(f(3) = [[1,2,3,4,5],[{-1,-2,-4},{1,2,-4},{1,-2,4},{-1,2,4},{-4,3},{-3,4}, {-1,-2,-5},{1,2,-5},{1,-2,5},{-1,2,5},{-5,-3},{3,5}]]),
00181   assert(f(4) = [[1,2,3,4,5,6,7,8], [{-1,-2,-5},{1,2,-5},{1,-2,5},{-1,2,5}, {-5,-6,-3},{-6,5,3},{-5,6,3},{-3,5,6},{-6,4},{-4,6}, {-1,-2,-7},{1,2,-7},{1,-2,7},{-1,2,7}, {-7,-8,-3},{-8,7,3},{-7,8,3},{-3,7,8},{-8,-4},{4,8}]]),
00182   true)$
00183 
00184 okltest_seteqlit2cl(f) := (
00185   assert(f({}) = []),
00186   assert(f({1}) = []),
00187   assert(f({1,-1}) = [{}]),
00188   assert(f({1,2}) = [{-2,1},{-1,2}]),
00189   assert(f({1,2,3}) = [{-2,1},{-1,2},{-3,1},{-1,3}]),
00190   true)$
00191 
00192 okltest_gprt2s2cl_aux_2(f) := (
00193   assert(f([[],0],[],[[],0],[],[]) = []),
00194   assert(f([[],1],[],[[],0],[],[]) = [{}]),
00195   assert(f([[],0],[],[[],1],[],[]) = [{}]),
00196   assert(f([[1],0],[],[[-1],0],[],[]) = [{}]),
00197   assert(f([[1],0],[],[[1],1],[],[]) = [{}]),
00198   assert(f([[1,2],0],[],[[1,-2],0],[],[]) = [{}]),
00199   assert(f([[1,2,3],0],[],[[1,2,-3],0],[],[]) = [{}]),
00200   assert(f([[3,2,1],0],[],[[-3,2,1],0],[],[]) = [{}]),
00201   assert(f([[3,2,1],0],[],[[1,2,-3],0],[],[]) = [{}]),
00202   assert(f([[1,2,3],0],[],[[1,-2,3],0],[],[]) = [{}]),
00203   assert(f([[1,2,3],0],[],[[-1,2,3],0],[],[]) = [{}]),
00204   assert(f([[-1,-2,-3],0],[],[[1,-2,-3],0],[],[]) = [{}]),
00205   assert(f([[-1,-2,-3],0],[],[[-1,2,-3],0],[],[]) = [{}]),
00206   assert(f([[1,2],0],[],[[1,2],0],[],[]) = [{-2,1},{-1,2},{-2,1},{-1,2}]),
00207   assert(f([[1,2],0],[],[[1,3],0],[],[]) = [{-2,1},{-1,2},{-3,1},{-1,3},{-3,2},{-2,3}]),
00208   assert(f([[1,2,3],0],[5],[[1,2,4],0],[6],[]) = [{-5,-2,-1},{-5,1,2},{-2,1,5},{-1,2,5},{-5,3},{-3,5},{-6,-2,-1},{-6,2,1},{-2,1,6},{-1,2,6},{-6,4},{-4,6},{-4,3},{-3,4}]),
00209   assert(f([[1,2,3,4],0],[6,7],[[1,2,5],0],[8],[9]) = [{-6,-2,-1},{-6,1,2},{-2,1,6},{-1,2,6},{-7,-3,-6},{-7,6,3},{-6,3,7},{-3,6,7},{-7,4},{-4,7},{-8,-2,-1},{-8,2,1},{-2,1,8},{-1,2,8},{-8,5},{-5,8},{-9,-4,-3},{-9,3,4},{-4,3,9},{-3,4,9},{-9,5},{-5,9}]),
00210   assert(f([[1,2,3,-4],1],[6,7],[[1,2,-5],1],[8],[9]) = [{-6,-2,-1},{-6,1,2},{-2,1,6},{-1,2,6},{-7,-3,-6},{-7,6,3},{-6,3,7},{-3,6,7},{-7,4},{-4,7},{-8,-2,-1},{-8,2,1},{-2,1,8},{-1,2,8},{-8,5},{-5,8},{-9,-4,-3},{-9,3,4},{-4,3,9},{-3,4,9},{-9,5},{-5,9}]),
00211   assert(f([[-1,2,3,4],0],[6,7],[[1,2,5],0],[8],[9]) = [{-6,-2,1},{-6,-1,2},{-2,-1,6},{1,2,6},{-7,-3,-6},{-7,6,3},{-6,3,7},{-3,6,7},{-7,4},{-4,7},{-8,-2,-1},{-8,2,1},{-2,1,8},{-1,2,8},{-8,5},{-5,8},{-9,-4,3},{-9,-3,4},{-4,-3,9},{3,4,9},{-9,5},{-5,9}]),
00212   assert(f([[1,-2,3,4],0],[6,7],[[1,2,5],0],[8],[9]) = [{-6,-2,1},{-6,-1,2},{-2,-1,6},{1,2,6},{-7,-3,-6},{-7,6,3},{-6,3,7},{-3,6,7},{-7,4},{-4,7},{-8,-2,-1},{-8,2,1},{-2,1,8},{-1,2,8},{-8,5},{-5,8},{-9,-4,3},{-9,-3,4},{-4,-3,9},{3,4,9},{-9,5},{-5,9}]),
00213   assert(f([[1,2,3,-4],0],[6,7],[[1,2,5],0],[8],[9]) = [{-6,-2,1},{-6,-1,2},{-2,-1,6},{1,2,6},{-7,-3,-6},{-7,6,3},{-6,3,7},{-3,6,7},{-7,4},{-4,7},{-8,-2,-1},{-8,2,1},{-2,1,8},{-1,2,8},{-8,5},{-5,8},{-9,-4,3},{-9,-3,4},{-4,-3,9},{3,4,9},{-9,5},{-5,9}]),
00214   assert(f([[1,2,3,4],1],[6,7],[[1,2,5],0],[8],[9]) = [{-6,-2,1},{-6,-1,2},{-2,-1,6},{1,2,6},{-7,-3,-6},{-7,6,3},{-6,3,7},{-3,6,7},{-7,4},{-4,7},{-8,-2,-1},{-8,2,1},{-2,1,8},{-1,2,8},{-8,5},{-5,8},{-9,-4,3},{-9,-3,4},{-4,-3,9},{3,4,9},{-9,5},{-5,9}]),
00215   assert(f([[1,2,3,4],0],[6,7],[[-1,2,5],0],[8],[9]) = [{-6,-2,-1},{-6,1,2},{-2,1,6},{-1,2,6},{-7,-3,-6},{-7,6,3},{-6,3,7},{-3,6,7},{-7,4},{-4,7},{-8,-2,1},{-8,2,-1},{-2,-1,8},{1,2,8},{-8,5},{-5,8},{-9,-4,3},{-9,-3,4},{-4,-3,9},{3,4,9},{-9,5},{-5,9}]),
00216   assert(f([[1,2,3,4],0],[6,7],[[1,2,-5],0],[8],[9]) = [{-6,-2,-1},{-6,1,2},{-2,1,6},{-1,2,6},{-7,-3,-6},{-7,6,3},{-6,3,7},{-3,6,7},{-7,4},{-4,7},{-8,-2,1},{-8,2,-1},{-2,-1,8},{1,2,8},{-8,5},{-5,8},{-9,-4,3},{-9,-3,4},{-4,-3,9},{3,4,9},{-9,5},{-5,9}]),
00217   assert(f([[1,2,3,4],0],[6,7],[[1,2,5],1],[8],[9]) = [{-6,-2,-1},{-6,1,2},{-2,1,6},{-1,2,6},{-7,-3,-6},{-7,6,3},{-6,3,7},{-3,6,7},{-7,4},{-4,7},{-8,-2,1},{-8,2,-1},{-2,-1,8},{1,2,8},{-8,5},{-5,8},{-9,-4,3},{-9,-3,4},{-4,-3,9},{3,4,9},{-9,5},{-5,9}]),
00218   true)$
00219 
00220 okltest_gprt2s2cl_aux_s(f) := (
00221   assert(okltest_prt2cl_aux_1(buildq([f], lambda([P,aux], f([P,0],aux,[[],0],[])))) = true),
00222   assert(okltest_prt2cl_aux_1(buildq([f], lambda([P,aux], f([[],0],[],[P,0],aux)))) = true),
00223   assert(okltest_prt2cl_aux_1(buildq([f], lambda([P,aux], f([P,0],aux,[P,0],aux)))) = true),
00224   assert(f([[],1],[],[[],0],[]) = [{}]),
00225   assert(f([[],0],[],[[],1],[]) = [{}]),
00226   assert(f([[1,2,3,4],0],[5,6],[[7,8,9,10],0],[11,12]) = [{-1,-2,-5},{1,2,-5},{1,-2,5},{-1,2,5},{-5,-6,-3},{-6,5,3},{-5,6,3},{-3,5,6},{-6,4},{-4,6}, {-7,-8,-11},{7,8,-11},{7,-8,11},{-7,8,11},{-11,-12,-9},{-12,11,9},{-11,12,9},{-9,11,12},{-12,10},{-10,12}]),
00227   assert(f([[1],0],[],[[1],1],[]) = [{}]),
00228   assert(f([[1],0],[],[[1],0],[]) = [{-1}]),
00229   assert(f([[1,2],0],[],[[1,-2],0],[]) = [{}]),
00230   assert(f([[1,2],0],[],[[1,3],0],[]) = [{-2,1},{-1,2},{-3,1},{-1,3}]),
00231   assert(f([[1,2],0],[],[[1,2,4],0],[]) = [{-2,1},{-1,2},{-4}]),
00232   assert(f([[1,2],1],[],[[1,2,4],0],[]) = [{-2,-1},{1,2},{4}]),
00233   assert(f([[1,2],1],[],[[1,2,-4],0],[]) = [{-2,-1},{1,2},{-4}]),
00234   assert(f([[1,2],1],[],[[1,2,-4],1],[]) = [{-2,-1},{1,2},{4}]),
00235   assert(f([[1,-2],1],[],[[1,2,-4],1],[]) = [{-2,1},{-1,2},{-4}]),
00236   assert(f([[1,-2],1],[],[[-1,2,-4],1],[]) = [{-2,1},{-1,2},{4}]),
00237   assert(f([[1,-2,3],1],[5],[[-1,2,-4],1],[]) = [{-1,-2,-5},{-5,1,2},{-2,1,5},{-1,2,5},{-5,3},{-3,5}, {-5,-4},{4,5}]),
00238   assert(f([[1,-2,-3],1],[5],[[-1,2,-4],1],[]) = [{-1,-2,-5},{-5,1,2},{-2,1,5},{-1,2,5},{-5,-3},{3,5}, {-5,-4},{4,5}]),
00239   assert(f([[1,-2,3,4],1],[6,7],[[-1,2,3,-5],1],[]) = [{-1,-2,-6},{-6,1,2},{-2,1,6},{-1,2,6},{-3,-6,-7},{-7,3,6},{-6,3,7},{-3,6,7}, {-7,4},{-4,7}, {-5,-7},{5,7}]),
00240   assert(f([[1,2,3,4],0],[7,8],[[1,2,3,5,6],1],[9]) = [{-1,-2,-7},{-7,1,2},{-2,1,7},{-1,2,7},{-3,-7,-8},{-8,3,7},{-7,3,8},{-3,7,8},{-8,4},{-4,8}, {5,-6,-9},{-9,-5,6},{-5,-6,9},{5,6,9},{-9,8},{-8,9}]),
00241   assert(f([[1,-2,3,4],1],[7,8],[[-1,2,3,-5,6],1],[9]) = [{-1,-2,-7},{-7,1,2},{-2,1,7},{-1,2,7},{-3,-7,-8},{-8,3,7},{-7,3,8},{-3,7,8},{-8,4},{-4,8}, {5,-6,-9},{-9,-5,6},{-5,-6,9},{5,6,9},{-9,8},{-8,9}]),
00242   assert(f([[-1,2,3,4],1],[7,8],[[-1,2,3,-5,6],1],[9]) = [{-1,-2,-7},{-7,1,2},{-2,1,7},{-1,2,7},{-3,-7,-8},{-8,3,7},{-7,3,8},{-3,7,8},{-8,4},{-4,8}, {5,-6,-9},{-9,-5,6},{-5,-6,9},{5,6,9},{-9,8},{-8,9}]),
00243   assert(f([[4,2,3,-1],1],[7,8],[[-1,2,3,-5,6],1],[9]) = [{-1,-2,-7},{-7,1,2},{-2,1,7},{-1,2,7},{-3,-7,-8},{-8,3,7},{-7,3,8},{-3,7,8},{-8,4},{-4,8}, {5,-6,-9},{-9,-5,6},{-5,-6,9},{5,6,9},{-9,8},{-8,9}]),
00244   true)$
00245 
00246 okltest_sprt2cl_0(f) := (
00247   assert(okltest_prt2cl_0(buildq([f], lambda([P], f([P])))) = true),
00248   for n : 1 thru 5 do block([F:f([listn(n),endcons(-n,listn(n-1))])],
00249     assert(length(F) = 2^n),
00250     assert(setify(F) = full_cs(n))
00251   ),
00252   true)$
00253 
00254 okltest_sprt2cl_aux_1(f) := (
00255   assert(okltest_prt2cl_aux_1(buildq([f], lambda([P,a], f([[P,a]])))) = true),
00256   assert(okltest_gen_2xor_fcl(buildq([f], lambda([n], if n<=2 then full_fcl(n) else [listn(3*n-4),f([[listn(n),listmn(n+1,2*n-2)],[endcons(-n,listn(n-1)),listmn(2*n-1,3*n-4)]])]))) = true),
00257   true)$
00258 
00259 okltest_sprt2cl_aux_1e(f) := (
00260   assert(f([]) = []),
00261   assert(f([[[1],[]]]) = [{-1}]),
00262   assert(f([[[1,2,3],[4]],[[1,2,3],[5]]]) = [{-1,-2,-4},{-4,1,2},{-2,4,1},{-1,2,4},{-4,3},{-3,4},{-1,-2,-5},{-5,1,2},{-2,5,1},{-1,2,5},{-5,3},{-3,5},{-5,4},{-4,5}]),
00263   assert(f([[[1,2,3],[4]],[[1,2,-3],[5]]]) = [{-1,-2,-4},{-4,1,2},{-2,4,1},{-1,2,4},{-4,3},{-3,4},{-1,-2,-5},{-5,1,2},{-2,5,1},{-1,2,5},{-5,-3},{3,5},{-5,4},{-4,5}]),
00264   assert(f([[[1,2,3,6],[4,7]],[[1,2,-3,8],[5,9]]]) = [{-1,-2,-4},{-4,1,2},{-2,4,1},{-1,2,4},{-3,-4,-7},{-7,3,4},{-4,3,7},{-3,4,7},{-7,6},{-6,7},{-1,-2,-5},{-5,1,2},{-2,5,1},{-1,2,5},{3,-5,-9},{-9,-3,5},{-5,-3,9},{3,5,9},{-9,8},{-8,9}, {-7,-9},{7,9},{-5,4},{-4,5}]),
00265   assert(f([[[1,2,3,-6,10],[4,7,11]],[[1,2,-3,8,12],[5,9,13]]]) = [{-1,-2,-4},{-4,1,2},{-2,4,1},{-1,2,4},{-3,-4,-7},{-7,3,4},{-4,3,7},{-3,4,7},{6,-7,-11},{-11,-6,7},{-7,-6,11},{6,7,11},{-11,10},{-10,11}, {-1,-2,-5},{-5,1,2},{-2,5,1},{-1,2,5},{3,-5,-9},{-9,-3,5},{-5,-3,9},{3,5,9},{-13,-9,-8},{-13,8,9},{-9,8,13},{-8,9,13},{-13,12},{-12,13}, {-7,-9},{7,9},{-5,4},{-4,5}]),
00266   /* XXX */
00267   true)$
00268 
00269 okltest_closure_sprt(f) := (
00270   assert(f({}) = {}),
00271   assert(f({[]}) = {}),
00272   assert(f({[1]}) = {[1]}),
00273   assert(f({[-1]}) = {[-1]}),
00274   assert(f({[1],[-1]}) = {false}),
00275   assert(f({[1],[2]}) = {[1],[2],[1,2]}),
00276   assert(f({[1],[-2]}) = {[1],[-2],[-1,2]}),
00277   assert(f({[1,2],[-1,-2]}) = {[1,2]}),
00278   assert(f({[1,2],[1,-2]}) = {false}),
00279   assert(f({[1,2],[-2,3]}) = {[1,2],[-2,3],[-1,3]}),
00280   assert(f({[1],[2],[3]}) = {[1],[2],[3],[1,2],[1,3],[2,3],[1,2,3]}),
00281   assert(f({[1,4],[2,-4],[3]}) = {[1,4],[-2,4],[3],[-1,2],[1,3,4],[-2,3,4],[-1,2,3]}),
00282   /* XXX */
00283   true)$
00284 
00285