Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
| Download
GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
Project: cocalc-sagemath-dev-slelievre
Views: 4183461[1m[4m[31m7. Computating the commutative image of a rational language[0m234[1m[4m[31m7.1 Semilinear Sets[0m56The commutative image of a rational language is a semilinear set. One may7adapt the functions to compute a rational expression for the language8recognized by an automaton in order to compute directly the commutative9image of the language recognized by the automaton. Further improvement leads10to the direct computation of the closure in Bbb Z^n, for the profinite11topology, of that commutative image. (See [D01] for the correction of the12algorithms.) Recall that (see [D98]) if a semilinear set given by the13semilinear expression a+b_1Bbb N+ cdots +b_pBbb N, then a+b_1Bbb Z+ cdots14+b_pBbb Z is a Bbb Z-semilinear expression for the closure under the15profinite topology of the semilinear set given. We use the terminology16[22m[32mcommutative language[0m and [22m[32mAbelian language[0m for subsets of Bbb N and Bbb Z17respectively. \index{commutative!language}\index{Abelian!language} The18[22m[32mcommutative language recognized by an automaton[0m (resp. GTG) is the19commutative image of the language recognized by the automaton (resp. GTG).20The [22m[32mAbelian language recognized by an automaton[0m (resp. GTG) is the closure21under the profinite topology of the commutative image of the language22recognized by the automaton (resp. GTG).2324[1m[4m[31m7.1-1 RemoveStateCom[0m2526[1m[34m> RemoveStateCom( [0m[22m[34mgtg[0m[1m[34m ) ___________________________________________[0mfunction2728The first state of generalized transition graph [22m[32mgtg[0m is removed. The GTG29obtained recognizes the same commutative language than the original.3031[1m[4m[31m7.1-2 DDAtoGTGCom[0m3233[1m[34m> DDAtoGTGCom( [0m[22m[34mA[0m[1m[34m ) ________________________________________________[0mfunction3435Transforms a dense deterministic finite automaton into a finite GTG36recognizing the same commutative language.3738[1m[4m[31m7.1-3 LangGTGCom[0m3940[1m[34m> LangGTGCom( [0m[22m[34mgtg[0m[1m[34m ) _______________________________________________[0mfunction4142Computes the commutative language recognized by a GTG.4344[1m[4m[31m7.1-4 LanguageCom[0m4546[1m[34m> LanguageCom( [0m[22m[34maut[0m[1m[34m ) ______________________________________________[0mfunction4748Computes the commutative language recognized by a dense deterministic49automaton.5051[22m[35m--------------------------- Example ----------------------------[0m52[22m[35m gap> aut := Automaton("det",5,2,[[1,2,4,2,1],[1,1,1,5,1]],[3],[2,3,4,5]);[0m53[22m[35m | 1 2 3 4 5 [0m54[22m[35m - - - - - - - [0m55[22m[35m a | 1 2 4 2 1 [0m56[22m[35m b | 1 1 1 5 1 [0m57[22m[35mInitial state: [ 3 ][0m58[22m[35mAccepting states: [ 2, 3, 4, 5 ][0m59[22m[35m[0m60[22m[35mgap> AutomatonToRatExp(aut);[0m61[22m[35m1UabUa(1Uaa*)[0m62[22m[35mgap> LanguageCom(aut);[0m63[22m[35m[ [ 1, 1 ], [ 0, 0 ], [ 1, 0 ], [ 2, 0 ], [ 3, 0 ] + [ 1, 0 ] N ][0m64[22m[35m------------------------------------------------------------------[0m6566It is obvious that not all possible simplifications have been carried out.67The case of Bbb Z-semilinear sets is similar, but some more simplifications68are done.6970[1m[4m[31m7.1-5 RemoveStateAb[0m7172[1m[34m> RemoveStateAb( [0m[22m[34mgtg[0m[1m[34m ) ____________________________________________[0mfunction7374The first state of generalized transition graph [22m[32mgtg[0m is removed. The Abelian75language recognized by the GTG is the same than the Abelian language76recognized by the original GTG. Several simplifications are done.77Computations of normal forms of matrices aiming to determine basis for78subgroups of Bbb Z^n are made. These computations of normal forms are79carried out using functions that are part of \GAP.8081[1m[4m[31m7.1-6 DDAtoGTGAb[0m8283[1m[34m> DDAtoGTGAb( [0m[22m[34maut[0m[1m[34m ) _______________________________________________[0mfunction8485Transforms a dense deterministic finite automaton into a finite GTG86recognizing the same Abelian language than the Abelian language recognized87by the original automaton.8889[1m[4m[31m7.1-7 LangGTGAb[0m9091[1m[34m> LangGTGAb( [0m[22m[34mgtg[0m[1m[34m ) ________________________________________________[0mfunction9293Computes the Abelian language recognized by a GTG. It uses the fact that if94when removing a state we obtain an edge labeled by Bbb Z^n, then the95resulting language is Bbb Z^n.9697[1m[4m[31m7.1-8 LanguageAb[0m9899[1m[34m> LanguageAb( [0m[22m[34mA[0m[1m[34m ) _________________________________________________[0mfunction100101Computes the Abelian language recognized by a deterministic automaton. For102the automaton considered above, we obtain103104[22m[35m--------------------------- Example ----------------------------[0m105[22m[35mgap> LanguageAb(aut); [0m106[22m[35m[ [ 1, 1 ], [ 0, 0 ] + [ 1, 0 ] Z ][0m107[22m[35m------------------------------------------------------------------[0m108109110111