GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
<Chapter><Heading>From Automata to Networks</Heading>1It is not only important to see how a TPN can be interpreted as a finite state automaton.2But also if an arbitrary automaton could represent the language of rank encoded permutations3of a TPN. Currently within <C>PatternClass</C> it is only possible to check whether4deterministic automata are possible representatives of a TPN.5<Section><Heading>Functions</Heading>67<ManSection>8<Func Name="IsStarClosed" Arg="aut"/>9<Returns> <K>true</K> if the start and accept states in <C>aut</C> are one and the same state. </Returns>10<Description>11This has the consequence that the whole rational expression accepted by <C>aut</C> is always enclosed by the12Kleene star.13<Example><![CDATA[14gap> x:=Automaton("det",4,2,[[3,4,2,4],[2,2,2,4]],[1],[2]);15< deterministic automaton on 2 letters with 4 states >16gap> IsStarClosed(x);17false18gap> AutToRatExp(x);19(a(aUb)Ub)b*20gap> y:=Automaton("det",3,2,[[3,2,1],[2,3,1]],[1],[1]);21< deterministic automaton on 2 letters with 3 states >22gap> IsStarClosed(y);23true24gap> AutToRatExp(y);25((ba*bUa)(aUb))*26gap> ]]></Example>27</Description>28</ManSection>2930<ManSection>31<Func Name="Is2StarReplaceable" Arg="aut"/>32<Returns> <K>true</K> if none of the states in the automaton <C>aut</C>, which33are not the initial state, have a transition to the initial state labelled with34the first letter of the alphabet. It also returns <C>true</C> if there is at least one35state <M>i \in Q</M> with the first two transitions from <M>i</M> being36<M>f(i,1)=1</M> and <M>f(i,2)=x</M>, where <M>x \in Q\setminus\{1\}</M> and37<M>f(x,1)=1</M>.</Returns>38<Description>39<Example><![CDATA[40gap> x:=Automaton("det",3,2,[[1,2,3],[2,2,3]],[1],[2]);41< deterministic automaton on 2 letters with 3 states >42gap> Is2StarReplaceable(x);43true44gap> y:=Automaton("det",4,2,[[4,1,1,2],[1,3,3,2]],[1],[1]);45< deterministic automaton on 2 letters with 4 states >46gap> Is2StarReplaceable(y);47true48gap> z:=Automaton("det",4,2,[[4,1,1,2],[1,4,2,2]],[1],[4]);49< deterministic automaton on 2 letters with 4 states >50gap> Is2StarReplaceable(z);51false52gap> ]]></Example>53</Description>54</ManSection>5556<ManSection>57<Func Name="IsStratified" Arg="aut"/>58<Returns><K>true</K> if <C>aut</C> has a specific "layered" form.</Returns>59<Description>60A formal description of the most basic stratified automaton is: <P/>61<M>(S,Q,f,q_{0},A)</M> with62<M>S:=\{1,...,n\},\,\, Q:=\{1,...,m\},\,\, n<m,\,\, q_{0}:=1,\,\,63A:=Q\setminus \{n+1\},\,\, f: Q \times S \rightarrow Q </M> and64<M>n+1</M> is a sink state. <P/>65If <M>i,j \in Q \setminus \{ n+1 \}</M>,with <M>i < j</M>, and <M>i',j' \in S</M>,66<M>i=i',\,\, j=j'</M> then67<Display Mode="M">f(i,i')=i,\,\, f(i,j')=j,\,\, f(j,j')=j,\,\, f(j,i')=j-1 \,\, or \,\, n+1.</Display>68<Example><![CDATA[69gap> x:=Automaton("det",4,2,[[1,3,1,4],[2,2,4,4]],[1],[2]);70< deterministic automaton on 2 letters with 4 states >71gap> IsStratified(x);72true73gap> y:=Automaton("det",4,2,[[1,3,2,4],[2,4,1,4]],[1],[2]);74< deterministic automaton on 2 letters with 4 states >75gap> IsStratified(y);76false77gap> ]]></Example>78</Description>79</ManSection>8081<ManSection>82<Func Name="IsPossibleGraphAut" Arg="aut"/>83<Returns> <K>true</K> if <C>aut</C> returns <C>true</C> in <C>IsStratified</C>, <C>Is2StarReplaceable</C> and84<C>IsStarClosed</C>.</Returns>85<Description>86An automaton that fulfils the three functions above has the right form to be an automaton representing87rank encoded permutations, which are output from a TPN.88<Example><![CDATA[89gap> x:=Automaton("det",2,2,[[1,2],[2,2]],[1],[1]);90< deterministic automaton on 2 letters with 2 states >91gap> IsPossibleGraphAut(x);92true93gap> y:=Automaton("det",2,2,[[1,2],[1,2]],[1],[1]);94< deterministic automaton on 2 letters with 2 states >95gap> IsPossibleGraphAut(y);96false97gap> IsStarClosed(y);98true99gap> Is2StarReplaceable(y);100true101gap> IsStratified(y);102false103gap> ]]></Example>104</Description>105</ManSection>106107</Section>108109</Chapter>110111