  
  [1X4 [33X[0;0YFrom Networks to Automata[133X[101X
  
  [33X[0;0YIt  is  known  that  the  language  of  all encoded permutations of a TPN is
  rational,  and  thus  is it indeed possible to turn a TPN into an automaton.
  The  idea  is  to inspect all dispositions of tokens within the TPN and find
  equivalence  classes  of  these  dispositions, for more details consult [3].
  Adding  a  constraint,  which limits the number of tokens at any time within
  the TPN, is also considered in this chapter.[133X
  
  [33X[0;0YThe  algorithms  featured in this chapter do not return the minimal automata
  representing  the  input TPN as they are exactly visualising the equivalence
  classes  of  the dispositions of the tokens in the TPN. The automaton can be
  minimalised  by  choice,  as it simplifies future computations involving the
  automaton also is makes the automata more legible.[133X
  
  
  [1X4.1 [33X[0;0YFunctions[133X[101X
  
  [1X4.1-1 GraphToAut[101X
  
  [33X[1;0Y[29X[2XGraphToAut[102X( [3Xg[103X, [3Xinnode[103X, [3Xoutnode[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10YAn automaton representing the input TPN.[133X
  
  [33X[0;0Y[10XGraphToAut[110X  turns an array represented directed graph, with a distinct input
  node  and  a  distinct  output  node, into the corresponding automaton, that
  accepts the language build by the resulting rank encoded permutations of the
  directed graph.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx:=Seqstacks(2,2);[127X[104X
    [4X[28X[ [ 2 ], [ 3, 4 ], [ 2 ], [ 5, 6 ], [ 4 ], [  ] ][128X[104X
    [4X[25Xgap>[125X [27Xaut:=GraphToAut(x,1,6);[127X[104X
    [4X[28X< epsilon automaton on 4 letters with 64 states >[128X[104X
    [4X[25Xgap>[125X [27Xaut:=MinimalAutomaton(aut);[127X[104X
    [4X[28X< deterministic automaton on 3 letters with 3 states >[128X[104X
    [4X[25Xgap>[125X [27XDisplay(aut);[127X[104X
    [4X[28X   |  1  2  3  [128X[104X
    [4X[28X--------------[128X[104X
    [4X[28X a |  1  3  1  [128X[104X
    [4X[28X b |  3  3  3  [128X[104X
    [4X[28X c |  2  2  2  [128X[104X
    [4X[28XInitial state:   [ 1 ][128X[104X
    [4X[28XAccepting state: [ 1 ][128X[104X
    [4X[25Xgap>[125X [27X[127X[104X
  [4X[32X[104X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx:=Parstacks(2,2);[127X[104X
    [4X[28X[ [ 2, 4 ], [ 3, 6 ], [ 2 ], [ 5, 6 ], [ 4 ], [  ] ][128X[104X
    [4X[25Xgap>[125X [27Xaut:=GraphToAut(x,1,6);[127X[104X
    [4X[28X< epsilon automaton on 5 letters with 66 states >[128X[104X
    [4X[25Xgap>[125X [27Xaut:=MinimalAutomaton(aut);[127X[104X
    [4X[28X< deterministic automaton on 4 letters with 9 states >[128X[104X
    [4X[25Xgap>[125X [27XDisplay(aut);[127X[104X
    [4X[28X   |  1  2  3  4  5  6  7  8  9  [128X[104X
    [4X[28X--------------------------------[128X[104X
    [4X[28X a |  1  2  1  3  2  2  6  6  3  [128X[104X
    [4X[28X b |  3  2  3  3  4  3  6  9  3  [128X[104X
    [4X[28X c |  9  2  9  4  6  6  4  9  9  [128X[104X
    [4X[28X d |  8  2  8  7  5  5  7  8  8  [128X[104X
    [4X[28XInitial state:   [ 1 ][128X[104X
    [4X[28XAccepting state: [ 1 ][128X[104X
    [4X[25Xgap>[125X [27X[127X[104X
  [4X[32X[104X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx:=BufferAndStack(3,2);[127X[104X
    [4X[28X[ [ 2 .. 4 ], [ 5 ], [ 5 ], [ 5 ], [ 6, 7 ], [ 5 ], [  ] ][128X[104X
    [4X[25Xgap>[125X [27Xaut:=GraphToAut(x,1,7);[127X[104X
    [4X[28X< epsilon automaton on 5 letters with 460 states >[128X[104X
    [4X[25Xgap>[125X [27Xaut:=MinimalAutomaton(aut);[127X[104X
    [4X[28X< deterministic automaton on 4 letters with 4 states >[128X[104X
    [4X[25Xgap>[125X [27XDisplay(aut);[127X[104X
    [4X[28X   |  1  2  3  4  [128X[104X
    [4X[28X-----------------[128X[104X
    [4X[28X a |  1  4  1  3  [128X[104X
    [4X[28X b |  3  4  3  3  [128X[104X
    [4X[28X c |  4  4  4  4  [128X[104X
    [4X[28X d |  2  2  2  2  [128X[104X
    [4X[28XInitial state:   [ 1 ][128X[104X
    [4X[28XAccepting state: [ 1 ][128X[104X
    [4X[25Xgap>[125X [27X[127X[104X
  [4X[32X[104X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx:=[[2,3],[4],[5],[3,6],[6],[]];[127X[104X
    [4X[28X[ [ 2, 3 ], [ 4 ], [ 5 ], [ 3, 6 ], [ 6 ], [  ] ][128X[104X
    [4X[25Xgap>[125X [27Xaut:=GraphToAut(x,1,6);[127X[104X
    [4X[28X< epsilon automaton on 4 letters with 80 states >[128X[104X
    [4X[25Xgap>[125X [27Xaut:=MinimalAutomaton(aut);[127X[104X
    [4X[28X< deterministic automaton on 3 letters with 8 states >[128X[104X
    [4X[25Xgap>[125X [27XDisplay(aut);[127X[104X
    [4X[28X   |  1  2  3  4  5  6  7  8  [128X[104X
    [4X[28X-----------------------------[128X[104X
    [4X[28X a |  1  3  1  4  6  1  6  1  [128X[104X
    [4X[28X b |  3  8  3  4  4  6  6  6  [128X[104X
    [4X[28X c |  2  2  2  4  5  5  7  7  [128X[104X
    [4X[28XInitial state:   [ 1 ][128X[104X
    [4X[28XAccepting state: [ 1 ][128X[104X
    [4X[25Xgap>[125X [27X[127X[104X
  [4X[32X[104X
  
  [33X[0;0YThe input TPN here is the first network described in Chapter [14X2.[114X.[133X
  
  [1X4.1-2 ConstrainedGraphToAut[101X
  
  [33X[1;0Y[29X[2XConstrainedGraphToAut[102X( [3Xg[103X, [3Xinnode[103X, [3Xoutnode[103X, [3Xcapacity[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10YAn automaton representing the input TPN with bounded capacity.[133X
  
  [33X[0;0Y[10XConstrainedGraphToAut[110X  builds an epsilon automaton based on the same idea as
  [10XGraphToAut[110X,  so  it  takes  a  list  representation  of  a directed graph, a
  designated  input node and a distinct output node, but additionally there is
  the  constraint  that  there can be at most [10Xcapacity[110X tokens in the graph, at
  any time.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx:=Seqstacks(2,2);                  [127X[104X
    [4X[28X[ [ 2 ], [ 3, 4 ], [ 2 ], [ 5, 6 ], [ 4 ], [  ] ][128X[104X
    [4X[25Xgap>[125X [27Xaut:=ConstrainedGraphToAut(x,1,6,2);[127X[104X
    [4X[28X< epsilon automaton on 6 letters with 21 states >[128X[104X
    [4X[25Xgap>[125X [27Xaut:=MinimalAutomaton(aut);         [127X[104X
    [4X[28X< deterministic automaton on 5 letters with 3 states >[128X[104X
    [4X[25Xgap>[125X [27XDisplay(aut);                       [127X[104X
    [4X[28X   |  1  2  3  [128X[104X
    [4X[28X--------------[128X[104X
    [4X[28X a |  1  2  1  [128X[104X
    [4X[28X b |  3  2  3  [128X[104X
    [4X[28X c |  2  2  2  [128X[104X
    [4X[28X d |  2  2  2  [128X[104X
    [4X[28X e |  2  2  2  [128X[104X
    [4X[28XInitial state:   [ 1 ][128X[104X
    [4X[28XAccepting state: [ 1 ][128X[104X
    [4X[25Xgap>[125X [27X[127X[104X
  [4X[32X[104X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx:=BufferAndStack(3,2);      [127X[104X
    [4X[28X[ [ 2 .. 4 ], [ 5 ], [ 5 ], [ 5 ], [ 6, 7 ], [ 5 ], [  ] ][128X[104X
    [4X[25Xgap>[125X [27Xaut:=ConstrainedGraphToAut(x,1,6,3);[127X[104X
    [4X[28X< epsilon automaton on 7 letters with 112 states >[128X[104X
    [4X[25Xgap>[125X [27Xaut:=MinimalAutomaton(aut);[127X[104X
    [4X[28X< deterministic automaton on 6 letters with 4 states >[128X[104X
    [4X[25Xgap>[125X [27XDisplay(aut);[127X[104X
    [4X[28X   |  1  2  3  4  [128X[104X
    [4X[28X-----------------[128X[104X
    [4X[28X a |  1  2  1  3  [128X[104X
    [4X[28X b |  3  2  3  3  [128X[104X
    [4X[28X c |  4  2  4  4  [128X[104X
    [4X[28X d |  2  2  2  2  [128X[104X
    [4X[28X e |  2  2  2  2  [128X[104X
    [4X[28X f |  2  2  2  2  [128X[104X
    [4X[28XInitial state:   [ 1 ][128X[104X
    [4X[28XAccepting state: [ 1 ][128X[104X
    [4X[25Xgap>[125X [27X[127X[104X
  [4X[32X[104X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xx:=[[2,3],[4],[5],[3,6],[6],[]];                      [127X[104X
    [4X[28X[ [ 2, 3 ], [ 4 ], [ 5 ], [ 3, 6 ], [ 6 ], [  ] ][128X[104X
    [4X[25Xgap>[125X [27Xaut:=ConstrainedGraphToAut(x,1,6,3);[127X[104X
    [4X[28X< epsilon automaton on 6 letters with 48 states >[128X[104X
    [4X[25Xgap>[125X [27Xaut:=MinimalAutomaton(aut);         [127X[104X
    [4X[28X< deterministic automaton on 5 letters with 8 states >[128X[104X
    [4X[25Xgap>[125X [27XDisplay(aut);                       [127X[104X
    [4X[28X   |  1  2  3  4  5  6  7  8  [128X[104X
    [4X[28X-----------------------------[128X[104X
    [4X[28X a |  1  3  1  4  6  1  6  1  [128X[104X
    [4X[28X b |  3  8  3  4  4  6  6  6  [128X[104X
    [4X[28X c |  2  2  2  4  5  5  7  7  [128X[104X
    [4X[28X d |  4  4  4  4  4  4  4  4  [128X[104X
    [4X[28X e |  4  4  4  4  4  4  4  4  [128X[104X
    [4X[28XInitial state:   [ 1 ][128X[104X
    [4X[28XAccepting state: [ 1 ][128X[104X
    [4X[25Xgap>[125X [27X[127X[104X
  [4X[32X[104X
  
