OKlibrary  0.2.1.6
Closures.mac
Go to the documentation of this file.
00001 /* Oliver Kullmann, 5.7.2008 (Swansea) */
00002 /* Copyright 2008, 2009 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/Algebra/Lisp/Groupoids/Constructions.mac")$
00023 
00024 
00025 /* Given a composition compo_ and a set S of elements (of the underlying
00026    gruppoid), compute the closure: */
00027 closure_bydef_grd(compo_,S) := block([S_old : {}],
00028   while length(S_old) < length(S) do (
00029     if oklib_monitor then print("Current size of closure is ", length(S)),
00030     S_old : S,
00031     S : union(S, complex_compo(compo_)(S,S))
00032   ),
00033   return(S_old))$
00034 
00035 /* The set of elements of a groupoid which are not representable as 
00036    compositions of other elements; these elements must be present
00037    in every generating set: */
00038 indecomposable_elements_bydef_grd(V) := block([U : V[1]],
00039   for x in U do
00040     for y in U do block([z : V[2](x,y)],
00041       if not elementp(z, {x,y}) then
00042         U : disjoin(z,U)),
00043   return(U))$
00044