  
  [1m[4m[31m2. Basics[0m
  
  We  give some examples of semigroups to be used later. We also describe some
  basic functions that are not directly available from [1mGAP[0m, but are useful for
  the purposes of this package.
  
  
  [1m[4m[31m2.1 Examples[0m
  
  These are some examples of semigroups that will be used through this manual
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> f := FreeMonoid("a","b"); [0m
    [22m[35m<free monoid on the generators [ a, b ]> [0m
    [22m[35mgap> a := GeneratorsOfMonoid( f )[   1 ];; [0m
    [22m[35mgap> b := GeneratorsOfMonoid( f )[ 2 ];; [0m
    [22m[35mgap> r:=[[a^3,a^2],   [0m
    [22m[35m> [a^2*b,a^2], [0m
    [22m[35m> [b*a^2,a^2], [0m
    [22m[35m> [b^2,a^2], [0m
    [22m[35m> [a*b*a,a], [0m
    [22m[35m> [b*a*b,b] ]; [0m
    [22m[35m[ [ a^3, a^2 ], [ a^2*b, a^2 ], [ b*a^2, a^2 ], [ b^2, a^2 ], [ a*b*a, a ], [0m
    [22m[35m[ b*a*b, b ] ] [0m
    [22m[35mgap> b21:= f/r; [0m
    [22m[35m<fp semigroup on the generators [<identity ... >, a, b ]> [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> f := FreeSemigroup("a","b"); [0m
    [22m[35m<free semigroup on the generators [ a, b ]>   [0m
    [22m[35mgap> a := GeneratorsOfSemigroup( f )[ 1 ];; [0m
    [22m[35mgap> b :=   GeneratorsOfSemigroup( f )[ 2 ];; [0m
    [22m[35mgap> r:=[[a^3,a^2], [0m
    [22m[35m> [a^2*b,a^2],   [0m
    [22m[35m> [b*a^2,a^2], [0m
    [22m[35m> [b^2,a^2], [0m
    [22m[35m> [a*b*a,a], [0m
    [22m[35m> [b*a*b,b] ]; [0m
    [22m[35m[ [ a^3, a^2 ], [ a^2*b, a^2 ], [ b*a^2, a^2 ], [ b^2, a^2 ], [ a*b*a, a ], [0m
    [22m[35m[ b*a*b, b ] ] [0m
    [22m[35mgap> b2:= f/r; [0m
    [22m[35m<fp semigroup on the generators [ a, b ]> [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> g0:=Transformation([4,1,2,4]);;[0m
    [22m[35mgap> g1:=Transformation([1,3,4,4]);;[0m
    [22m[35mgap> g2:=Transformation([2,4,3,4]);;[0m
    [22m[35mgap> poi3:= Monoid(g0,g1,g2);[0m
    [22m[35m<monoid with 3 generators>[0m
    [22m[35m     [0m
  [22m[35m------------------------------------------------------------------[0m
  
  
  [1m[4m[31m2.2 Some attributes[0m
  
  These functions are semigroup attributes that get stored once computed.
  
  [1m[4m[31m2.2-1 HasCommutingIdempotents[0m
  
  [1m[34m> HasCommutingIdempotents( [0m[22m[34mM[0m[1m[34m ) ____________________________________[0mattribute
  
  Tests whether the idempotents of the semigroup [22m[34mM [0mcommute.
  
  [1m[4m[31m2.2-2 IsInverseSemigroup[0m
  
  [1m[34m> IsInverseSemigroup( [0m[22m[34mS[0m[1m[34m ) _________________________________________[0mattribute
  
  Tests  whether  a  finite  semigroup  [22m[34mS [0mis inverse. It is well-known that it
  suffices  to test whether the idempotents of [22m[34mS [0mcommute and [22m[34mS [0mis regular. The
  function [22m[32mIsRegularSemigroup [0mis part of [1mGAP[0m.
  
  
  [1m[4m[31m2.3 Some basic functions[0m
  
  [1m[4m[31m2.3-1 PartialTransformation[0m
  
  [1m[34m> PartialTransformation( [0m[22m[34mL[0m[1m[34m ) _______________________________________[0mfunction
  
  A  partial  transformation is a partial function of a set of integers of the
  form  {1,  ...,  n}.  It  is given by means of the list of images [22m[34mL[0m. When an
  element  has  no  image,  we write 0. Returns a full transformation on a set
  with one more element that acts like a zero.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> PartialTransformation([2,0,4,0]);[0m
    [22m[35mTransformation( [ 2, 5, 4, 5, 5 ] )[0m
    [22m[35m      [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m2.3-2 SemigroupFactorization[0m
  
  [1m[34m> SemigroupFactorization( [0m[22m[34mS, L[0m[1m[34m ) ___________________________________[0mfunction
  
  [22m[34mL[0m  is an element (or list of elements) of the semigroup [22m[34mS[0m. Returns a minimal
  factorization  on the generators of [22m[34mS[0m of the element(s) of [22m[34mL[0m. Works only for
  transformation semigroups.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> el1 := Transformation( [ 2, 3, 4, 4 ] );;[0m
    [22m[35mgap> el2 := Transformation( [ 2, 4, 3, 4 ] );;[0m
    [22m[35mgap> f1 := SemigroupFactorization(poi3,el1);[0m
    [22m[35m[ [ Transformation( [ 1, 3, 4, 4 ] ), Transformation( [ 2, 4, 3, 4 ] ) ] ][0m
    [22m[35mgap> f1[1][1] * f1[1][2] = el1;[0m
    [22m[35mtrue[0m
    [22m[35mgap> SemigroupFactorization(poi3,[el1,el2]);[0m
    [22m[35m[ [ Transformation( [ 1, 3, 4, 4 ] ), Transformation( [ 2, 4, 3, 4 ] ) ],[0m
    [22m[35m  [ Transformation( [ 2, 4, 3, 4 ] ) ] ][0m
  [22m[35m------------------------------------------------------------------[0m
  
  
  [1m[4m[31m2.4 Cayley graphs[0m
  
  [1m[4m[31m2.4-1 RightCayleyGraph[0m
  
  [1m[34m> RightCayleyGraph( [0m[22m[34mS[0m[1m[34m ) ____________________________________________[0mfunction
  
  Computes  the  right Cayley graph of a finite monoid or semigroup [22m[34mS[0m. It uses
  the  [1mGAP[0m  buit-in  function [22m[32mCayleyGraphSemigroup[0m to compute the Cayley Graph
  and  returns  it  as  an  automaton  without  initial  and final states. The
  [1mAutomata[0m is used to this effect
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> rcg := RightCayleyGraph(b21);[0m
    [22m[35m< deterministic automaton on 2 letters with 6 states >[0m
    [22m[35mgap> Display(rcg);[0m
    [22m[35m   |  1  2  3  4  5  6[0m
    [22m[35m-----------------------[0m
    [22m[35m a |  2  4  6  4  2  4[0m
    [22m[35m b |  3  5  4  4  4  3[0m
    [22m[35mInitial state:   [ ][0m
    [22m[35mAccepting state: [ ][0m
    [22m[35m      [0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m2.4-2 RightCayleyGraphMonoid[0m
  
  [1m[34m> RightCayleyGraphMonoid( [0m[22m[34mS[0m[1m[34m ) ______________________________________[0mfunction
  
  This function is a synonym of [1m[34mRightCayleyGraph[0m ([1m2.4-1[0m).
  
