\input tikz.tex
\usetikzlibrary{calc,arrows.meta}

\tikzset{every picture/.style={font=\tt}}

\newdimen\TMttenskip

\font\elevensy=cmsy10 scaled 1100
\newfam\TMfontfam \def\TMfont{\fam\TMfontfam\elevensy}
\textfont\TMfontfam=\elevensy
\font\fourteensy=cmsy10 scaled 1400
\newfam\TMfontLfam \def\TMfontL{\fam\TMfontLfam\fourteensy}
\textfont\TMfontLfam=\fourteensy

\font\TMfontS=tctt1000
\def\S{{\TMfontS \char167}}

\let\typeout\message

\nopagenumbers

\def\TYPEOUT#1{}
% \let\TYPEOUT\typeout

\newif\ifRULES
% \RULEStrue

\def\TTEN{5.25pt}
\let\tten\TMttenskip
\tten=\TTEN

\let\bs\baselineskip

\long\def\extrabox#1 | #2|#3|#4{
  \setbox0\hbox{#4}
  \TYPEOUT{extra box #1: \the\wd0 \space \the\ht0 \space \the\dp0}
  \setbox0\hbox{#2%
    \vbox to 0pt{#3

      \ifRULES
      \setbox1\vbox{
        \setbox1\vbox to 0pt{\vss \hrule width \wd0 \vss}
        \copy1
        \nointerlineskip
        \vbox to 0pt{\vss \copy1 \vskip\ht0}
        \nointerlineskip
        \vbox to 0pt{\vskip\dp0 \box1 \vss}
        \nointerlineskip
        \setbox1\hbox to 0pt{\hss \vrule height \ht0 depth \dp0 \hss}
        \ht1=0pt \dp1=0pt \copy1
        \nointerlineskip
        \hbox to 0pt{\hskip\wd0 \box1 \hss}
      }

      \ht0=0pt \dp0=0pt
      \box0
      \unvbox1

      \else

      \ht0=0pt
      \box0

      \fi
      \vss}%
  }
  \TYPEOUT{extra box #1 complete: \the\wd0 \space \the\ht0 \space \the\dp0}
  \ifdim\hsize<\wd0\hsize=\wd0\fi
  \vskip-\baselineskip
  \unhbox0
}

\ifRULES
\tikzset{every path/.style={color=red,draw=blue,fill=green}}
\fi

\tikzset{LatexF/.tip={Latex[sep=-4pt]}}

\def\ARROW#1#2{
  \coordinate (M) at ($(#1)!0.55!(#2)$) ;
  \draw[-LatexF] (#1) -- (M) ;
  \draw (M) -- (#2) ;
}
\def\ARROWX[#1]#2#3{
  \scope [#1] \ARROW{#2}{#3} \endscope}

\def\BULLET#1{
  \filldraw (#1) circle (1.2pt) ;
}
\def\BULLETX[#1]#2{
  \scope [#1] \BULLET{#2} \endscope}

\def\TTthick{semithick}

\def\overharpoon#1{%
  \vbox{
    \setbox0\hbox{#1}
    \hbox{%
      \tikzpicture [trim left,trim right=0]
        \draw[\TTthick,arrows={-Straight Barb[harpoon]}]
        (0,0) -- (\the\wd0,0) ;
      \endtikzpicture
    }
    \nointerlineskip
    \vskip1.2pt
    \box0
  }%
}

\def\TTto{\hbox to 3\tten{%
    \hss
    \tikzpicture [baseline=-2.5pt]
      \draw[\TTthick,-Straight Barb] (0,0) -- (2*\TTEN,0) ;
    \endtikzpicture
    \hss}%
}

\def\TTsubscript#1{\lower 3.5pt\hbox{#1}}

\def\TMCaption#1{${\TMfont M}_{\hbox{#1}}$}
\def\TMCaptionL#1{${\TMfontL M}_{\hbox{#1}}$}

\def\TMclear{8pt}
\def\showTMCaption#1#2#3{
  \node[anchor=north,inner ysep=0,yshift=-\TMclear] at ($(#1)!1/2!(#2)$)
       {\TMCaption#3} ; }

\def\showTMCaptionL#1#2{
  \node[anchor=north,yshift=-55/9pt-14/11*\TMclear] at (#1)
       {\TMCaptionL#2} ; }

\def\dottedbox{%
  \tikzpicture [trim left,trim right=0,baseline=-55/18pt]
    \filldraw[x=2.8125pt,y=2.8125pt,radius=0.3pt]
    foreach \x in {0,28} { foreach \y in {-4,...,4} { (\x,\y) circle[] }}
    foreach \y in {-4,4} { foreach \x in {1,...,27} { (\x,\y) circle[] }} ;
  \endtikzpicture
}

\tt

\bs=10.92pt

\parindent=0pt

\catcode`\?=\active
\let?\

\vphantom{X}%

\hsize=0pt

\extrabox top line | | | {%
  \hskip33\tten
  -?\S
  ?1?-%
  \hskip30\tten
  -?12?-%
}

\ifRULES
\extrabox 1-2-3 | \hskip18.5\tten | \vskip5\bs \vskip-2pt \RULESfalse | {%
  \tikzpicture [trim left,baseline=0]
    \draw[cyan!50]
    foreach \X in {0,1,2,16,17,18}
    { (\X*\TTEN,55/9pt) -- (\X*\TTEN,-3*\bs-5pt) }
    foreach \X in {4,5,6}
    { (\X*\TTEN,55/9pt) -- (\X*\TTEN,-9*\bs-5pt) }
    ;
  \endtikzpicture
}
\fi

\extrabox 1 | \hskip18.5\tten | \vskip5\bs \vskip-2pt | {%

  \overharpoon{A0}\TTsubscript{2}%

  ?:?%

  \dottedbox

  ?a(bc)\TTto(ab)c?%

}

\extrabox 2 | \hskip19.5\tten | \vskip8\bs \vskip3pt | {%
  \tikzpicture [trim left,trim right=(20),baseline=(11)]

    \coordinate (11) at (0,0) ;
    \coordinate (20) at (16*\TTEN,0) ;

    \ARROW{11}{20} ;

    \BULLET{11} ;
    \BULLET{20} ;

    \node[anchor=south] at (11) {11} ;
    \node[anchor=south] at (20) {20} ;

    \showTMCaption{11}{20}{2}

  \endtikzpicture
}

\extrabox 3 | \hskip23.5\tten | \vskip14\bs \vskip3pt | {%
  \tikzpicture [trim left,baseline=(201)]

    \coordinate (201) at (0,0) ;

    \coordinate (300) at (-11*\TTEN,-37pt) ;
    \coordinate (210) at (-7*\TTEN,-107pt) ;

    \coordinate (111) at ([xscale=-1] 300) ;
    \coordinate (120) at ([xscale=-1] 210) ;

    \foreach \XXX/\YYY in {%
      111/201, 201/300, 120/210, 111/120, 210/300}
    \ARROW{\XXX}{\YYY} ;

    \foreach \XXX in {%
      201, 300, 210, 111, 120}
    \BULLET{\XXX} ;

    \node[anchor=south] at (201) {201} ;
    \node[anchor=east] at (300) {300} ;
    \node[anchor=east] at (210) {210} ;
    \node[anchor=west] at (111) {111} ;
    \node[anchor=west] at (120) {120} ;

    \showTMCaption{120}{210}{3}

  \endtikzpicture
}

\extrabox 4 | \hskip58\tten | \vskip4\bs \vskip-1pt | {%
  \tikzpicture [trim left,baseline=(3010)]

    \scope [x=6.25pt,y=5.08pt]

      \coordinate (3010) at (0,20) ;
      \coordinate (4000) at (0,15) ;

      \coordinate (3001) at (-5.5,5) ;
      \coordinate (3100) at ([xscale=-1] 3001) ;

      \coordinate (2101) at (0,-5) ;
      \coordinate (1201) at (0,-19) ;

      \coordinate (2020) at (-11.5 + 0.5,12) ;
      \coordinate (2011) at (-16,1) ;
      \coordinate (1120) at (-7.3,-1.6) ;
      \coordinate (1111) at (-12,-11 - 1) ;

      \coordinate (2110) at ([xscale=-1] 2020) ;
      \coordinate (2200) at ([xscale=-1] 2011) ;
      \coordinate (1210) at ([xscale=-1] 1120) ;
      \coordinate (1300) at ([xscale=-1] 1111) ;

    \endscope

    \foreach \XXX/\YYY in {%
      3010/4000,
      3001/4000, 3100/4000,
      2011/3001, 2200/3100,
      2101/3001, 2101/3100,
      1201/2101}
    \ARROWX[dashed,gray]{\XXX}{\YYY} ;

    \foreach \XXX/\YYY in {%
      1120/2020, 1210/2110,
      1120/1210,
      1111/1120, 1210/1300,
      2020/3010, 2110/3010,
      2011/2020, 2110/2200,
      1111/2011, 1300/2200,
      1111/1201, 1201/1300}
    \ARROW{\XXX}{\YYY} ;

    \foreach \XXX in {%
      4000, 3001, 3100, 2101}
    \BULLETX[gray]{\XXX} ;

    \foreach \XXX in {%
      1120, 1210,
      3010,
      2020, 2011, 1111,
      2110, 2200, 1300,
      1201}
    \BULLET{\XXX} ;

    \node[anchor=south] at (3010) {3010} ;
    \node[anchor=west,yshift=0.5pt] at (4000) {4000} ;

    \node[anchor=west,xshift=2pt] (3001L) at (3001) {3001} ;
    \node at ([xscale=-1] 3001L) {3100} ;

    \node[anchor=south east,xshift=4pt] (2020L) at (2020) {2020} ;
    \node at ([xscale=-1] 2020L) {2110} ;
    \node[anchor=north east,xshift=4pt] (1111L) at (1111) {1111} ;
    \node at ([xscale=-1] 1111L) {1300} ;

    \node[anchor=east] (2011L) at (2011) {2011} ;
    \node[inner xsep=0] at ([xscale=-1] 2011L) {2200} ;

    \node[anchor=north west,xshift=-4pt] at (1120) {1120} ;
    \node[anchor=west] at (1210) {1210} ;

    \node[anchor=north west,yshift=4pt] at (2101) {2101} ;
    \node[anchor=north] at (1201) {1201} ;

    \showTMCaptionL{1201}{4}

  \endtikzpicture
}

\leavevmode

???1- ab

??11- a(bc)

??20- (ab)c

?111- a(b(cd))

?120- a((bc)d)

?201- (ab)(cd)

?210- (a(bc))d

?300- ((ab)c)d

1111-a(b(c(de)))

1120-a(b((cd)e))

1201-a((bc)(de))

2011-(ab)(c(de))

2020-(ab)((cd)e)

.?.?.?.?.?.?.?.

\vskip11\bs

\hskip36.5\tten
\hskip-1pt
Fig.?1

\bye
