0

This is a typical table from Elliott Mendelson's Introduction to Mathematical Logic.

enter image description here

This is part of a method for determining if a statement form is a tautology. I would like to be able to reproduce it in an efficient way.

1
  • Not sure if there's a faster way than the "obvious" solution of using a array environment and careful manipulation of spacing (needs some knowledge of TeX spacing rules etc. I think) to make the first line correct.
    – user202729
    Aug 15, 2022 at 15:56

1 Answer 1

4

You can do it quick, or you can do it well. It's pretty hard to do it both. You'll notice even the one you posted, which I gather is taken right from Mendelson's published book, is screwed up. The T in line 2 should be under the biconditional, not under the A.

The best approach I can think of is to use an array (or tabular). The hard thing is to make the formula at the top have something like its usual mathematical spacing. If you break each statement and connective into its own cell, the usual LaTeX math spacing rules will get ignored. So what you basically have to do is use @{…} in the column specifier between every column, and put in spaces @{\ } before and after the binary connectives, and remove all inter-column space @{} elsewhere.

The resulting code is a little ugly:

\documentclass{article}
\usepackage{array}
\usepackage{amssymb}
\usepackage{mathpazo}% optional: a font more like Mendelson's
\newcommand{\F}{\mathrm{F}}
\newcommand{\T}{\mathrm{T}}
\begin{document}

\newcounter{tableline}
\setcounter{tableline}{0}
\newcommand{\advline}{\refstepcounter{tableline}\thetableline}
\[
\begin{array}%
{@{}r@{}c@{\ }c@{\ }          r@{}r@{}  c@{}l@{\ }c@{\ }c@{}l@{\ }c@{\ }      r@{}r@{}  c@{}l@{\ }c@{\ }      c@{}l@{\ }c@{}}
    ((  &A    &\Leftrightarrow&(( &\lnot&B  &)    &\lor &C  &))   &\Rightarrow&(( &\lnot&A  &)    &\Rightarrow&B  &))   & \\
        &     &               &   &     &   &     &     &   &     &\F         &   &     &   &     &           &   &     & \advline\\
        &     &\T             &   &     &   &     &     &   &     &           &   &     &   &     &\F         &   &     & \advline\\
        &     &               &   &     &   &     &     &   &     &           &   &\T   &   &     &           &\F &     & \advline\\
        &\F   &               &   &     &   &     &     &   &     &           &   &     &\F &     &           &   &     & \advline\\
        &     &               &   &     &   &     &\F   &   &     &           &   &     &   &     &           &   &     & \advline\\
        &     &               &   &\F   &   &     &     &\F &     &           &   &     &   &     &           &   &     & \advline\\
        &     &               &   &     &\T &     &     &   &     &           &   &     &   &     &           &   &     & \advline\\
\end{array}
\]
\end{document}

I put in spaces in the column specifier so you can see which column specification goes with which column. (I made the columns for left parentheses right-aligned and those for right parentheses left-aligned to stick with what they apply to, but I doubt that matters.)

The output looks like this:

abbreviated truth table

You could probably use lua to write a script that automatically parsed the statement and put in the right kind of spacing (and while you're at, fill in the rest of the table, as computers are pretty good at truth functional logic …) But that's more work than I'm willing to do for a StackExchange answer.

1
  • There are already scripts which can generate truth tables. Not sure about Lua. I used a python one. But I don't think there is a 'rest of the table' to be filled in by anybody. This is a not-counterexample, I think. That is, it is a reductio. Hence the numbering.
    – cfr
    Nov 12 at 4:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .