Peirce's notation for logical connectives

enter image description here

picture mode to the rescue:

\documentclass{article}

\newcommand\zz[6]{%
\begin{picture}(10,10)
\ifnum#1=1 \put(0,0){\line(1,0){10}}\fi
\ifnum#2=1 \put(10,0){\line(0,1){10}}\fi
\ifnum#3=1 \put(0,10){\line(1,0){10}}\fi
\ifnum#4=1 \put(0,0){\line(0,1){10}}\fi
\ifnum#5=1 \put(0,0){\line(1,1){10}}\fi
\ifnum#6=1 \put(0,10){\line(1,-1){10}}\fi
\end{picture}}

\begin{document}


\zz111111 + \zz010101 + \zz000011 + \zz111110

\end{document}

A variation on the picture theme. This provides symbols that adapt to the current font size. Smaller symbols are needed, for instance, in table 5 of the article.

\documentclass{article}
\usepackage{amsmath}
\usepackage{pict2e}

\makeatletter
\DeclareRobustCommand{\peirceconn}[1]{%
  % #1 = four bit binary number: top, left, right, bottom
  % 0 = false, 1 = true
  \mathrel{\mathpalette\peirce@conn{#1}}%
}
\newcommand{\peirce@conn}[2]{%
  \peirce@@conn#1#2....\@nil
}
\def\peirce@@conn#1#2#3#4#5#6\@nil{
  \settoheight{\unitlength}{$#1F$}
  \begin{picture}(1.2,1)
  \roundcap
  \peirce@linethickness{#1}
  \ifnum#2=0 % top is false
    \Line(0.1,1)(1.1,1)
  \fi
  \ifnum#3=0 % left is false
    \Line(0.1,0)(0.1,1)
  \fi
  \ifnum#4=0 % right is false
    \Line(1.1,0)(1.1,1)
  \fi
  \ifnum#5=0 % bottom is false
    \Line(0.1,0)(1.1,0)
  \fi
  \Line(0.1,0)(1.1,1)
  \Line(0.1,1)(1.1,0)
  \end{picture}
}
\newcommand{\peirce@linethickness}[1]{%
  \linethickness{%
    \fontdimen8
      \ifx#1\displaystyle\textfont\else
      \ifx#1\textstyle\textfont\else
      \ifx#1\scriptstyle\scriptfont\else
      \scriptscriptfont\fi\fi\fi 3
  }%
}
\makeatother

\begin{document}

$\peirceconn{0000}$
$\peirceconn{0001}$
$\peirceconn{0010}$
$\peirceconn{0100}$
$\peirceconn{1000}$
$\peirceconn{1100}$
$\peirceconn{1010}$
$\peirceconn{1001}$
$\peirceconn{0110}$
$\peirceconn{0101}$
$\peirceconn{0011}$
$\peirceconn{0111}$
$\peirceconn{1011}$
$\peirceconn{1101}$
$\peirceconn{1110}$
$\peirceconn{1111}$

$x\peirceconn{1111}y\frac{x\peirceconn{1110}y}{x\peirceconn{0001}y}$

\footnotesize

$x\peirceconn{0101}y$

\Large

$x\peirceconn{1010}y$

\end{document}

enter image description here

Compare with the original table

enter image description here


Maybe using tikz and writing a short macro:

\documentclass{article}
\usepackage{tikz}

\newcommand{\piercebox}[1]{%
 \def\parr{{#1}}%
 \tikz[line cap=round,scale=.25]{
  \pgfmathparse{\parr[0]}
  \draw[black!0] (0,0) -- (0,1) -- (1,1) -- (1,0);
  \ifnum\pgfmathresult=1
   \draw (0,0) -- (0,1);
  \fi
  \pgfmathparse{\parr[1]}
  \ifnum\pgfmathresult=1
   \draw (1,0) -- (1,1);
  \fi
  \pgfmathparse{\parr[2]}
  \ifnum\pgfmathresult=1  
   \draw (0,1) -- (1,1);
  \fi
  \pgfmathparse{\parr[3]}
  \ifnum\pgfmathresult=1
   \draw (0,0) -- (1,0);
  \fi
  \pgfmathparse{\parr[4]}
  \ifnum\pgfmathresult=1
   \draw (0,0) -- (1,1);
  \fi
  \pgfmathparse{\parr[5]}
  \ifnum\pgfmathresult=1
   \draw (1,0) -- (0,1);
  \fi
 }%
}

\begin{document}

\piercebox{1,0,0,0,0,0}
\piercebox{0,1,0,0,0,0}
\piercebox{0,0,1,0,0,0}
\piercebox{0,0,0,1,0,0}
\piercebox{0,0,0,0,1,0}
\piercebox{0,0,0,0,0,1}

\bigskip

\piercebox{1,1,1,1,1,1}

\piercebox{1,1,1,0,1,1}
\piercebox{1,0,1,1,1,1}
\piercebox{0,1,1,1,1,1}
\piercebox{1,1,0,1,1,1}

\piercebox{0,1,0,1,1,1}
\piercebox{1,0,0,1,1,1}
\piercebox{1,1,0,0,1,1}
\piercebox{0,0,1,1,1,1}
\piercebox{0,1,1,0,1,1}
\piercebox{1,0,1,0,1,1}

\piercebox{0,0,1,0,1,1}
\piercebox{1,0,0,0,1,1}
\piercebox{0,1,0,0,1,1}
\piercebox{0,0,0,1,1,1}

\piercebox{0,0,0,0,1,1}

\end{document}

Which yields:

enter image description here