
\documentclass[tikz,border=10pt]{standalone}


\RequirePackage{luatex85}
\usepackage[utf8]{inputenc}
\usepackage{amsmath, amssymb, amsfonts, accents}
\usetikzlibrary{graphdrawing, graphs, arrows, shapes, automata, calc}
\usepackage{stix}

% workaround for https://github.com/u-fischer/luaotfload/issues/6
\usepackage{luacode}
\begin{luacode}
  function pgf_lookup_and_require(name)
    local sep = '/'
    if string.find(os.getenv('PATH'),';') then
      sep = '\string\\'
    end
    local function lookup(name)
      local sub = name:gsub('%.',sep)
      local find_func = function (name, suffix)
        if resolvers then
          local n = resolvers.findfile (name.."."..suffix, suffix) -- changed
          return (not (n == '')) and n or nil
        else
          return kpse.find_file(name,suffix)
        end
      end
      if find_func(sub, 'lua') then
        require(name)
      elseif find_func(sub, 'clua') then
        collectgarbage('stop')
        require(name)
        collectgarbage('restart')
      else
        return false
      end
      return true
    end
    return
      lookup('pgf.gd.' .. name .. '.library') or
      lookup('pgf.gd.' .. name) or
      lookup(name .. '.library') or
      lookup(name)
  end
\end{luacode}
\usegdlibrary{trees, layered}


\newcommand{\Xund}{\rule{.4em}{.4pt}}
\newcommand{\IRE}{I\!RE}
\newcommand{\Eps}{E\!ps}
\newcommand{\Sym}{S\!ym}
\newcommand{\Alt}{Alt}
\newcommand{\Cat}{C\!at}
\newcommand{\Rep}{Rep}
\newcommand{\Xop}{X\!op}
\newcommand{\fix}{f\!ix}


\begin{document}

\begin{tikzpicture}[>=stealth, ->, auto, node distance=0.2in]

\tikzstyle{every node}=[draw=none, shape=rectangle, outer sep = 0in];

\small{

\begin{scope}[xshift=-0in, yshift=0in]
    \node (a) {{
    $\begin{aligned}
        & mark (1,\; (((\epsilon|a^{0,\infty}))(a|\epsilon)^{0,3} )) = [ \\[-0.3em]
        & \quad mark (2,\; ((\epsilon|a^{0,\infty}))(a|\epsilon)^{0,\infty} ) = [ \\[-0.3em]
        %
        & \quad\quad mark (2,\; ((\epsilon|a^{0,\infty})) ) = [ \\[-0.3em]
        & \quad\quad\quad mark (3,\; (\epsilon|a^{0,\infty}) ) = [ \\[-0.3em]
        & \quad\quad\quad\quad mark (4,\; \epsilon|a^{0,\infty} ) = [ \\[-0.3em]
        & \quad\quad\quad\quad\quad mark (4,\; \epsilon ) = (4,\; \Eps(0,\emptyset)) \\[-0.3em]
        & \quad\quad\quad\quad\quad mark (4,\; a^{0,\infty} ) = [ \\[-0.3em]
        & \quad\quad\quad\quad\quad\quad mark (4,\; a ) = (4,\; \Sym(0,\emptyset,a)) \\[-0.3em]
        & \quad\quad\quad\quad\quad ] = (4,\; \Rep(0,\emptyset,\Sym(0,\emptyset,a),0,\infty)) \\[-0.3em]
        & \quad\quad\quad\quad ] = (4,\; \Alt(0,\emptyset,\Eps(0,\emptyset),\Rep(0,\emptyset,\Sym(0,\emptyset,a),0,\infty))) \\[-0.3em]
        & \quad\quad\quad ] = (4,\; \Alt(1,\{3\},\Eps(0,\emptyset),\Rep(0,\emptyset,\Sym(0,\emptyset,a),0,\infty))) \\[-0.3em]
        & \quad\quad ] = (4,\; \Alt(1,\{2,3\},\Eps(0,\emptyset),\Rep(0,\emptyset,\Sym(0,\emptyset,a),0,\infty))) \\[-0.3em]
        %
        & \quad\quad mark (4,\; (a|\epsilon)^{0,3} ) = [ \\[-0.3em]
        & \quad\quad\quad mark (4,\; (a|\epsilon) ) = [ \\[-0.3em]
        & \quad\quad\quad\quad mark (5,\; a|\epsilon ) =  [ \\[-0.3em]
        & \quad\quad\quad\quad\quad mark (5,\; a ) = (5,\; \Sym(0,\emptyset,a)) \\[-0.3em]
        & \quad\quad\quad\quad\quad mark (5,\; \epsilon ) = (5,\; \Eps(0,\emptyset)) \\[-0.3em]
        & \quad\quad\quad\quad ] = (5,\; \Alt(0,\emptyset,\Sym(0,\emptyset,\Eps(0,\emptyset),a))) \\[-0.3em]
        & \quad\quad\quad ] = (5,\; \Alt(1,\{4\},\Sym(0,\emptyset,a),\Eps(0,\emptyset))) \\[-0.3em]
        & \quad\quad ] = (5,\; \Rep(1,\emptyset,\Alt(1,\{4\},\Sym(0,\emptyset,a),\Eps(0,\emptyset)),0,3)) \\[-0.3em]
        %
        & \quad] = (5,\; \Cat(1,\emptyset,
           \Alt(1,\{2,3\},\Eps(0,\emptyset),\Rep(0,\emptyset,\Sym(0,\emptyset,a),0,\infty)), \\[-0.3em]
           & \hspace{7.5em} \Rep(1,\emptyset,\Alt(1,\{4\},\Sym(0,\emptyset,a),\Eps(0,\emptyset)),0,3)
           )) \\[-0.3em]
        & ] = (5,\; \Cat(1,\{1\},
           \Alt(1,\{2,3\},\Eps(0,\emptyset),\Rep(0,\emptyset,\Sym(0,\emptyset,a),0,\infty)), \\[-0.3em]
           & \hspace{7.5em} \Rep(1,\emptyset,\Alt(1,\{4\},\Sym(0,\emptyset,a),\Eps(0,\emptyset)),0,3)
           ))
    \end{aligned}$
    }};
\end{scope}

\begin{scope}[xshift=0in, yshift=-3.4in]
    \node (a) {{
    $\begin{aligned}
        & enum (1,\; \Cat(1,\{1\},
           \Alt(1,\{2,3\},\Eps(0,\emptyset),\Rep(0,\emptyset,\Sym(0,\emptyset,a),0,\infty)), \\[-0.3em]
           & \hspace{8em} \Rep(1,\emptyset,\Alt(1,\{4\},\Sym(0,\emptyset,a),\Eps(0,\emptyset)),0,3)
           )) = [ \\[-0.3em]
        & \quad enum (2,\; \Alt(1,\{2,3\},\Eps(0,\emptyset),\Rep(0,\emptyset,\Sym(0,\emptyset,a),0,\infty))) = [ \\[-0.3em]
        & \quad\quad enum (3,\; \Eps(0,\emptyset)) = (3,\; \Eps(0,\emptyset)) \\[-0.3em]
        & \quad\quad enum (3,\; \Rep(0,\emptyset,\Sym(0,\emptyset,a),0,\infty)) = [ \\[-0.3em]
        & \quad\quad\quad enum (3,\; \Sym(0,\emptyset,a)) = (3,\; \Sym(0,\emptyset,a)) \\[-0.3em]
        & \quad\quad ] = (3,\; \Rep(0,\emptyset,\Sym(0,\emptyset,a),0,\infty)) \\[-0.3em]
        & \quad ] = (3,\; \Alt(2,\{2,3\},\Eps(0,\emptyset),\Rep(0,\emptyset,\Sym(0,\emptyset,a),0,\infty))) \\[-0.3em]
        %
        & \quad enum (3,\; \Rep(1,\emptyset,\Alt(1,\{4\},\Sym(0,\emptyset,a),\Eps(0,\emptyset)),0,3)) = [ \\[-0.3em]
        & \quad\quad enum (4,\; \Alt(1,\{4\},\Sym(0,\emptyset,a),\Eps(0,\emptyset))) = [ \\[-0.3em]
        & \quad\quad\quad enum (5,\; \Sym(0,\emptyset,a)) = (5,\; \Sym(0,\emptyset,a)) \\[-0.3em]
        & \quad\quad\quad enum (5,\; \Eps(0,\emptyset)) = (5,\; \Eps(0,\emptyset)) \\[-0.3em]
        & \quad\quad ] = (5,\; \Alt(4,\{4\},\Sym(0,\emptyset,a),\Eps(0,\emptyset))) \\[-0.3em]
        & \quad ] = (5,\; \Rep(3,\emptyset,\Alt(1,\{4\},\Sym(0,\emptyset,a),\Eps(0,\emptyset)),0,3)) \\[-0.3em]
        %
        & ] = (5,\; \Cat(1,\{1\},
            \Alt(2,\{2,3\},\Eps(0,\emptyset),\Rep(0,\emptyset,\Sym(0,\emptyset,a),0,\infty)), \\[-0.3em]
            & \hspace{7.5em} \Rep(3,\emptyset,\Alt(1,\{4\},\Sym(0,\emptyset,a),\Eps(0,\emptyset)),0,3)
            ))
    \end{aligned}$
    }};
\end{scope}

%\begin{scope}[xshift=0in, yshift=-5.1in]
%    \node (c) {{
%    $\begin{aligned}
%        & \IRE\big( (((\epsilon|a^{0,\infty}))(a|\epsilon)^{0,3}) \big) = \\[-0.3em]
%        & \hspace{3em} \Cat(1,\{1\},
%            \Alt(2,\{2,3\},\Eps(0,\emptyset),\Rep(0,\emptyset,\Sym(0,\emptyset,a),0,\infty)), \\[-0.3em]
%            & \hspace{7.5em} \Rep(3,\emptyset,\Alt(1,\{4\},\Eps(0,\emptyset),\Sym(0,\emptyset,a)),0,3)
%            )
%    \end{aligned}$
%    }};
%\end{scope}

\begin{scope}[xshift=3in, yshift=1.8in]
    \graph [tree layout, grow=down, fresh nodes, level distance=0.35in] {
        "${\Cat(1, \{1\}, *, *)}_{\Lambda}$" -- {
            "${\Alt(2, \{2,3\}, *, *)}_{1}$" -- {
                "${\Eps(0, \emptyset)}_{1.1}$",
                "${\Rep(0, \emptyset, *, 0, \infty)}_{1.2}$" -- {
                    "${\Sym(0, \emptyset, a)}_{1.2.1}$"
                }
            },
            "${\Rep(3, \emptyset, *, 0, 3)}_{2}$" -- {
                "${\Alt(4, \{4\}, *, *)}_{2.1}$" -- {
                    "${\Sym(0, \emptyset, a)}_{2.1.1}$",
                    "${\Eps(0, \emptyset)}_{2.1.2}$"
                }
            }
        }
    };
\end{scope}

\newcommand\xsp[1]{\hphantom{\hspace{#1em}\hspace{0.2em}}}

\begin{scope}[xshift=3in, yshift=0.2in, sibling distance=0.5in, level distance=0.35in]
    \graph [tree layout, grow=down, fresh nodes] {
        a1/"${T}^{1}_{\Lambda}$" -- {
            a11/"${T}^{2}_{1}$" -- {
                a111/"${\bot}^{0}_{1.1}$",
                a112/"${T}^{0}_{1.2}$" -- {
                    a1121/"${a}^{0}_{1.2.1}$"
                }
            },
            a12/"${T}^{3}_{2}$" -- {
                a121/"${\bot}^{4}_{2.1}$"
            }
        }
    };
    \node at (a1)    {\xsp{2.5}\footnotesize{$(1)$}};
    \node at (a11)   {\xsp{2.5}\footnotesize{$(1)$}};
    \node at (a111)  {\xsp{3.5}\footnotesize{$(\infty)$}};
    \node at (a112)  {\xsp{3.5}\footnotesize{$(\infty)$}};
    \node at (a1121) {\xsp{4.0}\footnotesize{$(\infty)$}};
    \node at (a12)   {\xsp{2.5}\footnotesize{$(0)$}};
    \node at (a121)  {\xsp{3.0}\footnotesize{$(-1)$}};

    \node[xshift=0in, yshift=-1.35in, draw=none]
    {$s \;=\; {T}^{1} (
        {T}^{2} (
            {\bot}^{0},
            {T}^{0}({a}^{0})
        ),
        {T}^{3}(
            {\bot}^{4}
        )
    )$};
\end{scope}

\begin{scope}[xshift=3in, yshift=-1.5in, sibling distance=0.5in, level distance=0.35in]
    \graph [tree layout, grow=down, fresh nodes] {
        a1/"${T}^{1}_{\Lambda}$" -- {
            a11/"${T}^{2}_{1}$" -- {
                a111/"${\epsilon}^{0}_{1.1}$",
                a112/"${\bot}^{0}_{1.2}$"
            },
            a12/"${T}^{3}_{2}$" -- {
                a121/"${T}^{4}_{2.1}$" -- {
                    a1211/"${a}^{0}_{2.1.1}$",
                    a1212/"${\bot}^{0}_{2.1.2}$"
                },
                a122/"${T}^{4}_{2.2}$" -- {
                    a1221/"${\bot}^{0}_{2.2.1}$",
                    a1222/"${\epsilon}^{0}_{2.2.2}$"
                }
            }
        }
    };
    \node at (a1)    {\xsp{2.5}\footnotesize{$(1)$}};
    \node at (a11)   {\xsp{2.5}\footnotesize{$(0)$}};
    \node at (a111)  {\xsp{3.5}\footnotesize{$(\infty)$}};
    \node at (a112)  {\xsp{3.5}\footnotesize{$(\infty)$}};
    \node at (a12)   {\xsp{2.5}\footnotesize{$(1)$}};
    \node at (a121)  {\xsp{3.0}\footnotesize{$(1)$}};
    \node at (a1211) {\xsp{3.5}\footnotesize{$(\infty)$}};
    \node at (a1212) {\xsp{3.5}\footnotesize{$(\infty)$}};
    \node at (a122)  {\xsp{3.0}\footnotesize{$(0)$}};
    \node at (a1221) {\xsp{3.5}\footnotesize{$(\infty)$}};
    \node at (a1222) {\xsp{3.5}\footnotesize{$(\infty)$}};

    \node[xshift=0.2in, yshift=-1.35in, draw=none]
    {$r \;=\; {T}^{1}(
        {T}^{2}(
            {\epsilon}^{0},
            {\bot}^{0}
        ),
        {T}^{3}(
            {T}^{4}({a}^{0},{\bot}^{0}),
            {T}^{4}({\bot}^{0}, {\epsilon}^{0})
        )
    )$};
\end{scope}

\begin{scope}[xshift=3in, yshift=-3.2in, sibling distance=0.5in, level distance=0.35in]
    \graph [tree layout, grow=down, fresh nodes] {
        a1/"${T}^{1}_{\Lambda}$" -- {
            a11/"${T}^{2}_{1}$" -- {
                a111/"${\bot}^{0}_{1.1}$",
                a112/"${T}^{0}_{1.2}$" -- {
                    a1121/"${\bot}^{0}_{1.2.1}$"
                }
            },
            a12/"${T}^{3}_{2}$" -- {
                a121/"${T}^{4}_{2.1}$" -- {
                    a1211/"${a}^{0}_{2.1.1}$",
                    a1212/"${\bot}^{0}_{2.1.2}$"
                }
            }
        }
    };
    \node at (a1)    {\xsp{2.5}\footnotesize{$(1)$}};
    \node at (a11)   {\xsp{2.5}\footnotesize{$(0)$}};
    \node at (a111)  {\xsp{3.5}\footnotesize{$(\infty)$}};
    \node at (a112)  {\xsp{3.5}\footnotesize{$(\infty)$}};
    \node at (a1121) {\xsp{4.0}\footnotesize{$(\infty)$}};
    \node at (a12)   {\xsp{2.5}\footnotesize{$(1)$}};
    \node at (a121)  {\xsp{3.0}\footnotesize{$(1)$}};
    \node at (a1211) {\xsp{3.5}\footnotesize{$(\infty)$}};
    \node at (a1212) {\xsp{3.5}\footnotesize{$(\infty)$}};

    \node[xshift=0.2in, yshift=-1.35in, draw=none]
    {$t \;=\; {T}^{1}(
        {T}^{2}(
            {\bot}^{0},
            {T}^{0}({\bot}^{0})
        ),
        {T}^{3}(
            {T}^{4}({a}^{0},{\bot}^{0})
        )
    )$};
\end{scope}
}

\end{tikzpicture}

\end{document}

