OKlibrary  0.2.1.6
Basics.mac
Go to the documentation of this file.
```00001 /* Oliver Kullmann, 26.5.2012 (Swansea) */
00002 /* Copyright 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/Hypergraphs/Lisp/Basics.mac")\$
00023 oklib_include("OKlib/ComputerAlgebra/DataStructures/Lisp/Lists.mac")\$
00024
00025
00026 /* ***********************
00027    * Fundamental notions *
00028    ***********************
00029 */
00030
00031 /* Checking whether S (a set of sets) fulfils the "augmentation property"
00032    (also "exchange property"):
00033 */
00034 augmentation_ss_p(S) := block(
00035 [A : sort_length_part_ary(listify(disjoin({},S))), l, found : true],
00036  l : A[0],
00037  for i : 1 thru l-1 while found do
00038   for a in A[i] while found do
00039    for j : i+1 thru l while found do
00040     for b in A[j] while
00041      (found : some_s(lambda([x], elementp(adjoin(x,a),S)), setdifference(b,a)))
00042       do 0,
00043  found)\$
00044
00045 /* Checking whether M is a matroid given by the independent sets: */
00046 mtrins_p(M) := hg_p(M) and not emptyp(second(M)) and
00047  subsumption_closed_p(second(M)) and augmentation_ss_p(second(M))\$
00048
```