GAP (Kan) - Chapter 2: Double Coset Rewriting Systems

Goto Chapter: Top 1 2 3 Bib Ind
[Top of Book] [Contents] [Previous Chapter] [Next Chapter]

[MathJax on]

2 Double Coset Rewriting Systems
2.1 Rewriting Systems
2.1-1 KnuthBendixRewritingSystem
2.1-2 NextWord
2.2 Example 2 -- free product of two cyclic groups
2.2-1 DoubleCosetRewritingSystem
2.2-2 DisplayAsString
2.2-3 WordAcceptorOfReducedRws
2.3 Example 3 -- the trefoil group
2.3-1 PartialDoubleCosetRewritingSystem
2.4 Example 4 -- an infinite rewriting system
2.4-1 KBMagRewritingSystem
2.4-2 DCrules
2.4-3 WordToString

### 2 Double Coset Rewriting Systems

The 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 [BGHW06], which describes the algorithms used in this package.

#### 2.1 Rewriting Systems

##### 2.1-1 KnuthBendixRewritingSystem

`‣ KnuthBendixRewritingSystem`( grp, gensorder, ordering, alph ) | ( operation )

`‣ ReducedConfluentRewritingSystem`( grp, gensorder, ordering, lim, alph ) | ( operation )

`‣ DisplayRwsRules`( rws ) | ( operation )

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

We take as an example the fundamental group of the oriented surface of genus 2. The generators are by default ordered `[A,a,B,b,C,c,D,d]`, so the list `L = [2,1,4,3,6,5,8,7]` is used to specify the order `[a,A,b,B,c,C,d,D]` to be used with the wreath ordering. Specifying a limit `0` means that no limit is prescribed.

The operation `DisplayRwsRules` prints out the rules using the letters in the given alphabet `alph4` rather than using the generators of the monoid.

An additional method for `ReducedForm(G,g)` is provided for a finitely presented group `G` with a rewriting system and an element `g` of `G`.

    gap> F4 := FreeGroup( 4 );;
    gap> rels := [ Comm(F4.1,F4.2) * Comm(F4.3,F4.4) ];;
    gap> H4 := F4/rels;;
    gap> L := [2,1,4,3,6,5,8,7];;
    gap> order := "wreath";;
    gap> alph4 := "aAbBcCdD";;
    gap> rws4 := ReducedConfluentRewritingSystem( H4, L, order, 0, alph4 );;
    gap> DisplayRwsRules( rws4 );
    [ [ aA, id ], [ Aa, id ], [ bB, id ], [ Bb, id ], [ cC, id ], [ Cc, id ], [ dD\
    , id ], [ Dd, id ], [ cd, dcBAba ], [ cBAbaD, Dc ], [ CD, BAbaDC ], [ Cd, dABa\
    bC ] ]
    true
    gap> a := H4.1;;  b := H4.2;;  c := H4.3;;  d := H4.4;;
    gap> ReducedForm( H4, c*d);
    f4*f3*f2^-1*f1^-1*f2*f1

##### 2.1-2 NextWord

`‣ NextWord`( rws, w, limit ) | ( operation )

`‣ NextWords`( rws, w, length, limit ) | ( operation )

The `NextWord` operation finds the next recognizable word after `w` using the rewriting system `rws`. The third parameter is the maximum number of words that will be tested before giving up. (If no limit is provided the number 100,000 is used.)

The `NextWords` operation applies `NextWord` repeatedly and returns a list of the specified length of recognizable words. (If, at any stage, the limit is reached, a truncated list is returned.)

    gap> free4 := FreeMonoidOfRewritingSystem( rws4 );;
    gap> gens4 := GeneratorsOfMonoid( free4 );
    [ f1, f1^-1, f2, f2^-1, f3, f3^-1, f4, f4^-1 ]
    gap> NextWord( rws4, gens4[5]*gens4[7] );
    f3*f4^-1
    gap> NextWords( rws4, last, 20, 100 );
    [ f3^-1*f1, f3^-1*f1^-1, f3^-1*f2, f3^-1*f2^-1, f3^-1^2, f4*f1, f4*f1^-1,
      f4*f2, f4*f2^-1, f4*f3, f4*f3^-1, f4^2, f4^-1*f1, f4^-1*f1^-1, f4^-1*f2,
      f4^-1*f2^-1, f4^-1*f3, f4^-1*f3^-1, f4^-1^2, f1^3 ]

#### 2.2 Example 2 -- free product of two cyclic groups

##### 2.2-1 DoubleCosetRewritingSystem

`‣ DoubleCosetRewritingSystem`( G, H, K, rws ) | ( function )

`‣ IsDoubleCosetRewritingSystem`( dcrws ) | ( property )

A double coset rewriting system for the double cosets H backslash G / K requires as data a finitely presented group G; subgroups H, K of G; and a rewriting system `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 `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 ∈ [0..5], j ∈ [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, `[[Aa,id],[aA,id],[Bb,id],[bB,id]]`, where `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,

- there are two H-rules, [[Ha^4,HA^2],[HA^3,Ha^3]],

- there are two K-rules, [[a^3K,AK],[A^2K,a^2K]],

- and there are two H-K-rules, [[Ha^2K,HK],[HAK,HaK]].

Here is how the computation may be performed.

    gap> G1 := FreeGroup( 2 );;
    gap> L1 := [2,1,4,3];;
    gap> order := "shortlex";;
    gap> alph1 := "AaBb";;
    gap> 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 ...> ] ]
    gap> DisplayRwsRules( rws1 );;
    [ [ Aa, id ], [ aA, id ], [ Bb, id ], [ bB, id ] ]
    gap> genG1 := GeneratorsOfGroup( G1 );;
    gap> H1 := Subgroup( G1, [ genG1[1]^6 ] );;
    gap> K1 := Subgroup( G1, [ genG1[1]^4 ] );;
    gap> dcrws1 := DoubleCosetRewritingSystem( G1, H1, K1, rws1 );;
    gap> IsDoubleCosetRewritingSystem( dcrws1 );
    true
    gap> 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 ] ]

An example of obtaining the reduced form of a word using this rewriting system is given in the following section.

##### 2.2-2 DisplayAsString

`‣ DisplayAsString`( word, alph ) | ( operation )

This operation displays a double coset using letters of the alphabet obtained by concatenating `"HK"` with the alphabet for the monoid obtained above. In the example a double coset `w` and its reduced form `rw` are displayed.

    gap> free := FreeMonoidOfRewritingSystem( dcrws1 );;
    gap> mon := MonoidOfRewritingSystem( dcrws1 );;
    gap> gens := GeneratorsOfMonoid( free );;
    gap> H := gens[1];;  K := gens[2];;
    gap> A := gens[3];;  a := gens[4];;
    gap> B := gens[5];;  b := gens[6];;
    gap> alph2 := Concatenation( "HK", alph1 );
    "HKAaBb"
    gap> w := H*a^5*b^3*a^5*K;
    m1*m4^5*m6^3*m4^5*m2
    gap> DisplayAsString( w, alph2 );
    HaaaaabbbaaaaaK
    gap> rw := ReducedForm( dcrws1, w );
    m1*m3*m6^3*m4*m2
    gap> DisplayAsString( rw, alph2 );
    HAbbbaK

##### 2.2-3 WordAcceptorOfReducedRws

`‣ WordAcceptorOfReducedRws`( rws ) | ( attribute )

`‣ WordAcceptorOfDoubleCosetRws`( rws ) | ( attribute )

`‣ IsWordAcceptorOfDoubleCosetRws`( aut ) | ( property )

Using functions from the Automata package, we may

- compute a word acceptor for the rewriting system of G;

- compute a word acceptor for the double coset rewriting system;

- test a list of words to see whether they are recognised by the automaton;

- obtain a rational expression for the language of the automaton.

    gap> 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 ]);;
    gap> wadc1 := WordAcceptorOfDoubleCosetRws( dcrws1 );
    < deterministic automaton on 6 letters with 15 states >
    gap> 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 ]);;
    gap> words1 := [ "HK","HaK","HbK","HAK","HaaK","HbbK","HabK","HbaK","HbaabK"];;
    gap> valid1 := List( words1, w -> IsRecognizedByAutomaton( wadc1, w ) );
    [ true, true, true, false, false, true, true, true, true ]
    gap> 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)

#### 2.3 Example 3 -- the trefoil group

##### 2.3-1 PartialDoubleCosetRewritingSystem

`‣ PartialDoubleCosetRewritingSystem`( grp, Hgens, Kgens, rws, limit ) | ( operation )

`‣ WordAcceptorOfPartialDoubleCosetRws`( grp, prws ) | ( 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 [c,d] and relator [c^3 = d^2] when the wreath product ordering is used with C > c > D > d. The group itself has a rewriting system with just 6 rules.

    gap> FT := FreeGroup( 2 );;
    gap> relsT := [ FT.1^3*FT.2^-2 ];;
    gap> T := FT/relsT;;
    gap> genT := GeneratorsOfGroup( T );;
    gap> U := Subgroup( T, [ genT[1] ] );;
    gap> V := Subgroup( T, [ genT[2] ] );;
    gap> alphT := "cCdD";;
    gap> ordT := [3,4,1,2];;
    gap> orderT := "wreath";;
    gap> rwsT := ReducedConfluentRewritingSystem( T, ordT, orderT, 0, alphT );;
    gap> DisplayRwsRules( rwsT );;
    [ [ dD, id ], [ Dd, id ], [ C, ccDD ], [ ccc, dd ], [ ddc, cdd ], [ Dc, dcDD ]\
     ]
    gap> accT := WordAcceptorOfReducedRws( rwsT );
    < deterministic automaton on 4 letters with 7 states >
    gap> Print( "accT = ", accT );
    accT = Automaton("det",7,"dDcC",[ [ 6, 2, 2, 4, 6, 4, 6 ], [ 3, 2, 3, 2, 3, 2,\
     3 ], [ 7, 2, 2, 2, 2, 7, 5 ], [ 2, 2, 2, 2, 2, 2, 2 ] ],[ 1 ],[ 1, 3, 4, 5, 6\
    , 7 ]);;
    gap> langT := FAtoRatExp( accT );
    (dcUc)((cdUd)c)*((cdUd)(dd*U@)Uc(DD*U@)UDD*U@)Ud(dd*U@)UDD*U@

In the following example we reduce the word w = d^5c^5 to dc^2d^6 and check that only the latter is recognised by the automaton `accT`.

    gap> free := FreeMonoidOfRewritingSystem( rwsT );;
    gap> gens := GeneratorsOfMonoid( free );;
    gap> c := gens[1];;  C := gens[2];;  d := gens[3];;  D := gens[4];;
    gap> w := d^5*c^5;
    f2^5*f1^5
    gap> sw := WordToString( w, alphT );
    "dddddccccc"
    gap> IsRecognizedByAutomaton( accT, sw );
    false
    gap> rw := ReducedForm( rwsT, w );
    f2*f1^2*f2^6
    gap> srw := WordToString( rw, alphT );
    "dccdddddd"
    gap> IsRecognizedByAutomaton( accT, srw );
    true

In earlier versions of 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 even earlier versions of Kan (in 0.95 for example) a shorter rational expression for the language was obtained from Automata. In what follows, we check that the two expressions define the same language.

    gap> alph := AlphabetOfRatExpAsList( langT );;
    gap> a1 := RatExpOnnLetters( alph, [ ], [1] );;   ## y
    gap> a2 := RatExpOnnLetters( alph, [ ], [2] );;   ## Y
    gap> a3 := RatExpOnnLetters( alph, [ ], [3] );;   ## x
    gap> a4 := RatExpOnnLetters( alph, [ ], [4] );;   ## X
    gap> s1 := RatExpOnnLetters( alph, "star", a1 );; ## y*
    gap> s2 := RatExpOnnLetters( alph, "star", a2 );; ## Y*
    gap> a1a3 := RatExpOnnLetters( alph, "product", [ a1, a3 ] );;  ## yx
    gap> u1 := RatExpOnnLetters( alph, "union", [ a1a3, a3 ] );;    ## yxUx
    gap> a3a1 := RatExpOnnLetters( alph, "product", [ a3, a1 ] );;  ## xy
    gap> u2 := RatExpOnnLetters( alph, "union", [ a3a1, a1 ] );;    ## xyUy
    gap> u2a3 := RatExpOnnLetters( alph, "product", [ u2, a3 ] );;  ## (xyUy)x
    gap> su2a3 := RatExpOnnLetters( alph, "star", u2a3 );;          ## ((xyUy)x)*
    gap> u2s1 := RatExpOnnLetters( alph, "product", [ u2, s1 ] );;  ## (xyUy)y*
    gap> a3s2 := RatExpOnnLetters( alph, "product", [ a3, s2 ] );;  ## xY*
    gap> u3 := RatExpOnnLetters( alph, "union", [u2s1,a3s2,s2] );;
    gap> prod := RatExpOnnLetters( alph, "product", [u1,su2a3,u3] );;
    gap> a1s1 := RatExpOnnLetters( alph, "product", [ a1, s1 ] );;  ## yy*
    gap> r := RatExpOnnLetters( alph, "union", [ prod, a1s1, s2] );
    (yxUx)((xyUy)x)*((xyUy)y*UxY*UY*)Uyy*UY*
    gap> AreEqualLang( langT, r );
    true

If we now take subgroups H=⟨ c ⟩ and K = ⟨ d ⟩ we find that 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 `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.

    gap> prwsT := PartialDoubleCosetRewritingSystem( T, U, V, rwsT, 20 );;
    #I WARNING: reached supplied limit 20 on number of rules
    gap> DisplayRwsRules( prwsT );
    G-rules:
    [ [ C, ccDD ], [ dD, id ], [ Dc, dcDD ], [ Dd, id ], [ ccc, dd ], [ ddc, cdd ]\
     ]
    H-rules:
    [ [ Hc, H ],
      [ HD, Hd ],
      [ Hdd, H ],
      [ Hdcdd, Hdc ],
      [ HdcD, Hdcd ],
      [ Hdcdcdd, Hdcdc ],
      [ Hdccdd, Hdcc ],
      [ HdccD, Hdccd ],
      [ HdcdcD, Hdcdcd ],
      [ Hdcdcdcdd, Hdcdcdc ],
      [ Hdcdccdd, Hdcdcc ],
      [ Hdccdcdd, Hdccdc ],
      [ HdccdcDD, Hdccdc ] ]
    K-rules:
    [ [ dK, K ],
      [ DK, K ] ]

This list of partial rules is then used to produce a modified word acceptor function.

We then construct the double coset Hd^5c^5K and find its reduced form (compare this with the earlier example).

    gap> paccT := WordAcceptorOfPartialDoubleCosetRws( T, prwsT );;
    < deterministic automaton on 6 letters with 6 states >
    gap> 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 ]);;
    gap> plangT := FAtoRatExp( paccT );
    H(yx(yx)*x)*(yx(yx)*KUK)
    gap> wordsT := ["HK", "HxK", "HyK", "HYK", "HyxK", "HyxxK", "HyyH", "HyxYK"];;
    gap> validT := List( wordsT, w -> IsRecognizedByAutomaton( paccT, w ) );
    [ true, false, false, false, true, true, false, false ]

    gap> pfree := FreeMonoidOfRewritingSystem( prwsT );;
    gap> pgens := GeneratorsOfMonoid( pfree );;
    gap> H := pgens[1];;  K := pgens[2];;
    gap> c := pgens[3];;  C := pgens[4];;
    gap> d := pgens[5];;  D := pgens[6];;
    gap> palphT := Concatenation( "HK", alphT );
    "HKcCdD"
    gap> pw := H*d^5*c^5*K;;  DisplayAsString( pw, palphT );
    HdddddcccccK
    gap> rpw := ReducedForm( prwsT, pw );;
    gap> spw := WordToString( rpw, palphT );
    "HdccK"
    gap> ok := IsRecognizedByAutomaton( paccT, spw );
    true

#### 2.4 Example 4 -- an infinite rewriting system

##### 2.4-1 KBMagRewritingSystem

`‣ KBMagRewritingSystem`( fpgrp ) | ( attribute )

`‣ KBMagWordAcceptor`( fpgrp ) | ( attribute )

`‣ KBMagFSAtoAutomataDFA`( fsa, alph ) | ( operation )

`‣ WordAcceptorByKBMag`( grp, alph ) | ( operation )

`‣ WordAcceptorByKBMagOfDoubleCosetRws`( grp, dcrws ) | ( 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 `KBMagWordAcceptor` which calls KBMag to compute a word acceptor for G, and `KBMagFSAtoAutomataDFA` to convert this to a deterministic automaton as used by the Automata package. The resulting `dfa` forms part of the double coset automaton, together with sufficient H-rules, K-rules and H-K-rules found by the function `PartialDoubleCosetRewritingSystem`. (Note that these five attributes and operations will not be available if the KBMag package has not been loaded.)

In the following example we take a two generator group G4 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 KBMag has a word acceptor with 17 states.

    gap> F4 := FreeGroup("a","b");;
    gap> rels4 := [ F4.1^3, F4.2^3, (F4.1*F4.2)^3 ];;
    gap> G4 := F4/rels4;;
    gap> alph4 := "AaBb";;
    gap> waG4 := WordAcceptorByKBMag( G4, alph4 );;
    gap> Print( waG4, "\n");
    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 ]);;
    gap> langG4 := FAtoRatExp( waG4 );
    ((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@
    gap> IsRecognizedByAutomaton( waG4, "Aba" );
    true
    gap> IsRecognizedByAutomaton( waG4, "AbaB" );
    false

##### 2.4-2 DCrules

`‣ DCrules`( dcrws ) | ( operation )

`‣ Hrules`( dcrws ) | ( attribute )

`‣ Krules`( dcrws ) | ( attribute )

`‣ HKrules`( dcrws ) | ( 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 [BGHW06]) three infinite sets of rules and a limit for the automata.

    gap> lim := 100;;
    gap> genG4 := GeneratorsOfGroup( G4 );;
    gap> a := genG4[1];;  b := genG4[2];;
    gap> H4 := Subgroup( G4, [ a*b ] );;
    gap> K4 := Subgroup( G4, [ b*a ] );;
    gap> rwsG4 := KnuthBendixRewritingSystem( G4, "shortlex", [2,1,4,3], alph4 );;
    gap> dcrws4 := PartialDoubleCosetRewritingSystem( G4, H4, K4, rwsG4, limit );;
    #I using PartialDoubleCosetRewritingSystem with limit 100
    #I  51 rules, and 1039 pairs
    #I WARNING: reached supplied limit 100 on number of rules
    gap> Print( Length( Rules( dcrws4 ) ), " rules found.\n" );
    101 rules found.
    gap> dcaut4 := WordAcceptorByKBMagOfDoubleCosetRws( G4, dcrws4 );;
    gap> Print( "Double Coset Minimalized automaton:\n", dcaut4 );
    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 ]);;
    gap> dclang4 := FAtoRatExp( dcaut4 );;
    gap> Print( "Double Coset language of acceptor:\n", dclang4, "\n" );
    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)
    gap> ok := DCrules(dcrws4);;
    gap> alph4e := dcrws4!.alphabet;;
    gap> Print("H-rules:\n");  DisplayAsString( Hrules(dcrws4), alph4e, true );
    H-rules:
    [ HB, Ha ]
    [ HaB, Hb ]
    [ Hab, H ]
    [ HbAB, HAba ]
    [ HbAbAB, HAbAba ]
    [ HbAbAbAB, HAbAbAba ]
    [ HbAbAbAbAB, HAbAbAbAba ]
    [ HbAbAbAbAbAB, HAbAbAbAbAba ]
    [ HbAbAbAbAbAbAB, HAbAbAbAbAbAba ]
    [ HbAbAbAbAbAbAbAB, HAbAbAbAbAbAbAba ]
    gap> Print("K-rules:\n");  DisplayAsString( Krules(dcrws4), alph4e, true );;
    K-rules:
    [ BK, aK ]
    [ BaK, bK ]
    [ baK, K ]
    [ BAbK, abAK ]
    [ BAbAbK, abAbAK ]
    [ BAbAbAbK, abAbAbAK ]
    [ BAbAbAbAbK, abAbAbAbAK ]
    [ BAbAbAbAbAbK, abAbAbAbAbAK ]
    [ BAbAbAbAbAbAbK, abAbAbAbAbAbAK ]
    [ BAbAbAbAbAbAbAbK, abAbAbAbAbAbAbAK ]
    gap> Print("HK-rules:\n");  DisplayAsString( HKrules(dcrws4), alph4e, true );;
    HK-rules:
    [ HbK, HAK ]
    [ HbAbK, HAbAK ]
    [ HbAbAbK, HAbAbAK ]
    [ HbAbAbAbK, HAbAbAbAK ]
    [ HbAbAbAbAbK, HAbAbAbAbAK ]
    [ HbAbAbAbAbAbK, HAbAbAbAbAbAK ]
    [ HbAbAbAbAbAbAbK, HAbAbAbAbAbAbAK ]

##### 2.4-3 WordToString

`‣ WordToString`( word, alph ) | ( operation )

`‣ IdentityDoubleCoset`( dcrws ) | ( operation )

The `NextWord` operation (see 2.1-2) may be used to find normal forms of increasing length for double coset representatives. In the example below a limit of 50,000 (for the number of words tested) is specified since the 29 numbers of words tested can be shown to be:

\begin{array}{c} [\ 1,\ 1,\ 6,\ 9,\ 12,\ 4,\ 91,\ 12,\ 153,\ 12,\ 192,\ 52,\ 1435,\ 192,\ 12,\ 2457,\ 192,\\ 12,\ 3072,\ 820,\ 22939,\ 3072,\ 19,\ 12,\ 39321,\ 3072,\ 192,\ 12,\ 49152\ ] \end{array}

    gap> idc := IdentityDoubleCoset( dcrws4 );
    m1*m2
    gap> ## List of the next 29 normal forms for double cosets:
    gap> L4 := NextWords( dcrws4, idc, 29, 50000 );;
    gap> DisplayAsString( L4, alph4e, true );
    [ HAK, HaK, HAbK, HbAK, HABAK, HAbAK, HABabK, HAbAbK, HbAbAK, HbaBAK, HABaBAK,\
     HAbAbAK, HABaBabK, HAbABabK, HAbAbAbK, HbAbAbAK, HbaBAbAK, HbaBaBAK, HABaBaBA\
    K, HAbAbAbAK, HABaBaBabK, HAbABaBabK, HAbAbABabK, HAbAbAbAbK, HbAbAbAbAK, HbaB\
    AbAbAK, HbaBaBAbAK, HbaBaBaBAK, HABaBaBaBAK ]
    gap> w := NextWord( dcrws4, L4[29] );;
    gap> Print( w, "\n" );
    m1*(m3*m6)^4*m3*m2
    gap> s := WordToString( w, alph4e );;
    gap> Print( s, "\n" );
    HAbAbAbAbAK

[Top of Book] [Contents] [Previous Chapter] [Next Chapter]
Goto Chapter: Top 1 2 3 Bib Ind

generated by GAPDoc2HTML