Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/GAP/pkg/idrel/doc/   (Algebra von RWTH Aachen Version 4.15.1©)  Datei vom 2.9.2025 mit Größe 15 kB image not shown  

Quelle  rws.xml   Sprache: XML

 
<!-- ------------------------------------------------------------------- -->
<!--                                                                     -->
<!--  rws.xml             IdRel documentation             Chris Wensley  -->
<!--                                                    & Anne Heyworth  -->
<!-- ------------------------------------------------------------------- -->

<?xml version="1.0" encoding="UTF-8"?>

<Chapter Label="chap-rws">
<Heading>Rewriting Systems</Heading>

This chapter describes functions to construct rewriting systems 
for finitely presented groups which store rewriting information.
The main example used throughout this manual is a presentation 
of the quaternion group <M>q8 = F/[a^4, b^4, abab^{-1}, a^2b^2]</M>.


<Section><Heading>Monoid Presentations of FpGroups</Heading>

<ManSection>
   <Attr Name="FreeRelatorGroup"
         Arg="grp" />
   <Attr Name="FreeRelatorHomomorphism"
         Arg="grp" />
<Description>
The function <C>FreeRelatorGroup</C> returns a free group 
on the set of relators of the fp-group <C>G</C>. 
If <C>HasName(G)</C> is <K>true</K> then a name is automatically assigned 
to this free group by concatenating <C>_R</C>. 
<P/>
The function <C>FreeRelatorHomomorphism</C> returns the group homomorphism 
from the free group on the relators 
to the free group on the generators of <C>G</C>, 
mapping each generator to the corresponding word.
<P/>
</Description>
</ManSection>
<Example>
<![CDATA[
gap> relq8 := [ f^4, g^4, f*g*f*g^-1, f^2*g^2 ];;
gap> q8 := F/relq8;;
gap> SetName( q8, "q8" );;
gap> q8R := FreeRelatorGroup( q8 ); 
q8_R
gap> genq8R := GeneratorsOfGroup( q8R );
[ q8_R1, q8_R2, q8_R3, q8_R4]
gap> homq8R := FreeRelatorHomomorphism( q8 );
[ q8_R1, q8_R2, q8_R3, q8_R4 ] -> [ f1^4, f2^4, f1*f2*f1*f2^-1, f1^2*f2^2 ]
]]>
</Example>

<ManSection>
   <Attr Name="MonoidPresentationFpGroup"
         Arg="grp" />
   <Attr Name="ArrangementOfMonoidGenerators"
         Arg="grp" />
   <Attr Name="MonoidPresentationLabels"
         Arg="grp" />
   <Attr Name="FreeGroupOfPresentation"
         Arg="mon" />
   <Attr Name="GroupRelatorsOfPresentation"
         Arg="mon" />
   <Attr Name="InverseRelatorsOfPresentation"
         Arg="mon" />
   <Attr Name="HomomorphismOfPresentation"
         Arg="mon" />
<Description>
A monoid presentation for a finitely presented group <C>G</C> 
has two monoid generators <M>g,G</M> for each group generator <M>g</M>. 
The relators of the monoid presentation comprise the group relators, 
and relators <M>gG, Gg</M> specifying the inverses. 
The function <C>MonoidPresentationFpGroup</C> returns the monoid presentation 
derived in this way from an fp-presentation. 
<P/> 
The function <C>FreeGroupOfPresentation</C> 
returns the free group on the monoid generators.
<P/>
The function <C>GroupRelatorsOfPresentation</C> returns those relators 
of the monoid which correspond to the relators of the group. 
All negative powers in the group relators are converted to positive powers 
of the <M>G</M>'s.
The function <C>InverseRelatorsOfPresentation</C> returns relators 
which specify the inverse pairs of the monoid generators.
<P/>
The function <C>HomomorphismOfPresentation</C> returns the homomorphism 
from the free group of the monoid presentation to the free group 
of the group presentation.
<P/>
The attribute <C>ArrangementOfMonoidGenerators</C> will be discussed 
before the second example in the next section.
<P/>
In the example below, the four monoid generators <M>a,b,A,B</M> 
are named <C>q8_M1, q8_M2, q8_M3, q8_M4</C> respectively. 
</Description>
</ManSection>
<Example>
<![CDATA[
gap> mq8 := MonoidPresentationFpGroup( q8 );
monoid presentation with group relators 
[ q8_M1^4, q8_M2^4, q8_M1*q8_M2*q8_M1*q8_M4, q8_M1^2*q8_M2^2 ]
gap> fmq8 := FreeGroupOfPresentation( mq8 ); 
<free group on the generators [ q8_M1, q8_M2, q8_M3, q8_M4 ]>
gap> genfmq8 := GeneratorsOfGroup( fmq8 );;
gap> gprels := GroupRelatorsOfPresentation( mq8 ); 
[ q8_M1^4, q8_M2^4, q8_M1*q8_M2*q8_M1*q8_M4, q8_M1^2*q8_M2^2 ]
gap> invrels := InverseRelatorsOfPresentation( mq8 ); 
[ q8_M1*q8_M3, q8_M2*q8_M4, q8_M3*q8_M1, q8_M4*q8_M2 ]
gap> hompres := HomomorphismOfPresentation( mq8 ); 
[ q8_M1, q8_M2, q8_M3, q8_M4 ] -> [ f1, f2, f1^-1, f2^-1 ]
]]>
</Example>

<ManSection>
   <Func Name="PrintLnUsingLabels" 
         Arg="args" /> 
   <Func Name="PrintUsingLabels" 
         Arg="args" /> 
<Description>
The labels <C>q8_M1, q8_M2, q8_M3, q8_M4</C> are rather unhelpful 
in lengthy output, so it is convenient to use <M>[a,b,A,B]</M> as above. 
Then the function <C>PrintUsingLabels</C> takes as input a word in the monoid, 
the generators of the monoid, and a set of labels for these generators. 
This function also treats lists of words and lists of lists in a similar way.
The function <C>PrintLnUsingLabels</C> does exactly the same, 
and then appends a newline.
</Description> 
 
</ManSection>
<Example>
<![CDATA[
gap> q8labs := [ "a""b""A""B" ];; 
gap> SetMonoidPresentationLabels( q8, q8labs );; 
gap> PrintLnUsingLabels( gprels, genfmq8, q8labs ); 
[ a^4, b^4, a*b*a*B, a^2*b^2 ]
]]>
</Example>

<ManSection Label="init-rules">
   <Func Name="InitialRulesOfPresentation" 
         Arg="mon" /> 
<Description>
The initial rules for <M>mq8</M> are 
the four rules of the form <M>a^{-1} \to A</M>; 
the four rules of the form <M>aA \to id</M>; 
and the four relator rules of the form <M>a^4 \to id</M>. 
</Description> 
 
</ManSection>
<Example>
<![CDATA[
gap> q0 := InitialRulesOfPresentation( mq8 );;  
gap> PrintLnUsingLabels( q0, genfmq8, q8labs );
[ [ a^-1, A ], [ b^-1, B ], [ A^-1, a ], [ B^-1, b ], [ a*A, id ], 
[ b*B, id ], [ A*a, id ], [ B*b, id ], [ a^4, id ], [ a^2*b^2, id ], 
[ a*b*a*B, id ], [ b^4, id ] ]
]]>
</Example>

</Section>


<Section><Heading>Rewriting systems for FpGroups</Heading>

These functions duplicate the standard Knuth Bendix functions 
which are available in the &GAP; library. 
There are two reasons for this: 
(1) these functions were first written before the standard functions 
were available;
(2) we require logged versions of the functions, and these are most 
conveniently extended versions of the non-logged code.

<ManSection Label="rwsfp">
   <Attr Name="RewritingSystemFpGroup"
         Arg="grp" />
<Description>
This function attempts to return a complete rewrite system for the 
fp-group <C>G</C> obtained using the group's monoid presentation mon,
with a length-lexicographical ordering on the words in <C>fgmon</C>, 
by applying Knuth-Bendix completion. 
Such a rewrite system can be obtained for all finite groups. 
The rewrite rules are (partially) ordered, starting with the inverse relators, 
followed by the rules which reduce the word length the most.
<P/>
In our <C>q8</C> example there are 20 rewrite rules 
in the rewriting system <C>rws</C>:  
<Table Align="|c|">
  <HorLine/>
  <Row> 
    <Item> <M>a^{-1} \to A, \quad 
              b^{-1} \to B, \quad
       A^{-1} \to a, \quad 
              B^{-1} \to b, </M> 
    </Item>
  </Row>
  <Row> 
    <Item> <M>aA  \to \rm{id}, \quad 
              bB  \to \rm{id}, \quad
              Aa  \to \rm{id}, \quad 
              Bb  \to \rm{id}, </M>  
    </Item>
  </Row>
  <Row>
    <Item> <M>ba  \to  aB, \quad 
              b^2 \to  a^2,\quad 
              bA  \to  ab, \quad
              Ab  \to  aB, \quad 
              A^2 \to  a^2,\quad 
              AB  \to  ab, </M> 
    </Item>
  </Row>
  <Row>
    <Item> <M>Ba  \to  ab,  \quad
              BA  \to  aB,  \quad 
              B^2 \to  a^2, \quad 
              a^3 \to  a,   \quad 
              a^2b \to B, \quad 
              a^2B \to b. </M>
    </Item>
  </Row>
  <HorLine/>
</Table>
</Description>
</ManSection>
<Example>
<![CDATA[
gap> rws := RewritingSystemFpGroup( q8 );;
gap> Length( rws );
20
gap> PrintLnUsingLabels( rws, genfmq8, q8labs );
[ [ a^-1, A ], [ b^-1, B ], [ A^-1, a ], [ B^-1, b ], [ a*A, id ], 
[ b*B, id ], [ A*a, id ], [ B*b, id ], [ b*a, a*B ], [ b^2, a^2 ], 
[ b*A, a*b ], [ A*b, a*B ], [ A^2, a^2 ], [ A*B, a*b ], [ B*a, a*b ], 
[ B*A, a*B ], [ B^2, a^2 ], [ a^3, A ], [ a^2*b, B ], [ a^2*B, b ] ]
]]>
</Example>

The default ordering of the <M>2n</M> monoid generators is 
<M> [g_1^+,g_2^+,\ldots,g_n^+,g_1^-,g_2^-,\ldots,g_n^-] </M>. 
In the case of the two-generator abelian group 
<M>T = \langle a,b ~|~ [a,b] \rangle</M> 
the Knuth-Bendix process starts to generate infinite sets of relations 
such as <M>\{ab^ma^{-1} \to b^m,~ m \geqslant 1\}</M>. 
<P/> 
If, using the <C>ArrangementOfMonoidGenerators</C> function, 
we specify the alternative ordering 
<M> [g_1^+,g_1^-,g_2^+,g_2^-] </M>, 
then a finite set of rules is obtained.  
<P/>
<Example>
<![CDATA[
gap> T := F/[Comm(f,g)];              
<fp group of size infinity on the generators [ f1, f2 ]>
gap> SetName( T, "T" );                   
gap> SetArrangementOfMonoidGenerators( T, [1,-1,2,-2] );
gap> Tlabs := [ "x""X""y""Y" ];; 
gap> mT := MonoidPresentationFpGroup( T );              
monoid presentation with group relators [ T_M2*T_M4*T_M1*T_M3 ]
gap> fgmT := FreeGroupOfPresentation( mT );; 
gap> genfgmT := GeneratorsOfGroup( fgmT );;
gap> SetMonoidPresentationLabels( T, Tlabs );; 
gap> rwsT := RewritingSystemFpGroup( T );;
gap> PrintLnUsingLabels( rwsT, genfgmT, Tlabs );       
[ [ x^-1, X ], [ X^-1, x ], [ y^-1, Y ], [ Y^-1, y ], [ x*X, id ], 
[ X*x, id ], [ y*Y, id ], [ Y*y, id ], [ y*x, x*y ], [ y*X, X*y ], 
[ Y*x, x*Y ], [ Y*X, X*Y ] ]
]]>
</Example>
The last four rules show that generators <M>x</M> and <M>y</M> commute. 

<ManSection Label="one-pass-reduce">
   <Oper Name="OnePassReduceWord"
         Arg="word, rules" />
   <Oper Name="ReduceWordKB"
         Arg="word, rules" />
<Description>
These functions are called by the function <C>RewritingSystemFpGroup</C>.
<P/>
Assuming that <C>word</C> is an element of a free monoid 
and <C>rules</C> is a list of ordered pairs of such words, 
the function <C>OnePassReduceWord</C> searches the list of rules 
until it finds that the left-hand side of a <C>rule</C> 
is a <C>subword</C> of <C>word</C>, 
whereupon it replaces that <C>subword</C> with the right-hand side 
of the matching rule. 
The search is continued from the next <C>rule</C> in <C>rules</C>, 
but using the new <C>word</C>.
When the end of <C>rules</C> is reached, 
one pass is considered to have been made
and the reduced <C>word</C> is returned. 
If no matches are found then the original <C>word</C> is returned.
<P/>
The function <C>ReduceWordKB</C> repeatedly applies the function 
<C>OnePassReduceWord</C> 
until the <C>word</C> remaining contains no left-hand side of a <C>rule</C> 
as a <C>subword</C>. 
If <C>rules</C> is a complete rewrite system, 
then the irreducible <C>word</C> that is returned is unique, 
otherwise the order of the rules in <C>rules</C> will determine 
which irreducible word is returned.
In our <M>q8</M> example we see that <M>b^9a^{-9}</M> reduces to <M>ab</M>. 
<P/>
</Description>
</ManSection>
<Example>
<![CDATA[
gap> a := genfmq8[1];;  b := genfmq8[2];; 
gap> A := genfmq8[3];;  B := genfmq8[4];; 
gap> w0 := b^9 * a^-9;; 
gap> PrintLnUsingLabels( w0, genfmq8, q8labs ); 
b^9*a^-9
gap> w1 := OnePassReduceWord( w0, rws );; 
gap> PrintLnUsingLabels( w1, genfmq8, q8labs ); 
B*b^5*a*b*a^-8
gap> w2 := ReduceWordKB( w0, rws );; 
gap> PrintLnUsingLabels( w2, genfmq8, q8labs ); 
a*b
]]>
</Example>

<ManSection Label="one-pass-KB">
   <Oper Name="OnePassKB"
         Arg="mon rules" />
<Description>
The function <C>OnePassKB</C> implements the main loop of the Knuth-Bendix 
completion algorithm. 
Rules are compared with each other; all critical pairs are calculated; 
and the irreducible critical pairs are orientated with respect 
to the length-lexicographical ordering and added to the rewrite system.
<P/>
The function <C>ShorterRule</C> gives an ordering on rules. 
Rules <M>(g_lg_2,id)</M> that identify two generators 
(or one generator with the inverse of another) come first in the ordering. 
Otherwise one precedes another if it reduces the length of a word 
by a greater amount. 
<P/>
One pass of this procedure for our <M>q8</M> example 
adds <M>10</M> relators to the original <M>12</M>. 
<P/>
</Description>
</ManSection>
<Example>
<![CDATA[
gap> q1 := OnePassKB( mq8, q0 );; 
gap> Length( q1 ); 
22
gap> PrintLnUsingLabels( q1, genfmq8, q8labs ); 
[ [ a^-1, A ], [ b^-1, B ], [ A^-1, a ], [ B^-1, b ], [ a*A, id ], 
[ b*B, id ], [ A*a, id ], [ B*b, id ], [ b^2, a^2 ], [ a^3, A ], 
[ a^2*b, B ], [ a*b*a, b ], [ a*b^2, A ], [ b*a*B, A ], [ b^3, B ], 
[ a*b^2, a^3 ], [ b*a*B, a^3 ], [ b^3, a^2*b ], [ a^4, id ], 
[ a^2*b^2, id ], [ a*b*a*B, id ], [ b^4, id ] ]
]]>
</Example>

<ManSection Label="rewrite-reduce">
   <Oper Name="RewriteReduce"
         Arg="mon rules" />
<Description>
The function <C>RewriteReduce</C> will remove unnecessary rules from 
a rewrite system. 
A rule is deemed to be unnecessary if it is implied by the other rules, 
i.e. if both sides can be reduced to the same thing by the remaining rules.
<P/>
In the example the <M>22</M> rules in <M>q1</M> 
are reduced to <M>13</M>. 
<P/>
</Description>
</ManSection>
<Example>
<![CDATA[
gap> q2 := RewriteReduce( mq8, q1 );; 
gap> Length( q2 ); 
13
gap> PrintLnUsingLabels( q2, genfmq8, q8labs ); 
[ [ a^-1, A ], [ b^-1, B ], [ A^-1, a ], [ B^-1, b ], [ a*A, id ], 
[ b*B, id ], [ A*a, id ], [ B*b, id ], [ b^2, a^2 ], [ a^3, A ], 
[ a^2*b, B ], [ a*b*a, b ], [ b*a*B, A ] ]
]]>
</Example>

<ManSection Label="Knuth-Bendix">
   <Oper Name="KnuthBendix"
         Arg="mon rules" />
<Description>
The function <C>KnuthBendix</C> implements the Knuth-Bendix algorithm, 
attempting to complete a rewrite system with respect to 
a length-lexicographic ordering. 
It calls first <C>OnePassKB</C>, which adds rules, and then (for efficiency) 
<C>RewriteReduce</C> which removes any unnecessary ones. 
This procedure is repeated until <C>OnePassKB</C> adds no more rules. 
It will not always terminate, but for many examples (all finite groups) 
it will be successful. 
The rewrite system returned is complete, that is: 
it will rewrite any given word in the free monoid to a unique irreducible; 
there is one irreducible for each element of the quotient monoid; 
and any two elements of the free monoid which are in the same class 
will rewrite to the same irreducible.
<P/>
The function <C>ShorterRule</C> gives an ordering on rules. 
Rules <M>(g_lg_2,id)</M> that identify two generators 
(or one generator with the inverse of another) come first in the ordering. 
Otherwise one precedes another if it reduces the length of a word 
by a greater amount. 
<P/>
In the example the function <C>KnuthBendix</C> requires three instances of 
<C>OnePassKB</C> and <C>RewriteReduce</C> 
to form the complete rewrite system <M>rws</M> for the group shown above. 
<P/>
</Description>
</ManSection>
<Example>
<![CDATA[
gap> q3 := KnuthBendix( mq8, q0 );; 
gap> Length( q3 ); 
20
gap> PrintLnUsingLabels( q3, genfmq8, q8labs ); 
[ [ a^-1, A ], [ b^-1, B ], [ A^-1, a ], [ B^-1, b ], [ a*A, id ], 
[ b*B, id ], [ A*a, id ], [ B*b, id ], [ b*a, a*B ], [ b^2, a^2 ], 
[ b*A, a*b ], [ A*b, a*B ], [ A^2, a^2 ], [ A*B, a*b ], [ B*a, a*b ], 
[ B*A, a*B ], [ B^2, a^2 ], [ a^3, A ], [ a^2*b, B ], [ a^2*B, b ] ]
]]>
</Example>

</Section>


<Section><Heading>Enumerating elements</Heading>

<ManSection>
   <Attr Name="ElementsOfMonoidPresentation"
         Arg="mon" />
<Description>
The function <C>ElementsOfMonoidPresentation</C> returns a list 
of normal forms for the elements of the group given by 
the monoid presentation <C>mon</C>. 
The normal forms are the least elements in each equivalence class 
(with respect to length-lex order).
<!-- The function <C>EnumerateKB</C> builds a catalogue of irreducible   -->
<!-- words in the generators of a monoid with respect to a set of rules. -->
When <C>rules</C> is a complete rewrite system for <C>G</C> 
the list returned is a set of normal forms for the group elements. 
For <C>q8</C> this list is 
<Display>
[\; {\rm id},\; a^+,\; b^+,\; a^-,\; b^-,\; a^{+2},\; a^+b^+,\; a^+b^-\; ]. 
</Display>
<P/>
</Description>
</ManSection>
<Example>
<![CDATA[
gap> elmq8 := ElementsOfMonoidPresentation( q8 );; 
gap> PrintLnUsingLabels( elmq8, genfmq8, q8labs ); 
id, a, b, A, B, a^2, a*b, a*B ]
]]>
</Example>
</Section>
</Chapter>

94%


¤ Dauer der Verarbeitung: 0.29 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

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 ist noch experimentell.