  
  [1X2 [33X[0;0YToken Passing Networks[133X[101X
  
  [33X[0;0YA token passing network is a directed graph with a designated input node and
  a  designated  output node. The input node has no incoming edges whereas the
  output  node has no outgoing edges. Also the input node generates a sequence
  of  tokens,  labelled 1, 2, 3, ... . These tokens are passed on to the nodes
  within the graph, where each node, apart from the input and output node, can
  hold  at  most  one  token at any time. The edges do not hold tokens but are
  there  to  pass them on. The following must hold if a token [22Xt[122X moves from the
  node [22Xx[122X to the node [22Xy[122X.[133X
  
  [33X[0;0YThere  is  an edge from [22Xx[122X to [22Xy[122X; [22Xx[122X is the input node, and the tokens 1, 2, 3,
  ...  ,  [22Xt-1[122X have been moved, or [22Xx[122X is any other node but not the output node;
  lastly  either [22Xy[122X is the output node or [22Xy[122X is not the input node and currently
  is not occupied by a token. [ALTd.][133X
  
  [33X[0;0YToken  passing  networks,  or  TPNs,  are represented in [5XGAP[105X as a list. Each
  entry  of  the  list  is the index of the node within the TPN and contains a
  list  of  the  "destinations", i.e. the end of the edge or arrow where it is
  directed to.[133X
  
  [33X[0;0YHere is an example how the input of such a TPN looks in [5XGAP[105X:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xhex:=[[2,3],[4],[5],[3,6],[6],[]];[127X[104X
    [4X[28X[ [ 2, 3 ], [ 4 ], [ 5 ], [ 3, 6 ], [ 6 ], [  ] ][128X[104X
    [4X[25Xgap>[125X [27X[127X[104X
  [4X[32X[104X
  
  [33X[0;0YFrom  this  it  is visible that the input node is 1, as it has no other node
  pointing  any  arrows  towards  it,  and  the output node is 6, as it has no
  destinations (hence the empty list).[133X
  
  
  [1X2.1 [33X[0;0YSpecific TPN[133X[101X
  
  [33X[0;0YIn  [10XPatternClass[110X  there are several functions that define different kinds of
  specific token passing networks.[133X
  
  [1X2.1-1 Parstacks[101X
  
  [29X[2XParstacks[102X( [3Xm[103X, [3Xn[103X ) [32X function
  [6XReturns:[106X  [33X[0;10YA  list  that  represents  the  directed  edges of a token passing
            network.[133X
  
  [33X[0;0Y[10XParstacks[110X  constructs  a token passing network with 2 different sized stacks
  [10Xm,n[110X positioned in parallel.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XParstacks(2,2);[127X[104X
    [4X[28X[ [ 2, 4 ], [ 3, 6 ], [ 2 ], [ 5, 6 ], [ 4 ], [  ] ][128X[104X
    [4X[25Xgap>[125X [27X[127X[104X
  [4X[32X[104X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XParstacks(4,3);[127X[104X
    [4X[28X[ [ 2, 6 ], [ 3, 9 ], [ 2, 4 ], [ 3, 5 ], [ 4 ], [ 7, 9 ], [ 6, 8 ], [ 7 ],[128X[104X
    [4X[28X  [  ] ][128X[104X
    [4X[25Xgap>[125X [27X[127X[104X
  [4X[32X[104X
  
  [1X2.1-2 Seqstacks[101X
  
  [29X[2XSeqstacks[102X( [3Xn[103X[, [3Xm[103X[, [3Xo[103X[, [3Xp[103X[, [3X...[103X]]]] ) [32X function
  [6XReturns:[106X  [33X[0;10YA  list  that  represents  the  directed  edges of a token passing
            network.[133X
  
  [33X[0;0YThe token passing network build by [10XSeqstacks[110X contains a series of stacks (as
  many  as  you  have integers in the arguments list) each of different length
  (each integer in the argument list).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XSeqstacks(2,2);[127X[104X
    [4X[28X[ [ 2 ], [ 3, 4 ], [ 2 ], [ 5, 6 ], [ 4 ], [  ] ][128X[104X
    [4X[25Xgap>[125X [27X[127X[104X
  [4X[32X[104X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XSeqstacks(3,1,4);[127X[104X
    [4X[28X[ [ 2 ], [ 3, 5 ], [ 2, 4 ], [ 3 ], [ 4 ], [ 7, 10 ], [ 6, 8 ], [ 7, 9 ], [128X[104X
    [4X[28X  [ 8 ], [  ] ][128X[104X
    [4X[25Xgap>[125X [27X[127X[104X
  [4X[32X[104X
  
  [1X2.1-3 BufferAndStack[101X
  
  [29X[2XBufferAndStack[102X( [3Xm[103X, [3Xn[103X ) [32X function
  [6XReturns:[106X  [33X[0;10YA  list  that  represents  the  directed  edges of a token passing
            network.[133X
  
  [33X[0;0Y[10XBufferAndStack[110X  is a token passing network that consists of a buffer of size
  [10Xm[110X which is followed by a single stack of size [10Xn[110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XBufferAndStack(2,2);[127X[104X
    [4X[28X[ [ 2, 3 ], [ 4 ], [ 4 ], [ 5, 6 ], [ 4 ], [  ] ][128X[104X
    [4X[25Xgap>[125X [27X[127X[104X
  [4X[32X[104X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XBufferAndStack(4,3);[127X[104X
    [4X[28X[ [ 2 .. 5 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 7, 9 ], [ 6, 8 ], [ 7 ], [  ] ][128X[104X
    [4X[25Xgap>[125X [27X[127X[104X
  [4X[32X[104X
  
