OKlibrary  0.2.1.6
BasicNotions.mac
Go to the documentation of this file.
00001 /* Oliver Kullmann, 9.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/DataStructures/Lisp/Lists.mac")$
00023 
00024 
00025 /* Operations are denoted by "opr".
00026    (Attention: "op" is a built-in Maxima-operation.)
00027 */
00028 /* Left-operations are the default. */
00029 
00030 
00031 /* ***********************************
00032    * Testing the defining properties *
00033    ***********************************
00034 */
00035 
00036 
00037 /* Testing whether opr is an operation of groupoid V on set X: */
00038 opr_grdset_p(opr,V,X) := block([counterexample : false],
00039  for a in V[1] unless counterexample do
00040   for b in V[1] unless counterexample do
00041    for x in X unless counterexample do
00042      if opr(V[2](a,b),x) # opr(a, opr(b,x)) then counterexample : true,
00043  return(not counterexample))$
00044 
00045 /* Testing whether opr is an operation of unital groupoid V on set X: */
00046 opr_ugrdset_p(opr,V,X) := 
00047   every_s(lambda([x],is(opr(V[3],x)=x)), X) and opr_grdset_p(opr,V,X)$
00048 
00049 
00050 /* *******************
00051    * Transformations *
00052    *******************
00053 */
00054 
00055 /* A left-operation as a homomorphism into the transformation semigroup,
00056    using maps: */
00057 opr2trf_m(opr) := buildq([opr],
00058   lambda([v], lambda([x], opr(v,x))))$
00059 /* Now assuming that X = {1, ..., n}, and representing transformations
00060    as lists: */
00061 opr2trf_l(opr,n) := buildq([opr,n],
00062   lambda([v], create_list(opr(v,i), i,1,n)))$
00063