#%Format: latex
#% This file is marked for TeX processing
#[caption]"Computing $\pi_1$ with \GAP"
#================================================================
#: Relations arising from a region/singular vertex of a skeleton
#: "p" is the path from the basepoint to the region/vertex in question
#: "t" is the type specification of the region/vertex
#: "Rels*" functions return relators in \kwd{G} (see \file{common}), so that%
#:    the group $\pi_1$ should be defined \via\ %
#:    "g := G/Union(RelsA(...), RelsD(...), ...);"
#----------------------------------------------------------------
Reread("braid.txt");   #: (see \file{braid})
Reread("common.txt");  #: (see \file{common})
#: This function implements all others
_rels := function(p, b, t, gens)
 b := b*(S.1*S.2)^(3*t);    #: (see \kwd{Braid}, \kwd{BraidRelations} in \file{braid})
 return Braid(Path(p)^-1, G, BraidRelations(b, G, gens));
end;
#: $\bA_*$ ("t=0") and $\bD_*$ or worse ("t>0") type "n"-gonal region
RelsA := function(p, n) return _rels(p, S.1^n, 0, [G.2]); end;  #"Rels*"
RelsD := function(p, n, t) return _rels(p, S.1^n, t, [G.2, G.3]); end;
#: $\bE_*$ and worse type vertices
RelsE6 := function(p, t) return _rels(p, Path(x), t, [G.2, G.3]); end;
RelsE7 := function(p, t) return _rels(p, Path(y), t, [G.2, G.3]); end;
RelsE8 := function(p, t) return _rels(p, Path(x^2), t, [G.2, G.3]); end;
#: Useful shortcuts ("t=0" or "t=1")
A  := RelsA;
RA := function(p, n) return A(p, n)[1]; end; #: (as a single relator)
D  := function(p, n) return RelsD(p, n, 1); end;
E6 := function(p) return RelsE6(p, 1); end;
E7 := function(p) return RelsE7(p, 1); end;
E8 := function(p) return RelsE8(p, 1); end;
#================================================================
#[endinput]
