############################################################################## ## #W dckbmag.gi Kan Package Chris Wensley #W & Anne Heyworth #Y Copyright (C) 1996-2016, Chris Wensley and Anne Heyworth ## ## This file contains generic methods for double coset rewriting systems ##
########################################################################### ## #M WordAcceptorByKBMagOfDoubleCosetRws ## ## this method requires KBMag to produce a finite automaton for the group
local numst, numa, init, accept, table, ftrans, atrans,
flags, format, i, j, k, sink, dfa, alpht, perm, L;
if not IsFSA( fsa ) then
Error( "fsa is not a KBMag FSA" ); fi;
table := fsa!.table;
format := table!.format; if not ( format = "dense deterministic" ) then
Print( "*** only dense deterministic fsa treated at present\n" );
return fail; fi;
numa := fsa!.alphabet!.size; if not ( numa = Length( alph ) ) then
Print( "** length of string alph not equal to size of alphabet **\n" );
Print( "** probably one of the generators has order 2 **\n" );
Print( "** this case is not treated at present **\n" );
return fail; fi;
L := [1..numa];
i := 1; while ( i < numa ) do
j := L[i];
L[i] := L[i+1];
L[i+1] := j;
i := i+2;
od;
perm := PermList( L );
alpht := ShallowCopy( alph ); for i in [1..numa] do
alpht[i] := alph[i^perm];
od;
numst := fsa!.states!.size + 1;
sink := numst;
init := fsa!.initial;
accept := fsa!.accepting;
ftrans := table!.transitions;
atrans := [ ]; ## change zero entries to sink state for i in [ numa, numa-1 .. 1 ] do
atrans[i]:= [ ];
atrans[i][sink] := sink; for j in [ numst-1, numst-2 .. 1 ] do
k := ftrans[j][i]; if ( k > 0 ) then
atrans[i][j] := k; else
atrans[i][j] := sink; fi;
od;
od;
dfa := Automaton( "det", numst, alpht, atrans, init, accept );
return dfa; end );
############################################################################# ## #M WordAcceptorByKBMag #M KBMagRewritingSystem #M KBMagWordAcceptor ##
InstallMethod( WordAcceptorByKBMag, "generic method for fp group and string",
true, [ IsFpGroup, IsString ], 0, function( grp, alph )
local rws, ok, wa, dfa, alpht, L;
if HasKBMagWordAcceptor( grp ) then
return KBMagWordAcceptor( grp ); fi;
rws := KBMAGRewritingSystem( grp );
ok := AutomaticStructure( rws );
wa := WordAcceptor( rws );
dfa := KBMagFSAtoAutomataDFA( wa, alph );
alpht := AlphabetOfAutomatonAsList( dfa );
L := List( [1..Length(alph)], i-> Position( alph, alpht[i] ) );
dfa!.gensperm := PermList( L );
SetKBMagRewritingSystem( grp, rws );
SetKBMagWordAcceptor( grp, dfa );
return dfa; end );
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.