% generated by GAPDoc2LaTeX from XML source (Frank Luebeck)
\documentclass[a4paper,11pt]{report}

\usepackage{a4wide}
\sloppy
\pagestyle{myheadings}
\usepackage{amssymb}
\usepackage[latin1]{inputenc}
\usepackage{makeidx}
\makeindex
\usepackage{color}
\definecolor{FireBrick}{rgb}{0.5812,0.0074,0.0083}
\definecolor{RoyalBlue}{rgb}{0.0236,0.0894,0.6179}
\definecolor{RoyalGreen}{rgb}{0.0236,0.6179,0.0894}
\definecolor{RoyalRed}{rgb}{0.6179,0.0236,0.0894}
\definecolor{LightBlue}{rgb}{0.8544,0.9511,1.0000}
\definecolor{Black}{rgb}{0.0,0.0,0.0}

\definecolor{linkColor}{rgb}{0.0,0.0,0.554}
\definecolor{citeColor}{rgb}{0.0,0.0,0.554}
\definecolor{fileColor}{rgb}{0.0,0.0,0.554}
\definecolor{urlColor}{rgb}{0.0,0.0,0.554}
\definecolor{promptColor}{rgb}{0.0,0.0,0.589}
\definecolor{brkpromptColor}{rgb}{0.589,0.0,0.0}
\definecolor{gapinputColor}{rgb}{0.589,0.0,0.0}
\definecolor{gapoutputColor}{rgb}{0.0,0.0,0.0}

%%  for a long time these were red and blue by default,
%%  now black, but keep variables to overwrite
\definecolor{FuncColor}{rgb}{0.0,0.0,0.0}
%% strange name because of pdflatex bug:
\definecolor{Chapter }{rgb}{0.0,0.0,0.0}
\definecolor{DarkOlive}{rgb}{0.1047,0.2412,0.0064}


\usepackage{fancyvrb}

\usepackage{mathptmx,helvet}
\usepackage[T1]{fontenc}
\usepackage{textcomp}


\usepackage[
            pdftex=true,
            bookmarks=true,        
            a4paper=true,
            pdftitle={Written with GAPDoc},
            pdfcreator={LaTeX with hyperref package / GAPDoc},
            colorlinks=true,
            backref=page,
            breaklinks=true,
            linkcolor=linkColor,
            citecolor=citeColor,
            filecolor=fileColor,
            urlcolor=urlColor,
            pdfpagemode={UseNone}, 
           ]{hyperref}

\newcommand{\maintitlesize}{\fontsize{50}{55}\selectfont}

% write page numbers to a .pnr log file for online help
\newwrite\pagenrlog
\immediate\openout\pagenrlog =\jobname.pnr
\immediate\write\pagenrlog{PAGENRS := [}
\newcommand{\logpage}[1]{\protect\write\pagenrlog{#1, \thepage,}}
%% were never documented, give conflicts with some additional packages

\newcommand{\GAP}{\textsf{GAP}}

%% nicer description environments, allows long labels
\usepackage{enumitem}
\setdescription{style=nextline}

%% depth of toc
\setcounter{tocdepth}{1}





%% command for ColorPrompt style examples
\newcommand{\gapprompt}[1]{\color{promptColor}{\bfseries #1}}
\newcommand{\gapbrkprompt}[1]{\color{brkpromptColor}{\bfseries #1}}
\newcommand{\gapinput}[1]{\color{gapinputColor}{#1}}


\begin{document}

\logpage{[ 0, 0, 0 ]}
\begin{titlepage}
\mbox{}\vfill

\begin{center}{\maintitlesize \textbf{\textsf{Kan}\mbox{}}}\\
\vfill

\hypersetup{pdftitle=\textsf{Kan}}
\markright{\scriptsize \mbox{}\hfill \textsf{Kan} \hfill\mbox{}}
{\Huge \textbf{A package for Induced Category Actions\mbox{}}}\\
\vfill

{\Huge Version 1.25\mbox{}}\\[1cm]
{18/02/2016\mbox{}}\\[1cm]
\mbox{}\\[2cm]
{\Large \textbf{ Anne Heyworth \mbox{}}}\\
{\Large \textbf{ Chris Wensley    \mbox{}}}\\
\hypersetup{pdfauthor= Anne Heyworth ;  Chris Wensley    }
\end{center}\vfill

\mbox{}\\
{\mbox{}\\
\small \noindent \textbf{ Chris Wensley    }  Email: \href{mailto://c.d.wensley@bangor.ac.uk} {\texttt{c.d.wensley@bangor.ac.uk}}\\
  Homepage: \href{http://pages.bangor.ac.uk/~mas023/} {\texttt{http://pages.bangor.ac.uk/\texttt{\symbol{126}}mas023/}}\\
  Address: \begin{minipage}[t]{8cm}\noindent
 School of Computer Science, Bangor University,\\
 Dean Street, Bangor, Gwynedd, LL57 1UT, U.K. \end{minipage}
}\\
\end{titlepage}

\newpage\setcounter{page}{2}
{\small 
\section*{Abstract}
\logpage{[ 0, 0, 1 ]}
 The \textsf{Kan} package was originally implemented in 1996 using the \textsf{GAP} 3 language, to compute induced actions of categories, when the first author
was studying for a Ph.D. in Bangor. 

 This reduced version only provides functions for the computation of normal
forms of representatives of double cosets of finitely presented groups. 

 \textsf{Kan} became an accepted \textsf{GAP} package in May 2015. 

 Bug reports, suggestions and comments are, of course, welcome. Please contact
the second author at \href{mailto://c.d.wensley@bangor.ac.uk} {\texttt{c.d.wensley@bangor.ac.uk}}. \mbox{}}\\[1cm]
{\small 
\section*{Copyright}
\logpage{[ 0, 0, 2 ]}
 \index{License} {\copyright} 1996-2016 Anne Heyworth and Chris Wensley 

 \textsf{kan} is free software; you can redistribute it and/or modify it under the terms of
the \href{http://www.fsf.org/licenses/gpl.html} {GNU General Public License} as published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version. \mbox{}}\\[1cm]
{\small 
\section*{Acknowledgements}
\logpage{[ 0, 0, 3 ]}
 This documentation was prepared with the \textsf{GAPDoc} package of Frank L{\"u}beck and Max Neunh{\"o}ffer. \mbox{}}\\[1cm]
\newpage

\def\contentsname{Contents\logpage{[ 0, 0, 4 ]}}

\tableofcontents
\newpage

       
\chapter{\textcolor{Chapter }{Introduction}}\label{intro}
\logpage{[ 1, 0, 0 ]}
\hyperdef{L}{X7DFB63A97E67C0A1}{}
{
  The \textsf{Kan} package started out as part of Anne Heyworth's thesis \cite{anne-thesis}, and was designed to compute induced actions of categories (see also \cite{BrHe}). 

 This version of \textsf{Kan} only provides functions for the computation of normal forms of representatives
of double cosets of finitely presented groups, and is made available in
support of the paper \cite{BrGhHeWe}. Existing methods for computing double cosets in \textsf{GAP} are described in \cite{SteveL}. 

 The package is loaded into \textsf{GAP} with the command 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@LoadPackage( "kan" ); |
  
\end{Verbatim}
 The package may be obtained as a compressed tar file \texttt{kan-1.25.tar.gz} by ftp from one of the following sites: 
\begin{itemize}
\item  any \textsf{GAP} archive, e.g. \href{http://www.gap-system.org/Packages/packages.html} {\texttt{http://www.gap-system.org/Packages/packages.html}}; 
\item  the Bangor site: \href{http://www.maths.bangor.ac.uk/chda/gap4/kan/kan.html} {\texttt{http://www.maths.bangor.ac.uk/chda/gap4/kan/kan.html}}; 
\end{itemize}
 Alternatively, fork the GitHub repository: \href{https://github.com/gap-packages/kan} {\texttt{https://github.com/gap-packages/kan}}. 

 Some of the functions in the \textsf{automata} package are used to compute word acceptors and regular expressions for the
languages they accept. 

 The \textsf{kbmag} package is also used to compute a word acceptor of a group \texttt{G} when \texttt{G} has no finite rewriting system. If \textsf{kbmag} is not available (the user is not on a UNIX system, or the C-programs have not
been compiled), the file \texttt{dckbmag.gi} will not be read, so methods for the functions detailed in section 2.4.1 will
not be available. 

 Once the package is loaded, it is possible to check the installation is
correct by running a test file of the manual examples with the following
command. (The test file itself is \texttt{tst/fulltest.tst} or \texttt{tst/parttest.tst}, depending whether or not \textsf{kbmag} is available.) 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@ReadPackage( "kan", "tst/testall.g" );|
  #I  Testing /Applications/gap/my-dev/pkg/kan/tst/fulltest.tst
  #I  No errors detected while testing package kan
  true
  
\end{Verbatim}
 

 The information parameter \texttt{InfoKan} takes default value \texttt{0}. When raised to a higher value, additional information is printed out. 

 Once the package is loaded, the manual \texttt{doc/manual.pdf} can be found in the documentation folder. The \texttt{html} versions, with or without MathJax, may be rebuilt as follows. 

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@InfoLevel( InfoKan );|
  0
  !gapprompt@gap>| !gapinput@ReadPackage( "kan, "makedocrel.g" ); |
  
\end{Verbatim}
 

 Please send bug reports, suggestions and other comments to the second author,
or use the GitHub issue tracker at \href{https://github.com/gap-packages/kan/issues/new} {\texttt{https://github.com/gap-packages/kan/issues/new}}. 

 Additional information can be found on the \emph{Computational Higher-dimensional Discrete Algebra} website at \href{http://pages.bangor.ac.uk/~mas023/chda/} {\texttt{http://pages.bangor.ac.uk/\texttt{\symbol{126}}mas023/chda/}}. }

       
\chapter{\textcolor{Chapter }{Double Coset Rewriting Systems}}\label{chap-dcrws}
\logpage{[ 2, 0, 0 ]}
\hyperdef{L}{X7F197C8D835A6F45}{}
{
  The \textsf{Kan} package provides functions for the computation of normal forms for double
coset representatives of finitely presented groups. The first version of the
package was released to support the paper \cite{BrGhHeWe}, which describes the algorithms used in this package. 
\section{\textcolor{Chapter }{Rewriting Systems}}\logpage{[ 2, 1, 0 ]}
\hyperdef{L}{X7CA8FCFD81AA1890}{}
{
 

\subsection{\textcolor{Chapter }{KnuthBendixRewritingSystem}}
\logpage{[ 2, 1, 1 ]}\nobreak
\hyperdef{L}{X87A3823483E4FF86}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{KnuthBendixRewritingSystem({\mdseries\slshape grp, gensorder, ordering, alph})\index{KnuthBendixRewritingSystem@\texttt{KnuthBendixRewritingSystem}}
\label{KnuthBendixRewritingSystem}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{ReducedConfluentRewritingSystem({\mdseries\slshape grp, gensorder, ordering, limit})\index{ReducedConfluentRewritingSystem@\texttt{ReducedConfluentRewritingSystem}}
\label{ReducedConfluentRewritingSystem}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{DisplayRwsRules({\mdseries\slshape rws})\index{DisplayRwsRules@\texttt{DisplayRwsRules}}
\label{DisplayRwsRules}
}\hfill{\scriptsize (operation)}}\\


 Methods for \texttt{KnuthBendixRewritingSystem} and \texttt{ReducedConfluentRewritingSystem} are supplied which apply to a finitely presented group. These start by calling \texttt{IsomorphismFpMonoid} and then work with the resulting monoid. The parameter \texttt{gensorder} will normally be \texttt{"shortlex"} or \texttt{"wreath"}, while \texttt{ordering} is an integer list for reordering the generators, and \texttt{alph} is an alphabet string used when printing words. A \emph{partial} rewriting system may be obtained by giving a \texttt{limit} to the number of rules calculated. As usual, $A,B$ denote the inverses of $a,b$. 

 In the example the generators are by default ordered $[A,a,B,b]$, so the list \texttt{L1} is used to specify the order \texttt{[a,A,b,B]} to be used with the shortlex ordering. Specifying a limit \texttt{0} means that no limit is prescribed. }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@G1 := FreeGroup( 2 );;|
  !gapprompt@gap>| !gapinput@L1 := [2,1,4,3];;|
  !gapprompt@gap>| !gapinput@order := "shortlex";;|
  !gapprompt@gap>| !gapinput@alph1 := "AaBb";;|
  !gapprompt@gap>| !gapinput@rws1 := ReducedConfluentRewritingSystem( G1, L1, order, 0, alph1 );|
  Rewriting System for Monoid( [ f1, f1^-1, f2, f2^-1 ], ... ) with rules
  [ [ f1*f1^-1, <identity ...> ], [ f1^-1*f1, <identity ...> ],
    [ f2*f2^-1, <identity ...> ], [ f2^-1*f2, <identity ...> ] ]
  !gapprompt@gap>| !gapinput@DisplayRwsRules( rws1 );;|
  [ [ Aa, id ], [ aA, id ], [ Bb, id ], [ bB, id ] ]
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Example 1 -- free product of two cyclic groups}}\logpage{[ 2, 2, 0 ]}
\hyperdef{L}{X846F0B22859B601A}{}
{
 \index{example -- free product} 

\subsection{\textcolor{Chapter }{DoubleCosetRewritingSystem}}
\logpage{[ 2, 2, 1 ]}\nobreak
\hyperdef{L}{X825D1F4D85DE122D}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{DoubleCosetRewritingSystem({\mdseries\slshape grp, genH, genK, rws})\index{DoubleCosetRewritingSystem@\texttt{DoubleCosetRewritingSystem}}
\label{DoubleCosetRewritingSystem}
}\hfill{\scriptsize (function)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsDoubleCosetRewritingSystem({\mdseries\slshape dcrws})\index{IsDoubleCosetRewritingSystem@\texttt{IsDoubleCosetRewritingSystem}}
\label{IsDoubleCosetRewritingSystem}
}\hfill{\scriptsize (property)}}\\


 A \emph{double coset rewriting system} for the double cosets $H \backslash G / K$ requires as data a finitely presented group $G =$\texttt{grp}; generators \texttt{genH}, \texttt{genK} for subgroups $H, K$; and a rewriting system \texttt{rws} for $G$. 

 A simple example is given by taking $G$ to be the free group on two generators $a,b$, a cyclic subgroup $H$ with generator $a^6$, and a second cyclic subgroup $K$ with generator $a^4$. (Similar examples using different powers of $a$ are easily constructed.) Since \texttt{gcd(6,4)=2}, we have $Ha^2K=HK$, so the double cosets have representatives $[HK, HaK, Ha^iba^jK, Ha^ibwba^jK]$ where $i \in [0..5]$, $j \in [0..3]$, and $w$ is any word in $a,b$. 

 In the example the free group $G$ is converted to a four generator monoid with relations defining the inverse of
each generator, \texttt{[[Aa,id],[aA,id],[Bb,id],[bB,id]]}, where \texttt{id} is the empty word. The initial rules for the double coset rewriting system
comprise those of $G$ plus those given by the generators of $H,K$, which are $[[Ha^6,H],[a^4K,K]]$. In the complete rewrite system new rules involving $H$ or $K$ may arise, and there may also be rules involving both $H$ and $K$. 

 For this example, 
\begin{itemize}
\item  there are two $H$-rules, $[[Ha^4,HA^2],[HA^3,Ha^3]]$, 
\item  there are two $K$-rules, $[[a^3K,AK],[A^2K,a^2K]]$, 
\item  and there are two $H$-$K$-rules, $[[Ha^2K,HK],[HAK,HaK]]$. 
\end{itemize}
 Here is how the computation may be performed. }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@genG1 := GeneratorsOfGroup( G1 );;|
  !gapprompt@gap>| !gapinput@genH1 := [ genG1[1]^6 ];;|
  !gapprompt@gap>| !gapinput@genK1 := [ genG1[1]^4 ];;|
  !gapprompt@gap>| !gapinput@dcrws1 := DoubleCosetRewritingSystem( G1, genH1, genK1, rws1 );;|
  !gapprompt@gap>| !gapinput@IsDoubleCosetRewritingSystem( dcrws1 );|
  true
  !gapprompt@gap>| !gapinput@DisplayRwsRules( dcrws1 );;|
  G-rules:
  [ [ Aa, id ], [ aA, id ], [ Bb, id ], [ bB, id ] ]
  H-rules:
  [ [ Haaaa, HAA ],
    [ HAAA, Haaa ] ]
  K-rules:
  [ [ aaaK, AK ],
    [ AAK, aaK ] ]
  H-K-rules:
  [ [ HaaK, HK ],
    [ HAK, HaK ] ]
  
\end{Verbatim}
 

\subsection{\textcolor{Chapter }{WordAcceptorOfReducedRws}}
\logpage{[ 2, 2, 2 ]}\nobreak
\hyperdef{L}{X83FF05087E7B133A}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{WordAcceptorOfReducedRws({\mdseries\slshape rws})\index{WordAcceptorOfReducedRws@\texttt{WordAcceptorOfReducedRws}}
\label{WordAcceptorOfReducedRws}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{WordAcceptorOfDoubleCosetRws({\mdseries\slshape rws})\index{WordAcceptorOfDoubleCosetRws@\texttt{WordAcceptorOfDoubleCosetRws}}
\label{WordAcceptorOfDoubleCosetRws}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IsWordAcceptorOfDoubleCosetRws({\mdseries\slshape aut})\index{IsWordAcceptorOfDoubleCosetRws@\texttt{IsWordAcceptorOfDoubleCosetRws}}
\label{IsWordAcceptorOfDoubleCosetRws}
}\hfill{\scriptsize (property)}}\\


 Using functions from the \textsf{automata} package, we may 
\begin{itemize}
\item  compute a \emph{word acceptor} for the rewriting system of $G$; 
\item  compute a \emph{word acceptor} for the double coset rewriting system; 
\item  test a list of words to see whether they are recognised by the automaton; 
\item  obtain a rational expression for the language of the automaton. 
\end{itemize}
 }

 

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@waG1 := WordAcceptorOfReducedRws( rws1 );|
  Automaton("det",6,"aAbB",[ [ 1, 4, 1, 4, 4, 4 ], [ 1, 3, 3, 1, 3, 3 ], [ 1, 2,\
   2, 2, 1, 2 ], [ 1, 1, 5, 5, 5, 5 ] ],[ 6 ],[ 2, 3, 4, 5, 6 ]);;
  !gapprompt@gap>| !gapinput@wadc1 := WordAcceptorOfDoubleCosetRws( dcrws1 );|
  < deterministic automaton on 6 letters with 15 states >
  !gapprompt@gap>| !gapinput@Print( wadc1 );|
  Automaton("det",15,"HKaAbB",[ [ 2, 2, 2, 6, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ],\
   [ 2, 2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 2 ], [ 2, 2, 13, 2, 10, 5, 2, 13,\
   2, 7, 11, 11, 12, 2, 2 ], [ 2, 2, 9, 2, 2, 14, 2, 9, 15, 2, 2, 2, 2, 7, 15 ],\
   [ 2, 2, 2, 2, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 ], [ 2, 2, 3, 2, 3, 3, 3, 2, 3,\
   3, 3, 3, 3, 3, 3 ] ],[ 4 ],[ 1 ]);;
  !gapprompt@gap>| !gapinput@words1 := [ "HK","HaK","HbK","HAK","HaaK","HbbK","HabK","HbaK","HbaabK"];;|
  !gapprompt@gap>| !gapinput@valid1 := List( words1, w -> IsRecognizedByAutomaton( wadc1, w ) );|
  [ true, true, true, false, false, true, true, true, true ]
  !gapprompt@gap>| !gapinput@lang1 := FAtoRatExp( wadc1 );|
  ((H(aaaUAA)BUH(a(aBUB)UABUB))(a(a(aa*BUB)UB)UA(AA*BUB)UB)*(a(a(aa*bUb)Ub)UA(AA\
  *bUb))UH(aaaUAA)bUH(a(abUb)UAbUb))((a(a(aa*BUB)UB)UA(AA*BUB))(a(a(aa*BUB)UB)UA\
  (AA*BUB)UB)*(a(a(aa*bUb)Ub)UA(AA*bUb))Ua(a(aa*bUb)Ub)UA(AA*bUb)Ub)*((a(a(aa*BU\
  B)UB)UA(AA*BUB))(a(a(aa*BUB)UB)UA(AA*BUB)UB)*(a(aKUK)UAKUK)Ua(aKUK)UAKUK)U(H(a\
  aaUAA)BUH(a(aBUB)UABUB))(a(a(aa*BUB)UB)UA(AA*BUB)UB)*(a(aKUK)UAKUK)UH(aKUK)
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Example 2 -- the trefoil group}}\logpage{[ 2, 3, 0 ]}
\hyperdef{L}{X838CC08E7E92EBC0}{}
{
 \index{example -- trefoil group} \index{trefoil group} 

\subsection{\textcolor{Chapter }{PartialDoubleCosetRewritingSystem}}
\logpage{[ 2, 3, 1 ]}\nobreak
\hyperdef{L}{X83DE506B828F4B0D}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{PartialDoubleCosetRewritingSystem({\mdseries\slshape grp, Hgens, Kgens, rws, limit})\index{PartialDoubleCosetRewritingSystem@\texttt{PartialDoubleCosetRewritingSystem}}
\label{PartialDoubleCosetRewritingSystem}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{WordAcceptorOfPartialDoubleCosetRws({\mdseries\slshape grp, prws})\index{WordAcceptorOfPartialDoubleCosetRws@\texttt{WordAcceptorOfPartialDoubleCosetRws}}
\label{WordAcceptorOfPartialDoubleCosetRws}
}\hfill{\scriptsize (attribute)}}\\


 It may happen that, even when $G$ has a finite rewriting system, the double coset rewriting system is infinite.
This is the case with the trefoil group $T$ with generators $[x,y]$ and relator $[x^3 = y^2]$ when the wreath product ordering is used with $X > x > Y > y$. The group itself has a rewriting system with just 6 rules. }

 
\begin{Verbatim}[commandchars=!|H,fontsize=\small,frame=single,label=Example]
  
  !gapprompt|gap>H !gapinput|FT := FreeGroup( 2 );;H
  !gapprompt|gap>H !gapinput|relsT := [ FT.1^3*FT.2^-2 ];;  T := FT/relsT;;H
  !gapprompt|gap>H !gapinput|genT := GeneratorsOfGroup( T );;  x := genT[1];  y := genT[2];H
  !gapprompt|gap>H !gapinput|alphT := "XxYy";;  ordT := [4,3,2,1];;  orderT := "wreath";;H
  !gapprompt|gap>H !gapinput|rwsT := ReducedConfluentRewritingSystem( T, ordT, orderT, 0, alphT );;H
  !gapprompt|gap>H !gapinput|DisplayRwsRules( rwsT );;H
  [ [ Yy, id ], [ yY, id ], [ xxx, yy ], [ yyx, xyy ], [ X, xxYY ], [ Yx, yxYY ]\
   ]
  !gapprompt|gap>H !gapinput|accT := WordAcceptorOfReducedRws( rwsT );H
  < deterministic automaton on 4 letters with 7 states >
  !gapprompt|gap>H !gapinput|Print( "accT = ", accT );H
  accT = Automaton("det",7,"yYxX",[ [ 1, 2, 1, 5, 2, 5, 5 ], [ 1, 1, 3, 3, 1, 3,\
   3 ], [ 1, 1, 1, 7, 7, 1, 6 ], [ 1, 1, 1, 1, 1, 1, 1 ] ],[ 4 ],[ 2, 3, 4, 5, 6\
  , 7 ]);;
  !gapprompt|gap>H !gapinput|langT := FAtoRatExp( accT );H
  (yxUx)((xyUy)x)*((xyUy)(yy*U@)Ux(YY*U@)UYY*U@)Uy(yy*U@)UYY*U@
  !gapprompt|gap>H !gapinput|IsRecognizedByAutomaton( accT, "X" );H
  false
  !gapprompt|gap>H !gapinput|IsRecognizedByAutomaton( accT, "yxyxyxYY" );      H
  true
  
\end{Verbatim}
 In versions of \textsf{Kan}, from about 1.01 up to 1.21, the complementary automaton and language were
returned in the example above. This error has now been rectified. 

 In earlier versions of \textsf{Kan} (in 0.95 for example) a shorter rational expression for the language was
obtained from \textsf{Automata}. In what follows, we check that the two expressions define the same language. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@alph := AlphabetOfRatExpAsList( langT );; |
  !gapprompt@gap>| !gapinput@a1 := RatExpOnnLetters( alph, [ ], [1] );;   ## y|
  !gapprompt@gap>| !gapinput@a2 := RatExpOnnLetters( alph, [ ], [2] );;   ## Y|
  !gapprompt@gap>| !gapinput@a3 := RatExpOnnLetters( alph, [ ], [3] );;   ## x|
  !gapprompt@gap>| !gapinput@a4 := RatExpOnnLetters( alph, [ ], [4] );;   ## X|
  !gapprompt@gap>| !gapinput@s1 := RatExpOnnLetters( alph, "star", a1 );; ## y*|
  !gapprompt@gap>| !gapinput@s2 := RatExpOnnLetters( alph, "star", a2 );; ## Y*|
  !gapprompt@gap>| !gapinput@a1a3 := RatExpOnnLetters( alph, "product", [ a1, a3 ] );;  ## yx |
  !gapprompt@gap>| !gapinput@u1 := RatExpOnnLetters( alph, "union", [ a1a3, a3 ] );;    ## yxUx|
  !gapprompt@gap>| !gapinput@a3a1 := RatExpOnnLetters( alph, "product", [ a3, a1 ] );;  ## xy|
  !gapprompt@gap>| !gapinput@u2 := RatExpOnnLetters( alph, "union", [ a3a1, a1 ] );;    ## xyUy|
  !gapprompt@gap>| !gapinput@u2a3 := RatExpOnnLetters( alph, "product", [ u2, a3 ] );;  ## (xyUy)x|
  !gapprompt@gap>| !gapinput@su2a3 := RatExpOnnLetters( alph, "star", u2a3 );;          ## ((xyUy)x)*|
  !gapprompt@gap>| !gapinput@u2s1 := RatExpOnnLetters( alph, "product", [ u2, s1 ] );;  ## (xyUy)y*|
  !gapprompt@gap>| !gapinput@a3s2 := RatExpOnnLetters( alph, "product", [ a3, s2 ] );;  ## xY*|
  !gapprompt@gap>| !gapinput@u3 := RatExpOnnLetters( alph, "union", [u2s1,a3s2,s2] );; |
  !gapprompt@gap>| !gapinput@prod := RatExpOnnLetters( alph, "product", [u1,su2a3,u3] );;  |
  !gapprompt@gap>| !gapinput@a1s1 := RatExpOnnLetters( alph, "product", [ a1, s1 ] );;  ## yy*|
  !gapprompt@gap>| !gapinput@r := RatExpOnnLetters( alph, "union", [ prod, a1s1, s2] );|
  (yxUx)((xyUy)x)*((xyUy)y*UxY*UY*)Uyy*UY*
  !gapprompt@gap>| !gapinput@AreEqualLang( langT, r ); |
  true
  
\end{Verbatim}
 Taking subgroups $H$, $K$ to be generated by $x$ and $y$ respectively, the double coset rewriting system has an infinite number of $H$-rules. It turns out that only a finite number of these are needed to produce
the required automaton. The function \texttt{PartialDoubleCosetRewritingSystem} allows a limit to be specified on the number of rules to be computed. In the
listing below a limit of 20 is used, but in fact 10 is sufficient. 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@prwsT := PartialDoubleCosetRewritingSystem( T, [x], [y], rwsT, 20 );;|
  #I WARNING: reached supplied limit 20 on number of rules
  !gapprompt@gap>| !gapinput@DisplayRwsRules( prwsT );|
  G-rules:
  [ [ X, xxYY ], [ Yx, yxYY ], [ Yy, id ], [ yY, id ], [ xxx, yy ], [ yyx, xyy ]\
   ]
  H-rules:
  [ [ Hx, H ],
    [ HY, Hy ],
    [ Hyy, H ],
    [ Hyxyy, Hyx ],
    [ HyxY, Hyxy ],
    [ Hyxyxyy, Hyxyx ],
    [ Hyxxyy, Hyxx ],
    [ HyxxY, Hyxxy ],
    [ HyxyxY, Hyxyxy ],
    [ Hyxyxyxyy, Hyxyxyx ],
    [ Hyxyxxyy, Hyxyxx ],
    [ Hyxxyxyy, Hyxxyx ],
    [ HyxxyxYY, Hyxxyx ] ]
  K-rules:
  [ [ YK, K ],
    [ yK, K ] ]
  
\end{Verbatim}
 This list of partial rules is then used by a modified word acceptor function. 

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@paccT := WordAcceptorOfPartialDoubleCosetRws( T, prwsT );;|
  < deterministic automaton on 6 letters with 6 states >
  !gapprompt@gap>| !gapinput@Print( paccT, "\n" );|
  Automaton("det",6,"HKyYxX",[ [ 2, 2, 2, 6, 2, 2 ], [ 2, 2, 1, 2, 2, 1 ], [ 2, \
  2, 5, 2, 2, 5 ], [ 2, 2, 2, 2, 2, 2 ], [ 2, 2, 6, 2, 3, 2 ], [ 2, 2, 2, 2, 2, \
  2 ] ],[ 4 ],[ 1 ]);;
  !gapprompt@gap>| !gapinput@plangT := FAtoRatExp( paccT );|
  H(yx(yx)*x)*(yx(yx)*KUK)
  !gapprompt@gap>| !gapinput@wordsT := ["HK", "HxK", "HyK", "HYK", "HyxK", "HyxxK", "HyyH", "HyxYK"];;|
  !gapprompt@gap>| !gapinput@validT := List( wordsT, w -> IsRecognizedByAutomaton( paccT, w ) );|
  [ true, false, false, false, true, true, false, false ]
  
\end{Verbatim}
 }

 
\section{\textcolor{Chapter }{Example 3 -- an infinite rewriting system}}\logpage{[ 2, 4, 0 ]}
\hyperdef{L}{X86DACE357868DC1B}{}
{
 \index{example -- infinite rws} 

\subsection{\textcolor{Chapter }{KBMagRewritingSystem}}
\logpage{[ 2, 4, 1 ]}\nobreak
\hyperdef{L}{X8722C57284F51940}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{KBMagRewritingSystem({\mdseries\slshape fpgrp})\index{KBMagRewritingSystem@\texttt{KBMagRewritingSystem}}
\label{KBMagRewritingSystem}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{KBMagWordAcceptor({\mdseries\slshape fpgrp})\index{KBMagWordAcceptor@\texttt{KBMagWordAcceptor}}
\label{KBMagWordAcceptor}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{KBMagFSAtoAutomataDFA({\mdseries\slshape fsa, alph})\index{KBMagFSAtoAutomataDFA@\texttt{KBMagFSAtoAutomataDFA}}
\label{KBMagFSAtoAutomataDFA}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{WordAcceptorByKBMag({\mdseries\slshape grp, alph})\index{WordAcceptorByKBMag@\texttt{WordAcceptorByKBMag}}
\label{WordAcceptorByKBMag}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{WordAcceptorByKBMagOfDoubleCosetRws({\mdseries\slshape grp, dcrws})\index{WordAcceptorByKBMagOfDoubleCosetRws@\texttt{WordAcceptorByKBMagOfDoubleCosetRws}}
\label{WordAcceptorByKBMagOfDoubleCosetRws}
}\hfill{\scriptsize (operation)}}\\


 When the group $G$ has an infinite rewriting system, the double coset rewriting system will also
be infinite. In this case we may use the function \texttt{KBMagWordAcceptor} which calls \textsf{KBMAG} to compute a word acceptor for $G$, and \texttt{KBMagFSAtoAutomataDFA} to convert this to a deterministic automaton as used by the \textsf{automata} package. The resulting \texttt{dfa} forms part of the double coset automaton, together with sufficient $H$-rules, $K$-rules and $H$-$K$-rules found by the function \texttt{PartialDoubleCosetRewritingSystem}. (Note that these five attributes and operations will not be available if the \textsf{kbmag} package has not been loaded.) 

 In the following example we take a two generator group $G3$ with relators $[a^3,b^3,(a*b)^3]$, the normal forms of whose elements are some of the strings with $a$ or $a^{-1}$ alternating with $b$ or $b^{-1}$. The automatic structure computed by \textsf{KBMAG} has a word acceptor with 17 states. }

 
\begin{Verbatim}[commandchars=!|C,fontsize=\small,frame=single,label=Example]
  
  !gapprompt|gap>C !gapinput|F3 := FreeGroup("a","b");;C
  !gapprompt|gap>C !gapinput|rels3 := [ F3.1^3, F3.2^3, (F3.1*F3.2)^3 ];;C
  !gapprompt|gap>C !gapinput|G3 := F3/rels3;;C
  !gapprompt|gap>C !gapinput|alph3 := "AaBb";;C
  !gapprompt|gap>C !gapinput|waG3 := WordAcceptorByKBMag( G3, alph3 );;C
  !gapprompt|gap>C !gapinput|Print( waG3, "\n");C
  Automaton("det",18,"aAbB",[ [ 2, 18, 18, 8, 10, 12, 13, 18, 18, 18, 18, 18, 18\
  , 8, 17, 12, 18, 18 ], [ 3, 18, 18, 9, 11, 9, 12, 18, 18, 18, 18, 18, 18, 11, \
  18, 11, 18, 18 ], [ 4, 6, 6, 18, 18, 18, 18, 18, 6, 12, 16, 18, 12, 18, 18, 18\
  , 12, 18 ], [ 5, 5, 7, 18, 18, 18, 18, 14, 15, 5, 18, 18, 7, 18, 18, 18, 15, 1\
  8 ] ],[ 1 ],[ 1 .. 17 ]);;
  !gapprompt|gap>C !gapinput|langG3 := FAtoRatExp( waG3 );C
  ((abUAb)AUbA)(bA)*(b(aU@)UB(aB)*(a(bU@)U@)U@)U(abUAb)(aU@)U((aBUB)(aB)*AUba(Ba\
  )*BA)(bA)*(b(aU@)U@)U(aBUB)(aB)*(a(bU@)U@)Uba(Ba)*(BU@)UbUaUA(B(aB)*(a(bU@)UAU\
  @)U@)U@
  
\end{Verbatim}
 

\subsection{\textcolor{Chapter }{DCrules}}
\logpage{[ 2, 4, 2 ]}\nobreak
\hyperdef{L}{X815C08FD87D014B5}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{DCrules({\mdseries\slshape dcrws})\index{DCrules@\texttt{DCrules}}
\label{DCrules}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{Hrules({\mdseries\slshape dcrws})\index{Hrules@\texttt{Hrules}}
\label{Hrules}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{Krules({\mdseries\slshape dcrws})\index{Krules@\texttt{Krules}}
\label{Krules}
}\hfill{\scriptsize (attribute)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{HKrules({\mdseries\slshape dcrws})\index{HKrules@\texttt{HKrules}}
\label{HKrules}
}\hfill{\scriptsize (attribute)}}\\


 We now take $H$ to be generated by $ab$ and $K$ to be generated by $ba$. If we specify a limits of 50, 75, 100, 200 for the number of rules in a
partial double coset rewrite system, we obtain lists of $H$-rules, $K$-rules and $H$-$K$-rules of increasing length. The numbers of states in the resulting automata
also increase. We may deduce by hand (but not computationally -- see \cite{BrGhHeWe}) three infinite sets of rules and a limit for the automata. }

 
\begin{Verbatim}[commandchars=@|J,fontsize=\small,frame=single,label=Example]
  
  @gapprompt|gap>J @gapinput|lim := 100;;J
  @gapprompt|gap>J @gapinput|genG3 := GeneratorsOfGroup( G3 );;J
  @gapprompt|gap>J @gapinput|a := genG3[1];;  b := genG3[2];; J
  @gapprompt|gap>J @gapinput|gH3 := [ a*b ];;  gK3 := [ b*a ];;J
  @gapprompt|gap>J @gapinput|rwsG3 := KnuthBendixRewritingSystem( G3, "shortlex", [2,1,4,3], alph3 );;J
  @gapprompt|gap>J @gapinput|dcrws3 := PartialDoubleCosetRewritingSystem( G3, gH3, gK3, rwsG3, lim );;J
  #I using PartialDoubleCosetRewritingSystem with limit 100
  #I  51 rules, and 1039 pairs
  #I WARNING: reached supplied limit 100 on number of rules
  @gapprompt|gap>J @gapinput|Print( Length( Rules( dcrws3 ) ), " rules found.\n" );J
  101 rules found.
  @gapprompt|gap>J @gapinput|dcaut3 := WordAcceptorByKBMagOfDoubleCosetRws( G3, dcrws3 );;J
  @gapprompt|gap>J @gapinput|Print( "Double Coset Minimalized automaton:\n", dcaut3 );J
  Double Coset Minimalized automaton:
  Automaton("det",44,"HKaAbB",[ [ 2, 2, 2, 5, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2\
  , 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2\
  , 2, 2 ], [ 2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, \
  2, 2, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 1 ], [ 2, 2, 2,\
   2, 3, 24, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 43, 2, 43, 2, 27, 2, 2, 2\
  , 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ], [ 2, 2, 2, 2, 44, 3, 29, 2\
  , 8, 2, 10, 2, 12, 2, 14, 2, 16, 2, 18, 2, 20, 2, 22, 2, 2, 2, 2, 26, 2, 29, 2\
  , 31, 2, 33, 2, 35, 2, 37, 2, 39, 2, 41, 2, 2 ], [ 2, 2, 2, 2, 21, 2, 2, 28, 2\
  , 9, 2, 11, 2, 13, 2, 15, 2, 17, 2, 19, 2, 42, 2, 3, 2, 28, 3, 2, 7, 2, 30, 2,\
   32, 2, 34, 2, 36, 2, 38, 2, 40, 2, 2, 28 ], [ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2\
  , 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 6, 2, 25, 25, 2, 2, 2, 2, 2, 2, 2, 2, 2,\
   2, 2, 2, 2, 2, 2, 23, 6 ] ],[ 4 ],[ 1 ]);;
  @gapprompt|gap>J @gapinput|dclang3 := FAtoRatExp( dcaut3 );;J
  @gapprompt|gap>J @gapinput|Print( "Double Coset language of acceptor:\n", dclang3, "\n" );J
  Double Coset language of acceptor:
  (HbAbAbAbAbAbAbAbUHAb)(Ab)*(A(Ba(Ba)*bKUK)UK)UHbAbA(bA(bA(bA(bA(bAKUK)UK)UK)UK\
  )UK)UH(A(B(aB)*(abUA)KUK)UaKUb(a(Ba)*BA(bA(bA(bA(bA(bA(bA(bA(bA)*(bKUK)UK)UK)U\
  K)UK)UK)UK)UK)UAK)UK)
  @gapprompt|gap>J @gapinput|ok := DCrules(dcrws3);;J
  @gapprompt|gap>J @gapinput|alph3e := dcrws3!.alphabet;;J
  @gapprompt|gap>J @gapinput|Print("H-rules:\n");  DisplayAsString( Hrules(dcrws3), alph3e, true );J
  H-rules:
  [ HB, Ha ]
  [ HaB, Hb ]
  [ Hab, H ]
  [ HbAB, HAba ]
  [ HbAbAB, HAbAba ]
  [ HbAbAbAB, HAbAbAba ]
  [ HbAbAbAbAB, HAbAbAbAba ]
  [ HbAbAbAbAbAB, HAbAbAbAbAba ]
  [ HbAbAbAbAbAbAB, HAbAbAbAbAbAba ]
  [ HbAbAbAbAbAbAbAB, HAbAbAbAbAbAbAba ]
  @gapprompt|gap>J @gapinput|Print("K-rules:\n");  DisplayAsString( Krules(dcrws3), alph3e, true );;J
  K-rules:
  [ BK, aK ]
  [ BaK, bK ]
  [ baK, K ]
  [ BAbK, abAK ]
  [ BAbAbK, abAbAK ]
  [ BAbAbAbK, abAbAbAK ]
  [ BAbAbAbAbK, abAbAbAbAK ]
  [ BAbAbAbAbAbK, abAbAbAbAbAK ]
  [ BAbAbAbAbAbAbK, abAbAbAbAbAbAK ]
  [ BAbAbAbAbAbAbAbK, abAbAbAbAbAbAbAK ]
  @gapprompt|gap>J @gapinput|Print("HK-rules:\n");  DisplayAsString( HKrules(dcrws3), alph3e, true );;J
  HK-rules:
  [ HbK, HAK ]
  [ HbAbK, HAbAK ]
  [ HbAbAbK, HAbAbAK ]
  [ HbAbAbAbK, HAbAbAbAK ]
  [ HbAbAbAbAbK, HAbAbAbAbAK ]
  [ HbAbAbAbAbAbK, HAbAbAbAbAbAK ]
  [ HbAbAbAbAbAbAbK, HAbAbAbAbAbAbAK ]
  
\end{Verbatim}
 

\subsection{\textcolor{Chapter }{NextWord}}
\logpage{[ 2, 4, 3 ]}\nobreak
\hyperdef{L}{X7AF0265982B42E47}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{NextWord({\mdseries\slshape dcrws, word})\index{NextWord@\texttt{NextWord}}
\label{NextWord}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{WordToString({\mdseries\slshape word, alph})\index{WordToString@\texttt{WordToString}}
\label{WordToString}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{DisplayAsString({\mdseries\slshape word, alph})\index{DisplayAsString@\texttt{DisplayAsString}}
\label{DisplayAsString}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{IdentityDoubleCoset({\mdseries\slshape dcrws})\index{IdentityDoubleCoset@\texttt{IdentityDoubleCoset}}
\label{IdentityDoubleCoset}
}\hfill{\scriptsize (operation)}}\\


 These functions may be used to find normal forms of increasing length for
double coset representatives. }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@len := 30;;|
  !gapprompt@gap>| !gapinput@L3 := 0*[1..len];;|
  !gapprompt@gap>| !gapinput@L3[1] := IdentityDoubleCoset( dcrws3 );;|
  !gapprompt@gap>| !gapinput@for i in [2..len] do|
  !gapprompt@gap>| !gapinput@    L3[i] := NextWord( dcrws3, L3[i-1] );|
  !gapprompt@gap>| !gapinput@od;|
  !gapprompt@gap>| !gapinput@## List of 30 normal forms for double cosets:|
  !gapprompt@gap>| !gapinput@DisplayAsString( L3, alph3e, true );|
  [ HK, HAK, HaK, HAbK, HbAK, HABAK, HAbAK, HABabK, HAbAbK, HbAbAK, HbaBAK, HABa\
  BAK, HAbAbAK, HABaBabK, HAbABabK, HAbAbAbK, HbAbAbAK, HbaBAbAK, HbaBaBAK, HABa\
  BaBAK, HAbAbAbAK, HABaBaBabK, HAbABaBabK, HAbAbABabK, HAbAbAbAbK, HbAbAbAbAK, \
  HbaBAbAbAK, HbaBaBAbAK, HbaBaBaBAK, HABaBaBaBAK ]
  !gapprompt@gap>| !gapinput@w := NextWord( dcrws3, L3[30] );|
  m1*(m3*m6)^4*m3*m2
  !gapprompt@gap>| !gapinput@s := WordToString( w, alph3e );|
  "HAbAbAbAbAK"
  
\end{Verbatim}
 }

 }

       
\chapter{\textcolor{Chapter }{Development History}}\label{chap-history}
\logpage{[ 3, 0, 0 ]}
\hyperdef{L}{X810C43BC7F63C4B4}{}
{
  
\section{\textcolor{Chapter }{Versions of the package}}\logpage{[ 3, 1, 0 ]}
\hyperdef{L}{X8192EA4C7B7CC5CD}{}
{
 The first version of the package, written for \textsf{GAP} 3, formed part of Anne Heyworth's thesis \cite{anne-thesis} in 1999, but was not made generally available. 

 Version 0.91 was prepared to run under \textsf{GAP} 4.4.6, in July 2005. 

 Version 0.94 differed in two significant ways. 
\begin{itemize}
\item  The manual was produced using the \textsf{GAPDoc} package. 
\item  The test file \texttt{kan/tst/kan{\textunderscore}manual.tst} set the \texttt{AssertionLevel} to \texttt{0} to avoid recursion in the \textsf{Automata} package. 
\end{itemize}
 

 Version 0.95, of 9th October 2007, just fixed file protections and added a \texttt{CHANGES} file. 

 Version 0.96 was required because the \textsf{Kan} website moved with the rest of the Mathematics website at Bangor. 

 Version 0.97, of November 18th 2008, deleted temporary fixes which were no
longer needed once version 1.12 of \textsf{Automata} became available. 

 Version 1.01, of August 2011, included minor changes required for \textsf{GAP} 4.5. In particular, the test file \texttt{kan{\textunderscore}manual.tst} was replaced by the pair \texttt{fulltest.tst} and \texttt{parttest.tst}. 

 Version 1.11, of December 2014 was required when the \textsf{Kan} website moved yet again. At the same time a bitbucket repository for the
package was started. 

 \textsf{Kan} became an accepted \textsf{GAP} package in May 2015. 

 }

 
\section{\textcolor{Chapter }{What needs doing next?}}\logpage{[ 3, 2, 0 ]}
\hyperdef{L}{X83D1530487593182}{}
{
 There are too many items to list here, but some of the most important are as
follows. 
\begin{itemize}
\item  Implement iterators and enumerators for double cosets. 
\item  At present the methods for \texttt{DoubleCosetsNC} and \texttt{RightCosetsNC} in this package return automata, rather than lists of cosets or coset
enumerators. This needs to be fixed. 
\item  Provide methods for operations such as \texttt{DoubleCosetRepsAndSizes}. 
\item  Convert the rest of the original \textsf{GAP} 3 version of \textsf{Kan} to \textsf{GAP} 4. 
\end{itemize}
 

\subsection{\textcolor{Chapter }{DoubleCosetsAutomaton}}
\logpage{[ 3, 2, 1 ]}\nobreak
\hyperdef{L}{X852CC057809CE3EE}{}
{\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{DoubleCosetsAutomaton({\mdseries\slshape G, U, V})\index{DoubleCosetsAutomaton@\texttt{DoubleCosetsAutomaton}}
\label{DoubleCosetsAutomaton}
}\hfill{\scriptsize (operation)}}\\
\noindent\textcolor{FuncColor}{$\triangleright$\ \ \texttt{RightCosetsAutomaton({\mdseries\slshape G, V})\index{RightCosetsAutomaton@\texttt{RightCosetsAutomaton}}
\label{RightCosetsAutomaton}
}\hfill{\scriptsize (operation)}}\\


 Alternative methods for \texttt{DoubleCosetsNC(G,U,V)} and \texttt{RightCosetsNC(G,V)} \emph{should be} provided in the cases where the group \texttt{G} has a rewriting system or is known to be infinite. At present the functions \texttt{RightCosetsAutomaton} and \texttt{DoubleCosetsAutomaton} return minimized automata, and \texttt{Iterators} for these are not yet available. }

 
\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
  
  !gapprompt@gap>| !gapinput@F := FreeGroup(2);;|
  !gapprompt@gap>| !gapinput@rels := [ F.2^2, (F.1*F.2)^2 ];;|
  !gapprompt@gap>| !gapinput@G4 := F/rels;;|
  !gapprompt@gap>| !gapinput@genG4 := GeneratorsOfGroup( G4 );;|
  !gapprompt@gap>| !gapinput@a := genG4[1];  b := genG4[2];;|
  !gapprompt@gap>| !gapinput@U := Subgroup( G4, [a^2] );;|
  !gapprompt@gap>| !gapinput@V := Subgroup( G4, [b] );;|
  !gapprompt@gap>| !gapinput@dc4 := DoubleCosetsAutomaton( G4, U, V );;|
  !gapprompt@gap>| !gapinput@Print( dc4 );|
  Automaton("det",5,"HKaAbB",[ [ 2, 2, 2, 5, 2 ], [ 2, 2, 1, 2, 1 ], [ 2, 2, 2, \
  2, 3 ], [ 2, 2, 2, 2, 2 ], [ 2, 2, 2, 2, 2 ], [ 2, 2, 2, 2, 2 ] ],[ 4 ],[ 1 ])\
  ;;
  !gapprompt@gap>| !gapinput@rc4 := RightCosetsAutomaton( G4, V );;|
  !gapprompt@gap>| !gapinput@Print( rc4 );|
  Automaton("det",6,"HKaAbB",[ [ 2, 2, 2, 6, 2, 2 ], [ 2, 2, 1, 2, 1, 1 ], [ 2, \
  2, 3, 2, 2, 3 ], [ 2, 2, 2, 2, 5, 5 ], [ 2, 2, 2, 2, 2, 2 ], [ 2, 2, 2, 2, 2, \
  2 ] ],[ 4 ],[ 1 ]);;
  
\end{Verbatim}
 }

 }

 \def\bibname{References\logpage{[ "Bib", 0, 0 ]}
\hyperdef{L}{X7A6F98FD85F02BFE}{}
}

\bibliographystyle{alpha}
\bibliography{kanbib.xml}

\addcontentsline{toc}{chapter}{References}

\def\indexname{Index\logpage{[ "Ind", 0, 0 ]}
\hyperdef{L}{X83A0356F839C696F}{}
}

\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{Index}


\printindex

\newpage
\immediate\write\pagenrlog{["End"], \arabic{page}];}
\immediate\closeout\pagenrlog
\end{document}
