%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% graph-separation.sty version 2.0
%
% Copyright 2024 by Qingyuan Zhao (qyzhao@statslab.cam.ac.uk)
%
% These macros may be freely used, transmitted, reproduced, or modified
% provided that the copyright notice and this permission is retained.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{graph-separation}[2024/07/22 \space v 2.0]

\RequirePackage{tikz}
\usetikzlibrary{arrows,shapes.arrows,shapes.geometric,shapes.multipart,decorations.pathmorphing,positioning,arrows.meta}

\RequirePackage{adjustbox}

\newcommand\nosquigno{%
  \mathrel{\adjustbox{valign=c}{\begin{tikzpicture}
        \draw[decorate,line width=0.5pt,
        decoration={zigzag,amplitude=0.8pt,segment
          length=1.3mm,pre=lineto,pre length=0.6mm,post=lineto,post
          length=0.5mm},
        -]
        (0,0) -- (0.515, 0);
      \end{tikzpicture}}}%
}

\newcommand\nosquigfull{%
  \mathrel{\adjustbox{valign=c}{\begin{tikzpicture}
        \draw[decorate,line width=0.5pt,
        decoration={zigzag,amplitude=0.8pt,segment
          length=1.3mm,pre=lineto,pre length=0.6mm,post=lineto,post
          length=0.5mm},
        -{Classical TikZ Rightarrow[length=1mm]}]
        (0,0) -- (0.515, 0);
      \end{tikzpicture}}}%
}

\newcommand\fullsquigno{%
  \mathrel{\adjustbox{valign=c}{\begin{tikzpicture}
        \draw[decorate,line width=0.5pt,
        decoration={zigzag,amplitude=0.8pt,segment
          length=1.3mm,pre=lineto,pre length=0.6mm,post=lineto,post
          length=0.5mm},
        {Classical TikZ Rightarrow[length=1mm]}-]
        (0,0) -- (0.515, 0);
      \end{tikzpicture}}}%
}

\newcommand\halfsquighalf{%
  \mathrel{\adjustbox{valign=c}{\begin{tikzpicture}
        \draw[decorate,line width=0.5pt,
        decoration={zigzag,amplitude=0.8pt,segment
          length=1.3mm,pre=lineto,pre length=0.6mm,post=lineto,post
          length=0.5mm},
        {Classical TikZ Rightarrow[right,length=1mm]}-{Classical TikZ Rightarrow[right,length=1mm]}]
        (0,0) -- (0.515, 0);
      \end{tikzpicture}}}%
}


\newcommand\halfsquigfull{%
  \mathrel{\adjustbox{valign=c}{\begin{tikzpicture}
        \draw[decorate,line width=0.5pt,
        decoration={zigzag,amplitude=0.8pt,segment
          length=1.3mm,pre=lineto,pre length=0.6mm,post=lineto,post
          length=0.5mm},
        {Classical TikZ Rightarrow[right,length=1mm]}-{Classical TikZ Rightarrow[length=1mm]}]
        (0,0) -- (0.515, 0);
      \end{tikzpicture}}}%
}

\newcommand\fullsquighalf{%
  \mathrel{\adjustbox{valign=c}{\begin{tikzpicture}
        \draw[decorate,line width=0.5pt,
        decoration={zigzag,amplitude=0.8pt,segment
          length=1.3mm,pre=lineto,pre length=0.6mm,post=lineto,post
          length=0.5mm},
        {Classical TikZ Rightarrow[length=1mm]}-{Classical TikZ Rightarrow[right,length=1mm]}]
        (0,0) -- (0.515, 0);
      \end{tikzpicture}}}%
}

\newcommand\fullsquigfull{%
  \mathrel{\adjustbox{valign=c}{\begin{tikzpicture}
        \draw[decorate,line width=0.5pt,
        decoration={zigzag,amplitude=0.8pt,segment
          length=1.3mm,pre=lineto,pre length=0.6mm,post=lineto,post
          length=0.5mm},
        {Classical TikZ Rightarrow[length=1mm]}-{Classical TikZ Rightarrow[length=1mm]}]
        (0,0) -- (0.515, 0);
      \end{tikzpicture}}}%
}

\newcommand\nostraigno{%
  \mathrel{\adjustbox{valign=c}{\begin{tikzpicture}
        \draw[decorate,line width=0.5pt,
        -]
        (0,0) -- (0.515, 0);
      \end{tikzpicture}}}%
}

\newcommand\nostraigfull{%
  \mathrel{\adjustbox{valign=c}{\begin{tikzpicture}
        \draw[decorate,line width=0.5pt,
        -{Classical TikZ Rightarrow[length=1mm]}]
        (0,0) -- (0.515, 0);
      \end{tikzpicture}}}%
}

\newcommand\fullstraigno{%
  \mathrel{\adjustbox{valign=c}{\begin{tikzpicture}
        \draw[decorate,line width=0.5pt,
        {Classical TikZ Rightarrow[length=1mm]}-]
        (0,0) -- (0.515, 0);
      \end{tikzpicture}}}%
}


\newcommand\halfstraighalf{%
  \mathrel{\adjustbox{valign=c}{\begin{tikzpicture}
        \draw[decorate,line width=0.5pt,
        {Classical TikZ Rightarrow[right,length=1mm]}-{Classical TikZ Rightarrow[right,length=1mm]}]
        (0,0) -- (0.515, 0);
      \end{tikzpicture}}}%
}

\newcommand\halfstraigfull{%
  \mathrel{\adjustbox{valign=c}{\begin{tikzpicture}
        \draw[decorate,line width=0.5pt,
        {Classical TikZ Rightarrow[right,length=1mm]}-{Classical TikZ Rightarrow[length=1mm]}]
        (0,0) -- (0.515, 0);
      \end{tikzpicture}}}%
}

\newcommand\fullstraighalf{%
  \mathrel{\adjustbox{valign=c}{\begin{tikzpicture}
        \draw[decorate,line width=0.5pt,
        {Classical TikZ Rightarrow[length=1mm]}-{Classical TikZ Rightarrow[right,length=1mm]}]
        (0,0) -- (0.515, 0);
      \end{tikzpicture}}}%
}

\newcommand\fullstraigfull{%
  \mathrel{\adjustbox{valign=c}{\begin{tikzpicture}
        \draw[decorate,line width=0.5pt,
        {Classical TikZ Rightarrow[length=1mm]}-{Classical TikZ Rightarrow[length=1mm]}]
        (0,0) -- (0.515, 0);
      \end{tikzpicture}}}%
}

%% Graphs

\RequirePackage{centernot}
\RequirePackage{amsmath}

\newcommand{\rdedge}{\mathrel{\nostraigfull}}
\newcommand{\nordedge}{\mathrel{\centernot{\nostraigfull}}}
\newcommand{\ldedge}{\mathrel{\fullstraigno}}
\newcommand{\noldedge}{\mathrel{\centernot{\fullstraigno}}}
\newcommand{\bdedge}{\mathrel{\fullstraigfull}}
\newcommand{\nobdedge}{\mathrel{\centernot{\fullstraigfull}}}

\newcommand{\rdpath}{\mathrel{\nosquigfull}}
\newcommand{\nordpath}{\mathrel{\centernot{\nosquigfull}}}
\newcommand{\ldpath}{\mathrel{\fullsquigno}}
\newcommand{\noldpath}{\mathrel{\centernot{\fullsquigno}}}

\newcommand{\dconnarc}{\mathrel{\overset{\textnormal{d}}{\halfsquighalf}}}
\newcommand{\nodconnarc}{\mathrel{\centernot \dconnarc}}
\newcommand{\mconnarc}{\mathrel{\halfsquighalf}}
\newcommand{\nomconnarc}{\mathrel{\centernot \mconnarc}}
\newcommand{\trek}{\mathrel{\overset{\textnormal{t}}{\fullsquigfull}}}
\newcommand{\tconnarc}{\trek}
\newcommand{\notrek}{\mathrel{\centernot \trek}}
\newcommand{\notconnarc}{\notrek}

\newcommand{\confarc}{\mathrel{\fullsquigfull}}
\newcommand{\noconfarc}{\mathrel{\centernot{\fullsquigfull}}}

\newcommand{\samedist}{\mathrel{\fullstraigfull \ast
  \fullstraigfull}}

\newcommand{\colliderconn}{\mathrel{\halfstraigfull \ast
    \fullstraighalf}}

\newcommand{\markovblanket}{\mathrel{\halfstraigfull \ast
  \fullstraigfull}}

\newcommand{\tconn}{\mathrel{\overset{\textnormal{t}}{\fullsquigfull}
    \ast \overset{\textnormal{t}}{\fullsquigfull}}}

\newcommand{\mconn}{\mathrel{\halfsquigfull \ast \fullsquighalf}}

\newcommand{\dconn}{\mathrel{\overset{\textnormal{d}}{\halfsquigfull}
    \ast \overset{\textnormal{d}}{\fullsquighalf}}}

\newcommand{\confpath}{\mathrel{\fullsquigfull \ast
    \fullsquigfull}}

\newcommand{\udedge}{\mathrel{\nostraigno}}
\newcommand{\noudedge}{\mathrel{\centernot{\nostraigno}}}
\newcommand{\uconn}{\mathrel{\udedge\ast\udedge}}

\newcommand{\deltaconn}{\mathrel{\overset{\textnormal{d}}{\halfsquigfull}
    \ast \overset{\textnormal{d}}{\fullsquigfull}}}
\newcommand{\muconn}{\mathrel{\halfsquigfull \ast \fullsquigfull}}