#% -*- GAP -*-
#% This file is marked for TeX processing
#[caption]"Computing $\pi_1$ with \GAP"
#================================================================
#: Relations arising from a region/singular vertex of a skeleton,%
#: see \autoref{s.strategy}
#: "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})
#: Braid monodromy: translate elements in "list" back to $e$
bm := function(p, list) return Braid(Path(p)^-1, G, list); end;
#: This function implements all others (see \kwd{BraidRelations} in \file{braid})
_rels := function(p, b, t, gens)
 return bm(p, BraidRelations(b*(S.1*S.2)^(3*t), G, gens));
end;
#: Type $\bA_*$ ("t=0"), $\bD_*$ ("t=1"), or worse ("t>1") "n"-gonal regions
RelsD := function(p, n, t) return _rels(p, S.1^n, t, [G.2, G.3]); end;
#: Simpler relations for type $\bA_*$ "n"-gonal regions: one is enough
RelsA := function(p, n) return _rels(p, S.1^n, 0, [G.2]); end;  #"Rels*"
#: Type $\bE_*$ ("t=1") and worse ("t>1") 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^-1), 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;    #: Type $\bA_*$ region
RA := function(p, n) return A(p, n)[1]; end;        #: (as a single relator)
D  := function(p, n) return RelsD(p, n, 1); end;    #: Type $\bD_*$ region
E6 := p -> RelsE6(p, 1);    #: Type $\bE_6$: monovalent \black-vertex
E7 := p -> RelsE7(p, 1);    #: Type $\bE_7$: monovalent \white-vertex
E8 := p -> RelsE8(p, 1);    #: Type $\bE_8$: bivalent \black-vertex
#================================================================
#[endinput]
