##############################################################################
##
#W  example4.g                   Kan Package                     Chris Wensley
#W                                                             & Anne Heyworth
##
##  This file contains generic methods for double coset rewriting systems
##
#H  @(#)$Id: example4.g,v 0.94 2006/06/02 gap Exp $
##
#Y  Copyright (C) 1999,2001 University of St. Andrews, North Haugh,
#Y                          St. Andrews, Fife KY16 9SS, Scotland
##
Revision.("kan/examples/example4_g") := 
   "@(#)$Id: example4.g,v 0.94 2006/06/02 gap Exp $";

Print("\n==============================================================\n");
Print("2-generator example example4.g, <b^2,(ab)^2>, version 02/06/06\n");
Print("==============================================================\n\n");

SetInfoLevel( InfoKan, 1 );
SetInfoLevel( InfoKnuthBendix, 1 );

F := FreeGroup(2);;
rels := [ F.2^2, (F.1*F.2)^2 ];;
G4 := F/rels;;
genG4 := GeneratorsOfGroup( G4 );;
a := genG4[1];;  b := genG4[2];;
U := Subgroup( G4, [a^2] );;
V := Subgroup( G4, [b] );;
dc4 := DoubleCosetsAutomaton( G4, U, V );;
Print( dc4, "\n" );
rc4 := RightCosetsAutomaton( G4, V );;
Print( rc4, "\n" );

