6

How to write the Peirce notation for logical connective? enter image description here

I have seen these symbols in this article

G al Cubo
  • 161
  • Are you aware of this post? –  Jan 25 '18 at 19:08
  • I already tried, but there are only two or three results. Not the complete list. – G al Cubo Jan 25 '18 at 19:12
  • 2
    i think that not all of these are in any font that i know of. i'm pretty sure they didn't all make it into unicode. can you provide a reference to a published source where they are defined and used? with that information, i can submit the request to unicode to add whatever is missing. – barbara beeton Jan 25 '18 at 19:15
  • @barbarabeeton ^^ Edited question. By the way, if somebody needs a new symbol, how do they get it? Short of drawing, isn't there a chicken-and-egg problem here? Not in unicode -> not in fonts -> can't typeset it -> can't use it. Can't use it -> not a candidate for unicode. Hence, we have to make do with only the symbols invented prior to unicode? – cfr Jan 27 '18 at 03:52
  • @barbarabeeton [Not a serious question, obviously.] – cfr Jan 27 '18 at 03:58
  • @cfr -- actually, this is a reasonable question. i'll dig to see if it has been asked, and if not, will ask you to post it. – barbara beeton Jan 27 '18 at 12:23

3 Answers3

10

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}
David Carlisle
  • 757,742
  • Thanks! I knew there was a simpler approach than using tikz but it just was the first thing that came to my mind … – Jasper Habicht Jan 25 '18 at 19:53
  • Yes. It is very good construction (and it is very beautiful). But for now I prefer the construction with Tikz because in fact I am working some diagrams with Tikz. – G al Cubo Jan 25 '18 at 20:08
  • 4
    @JasperHabicht when tikz is the first thing that comes to your mind, you should start to worry about your state of mind:-) – David Carlisle Jan 25 '18 at 20:49
  • 2
    @GalCubo And when picture mode is the first thing that comes to your mind, you should start to worry that your mind may be David Carlisle's. – cfr Jan 27 '18 at 03:47
9

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

egreg
  • 1,121,712
8

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