mathlogic.lv Mathematics, Logic, Algorithms

Truth Table Method: Online VAL Prover For Propositional Logic

Enter a formula to get its truth table. Use keyboard keys ~ & | -> <-> ( ) pqrstuvwxyz.

The Truth table method is an algorithm that aims to explore all possible combinations of values for individual atoms of given formula. It lists true (⊤) and false (⊥) values for every combination's atoms and also the result value of given formula if we use the selected atom values. The given formula is then called a tautology only if every combination of inputs yielded true as a result. That is to say, if there are only true values in the right side of the obtained table, the given formula is considered true.

In essence, the algorithm draws a table, laying out very possible scenario, so you can see how the truth value of a complex expression given derives from the truth values of its parts.

This is the most simple way to prove that a formula is true (valid), no matter what values its atoms have.

Here are some sample formulas to try. They all evaluate to true: , , , , .

Implemented Algorithm Description: How It Works?

This page uses the following procedure to create the truth table.

  1. Identify atomic propositions. All basic propositions (p, q, r, etc.) that are parts of the provided compound proposition, are listed in the head of table.
  2. List possible combinations of atom values. Since each atomic proposition can be either true of false, you create a table where each row represents one possible assignment of truth values. There are 2n assignments in total, where n is the number of distinct atoms in formula. For example, if you have 3 atoms: p, q, r, then the table will have 23 = 8 rows.
  3. Convert formula to its prefix form. Prefix form is easier for machine to deal with. Like humans "see" the parts of the formula in regular, infix form — machine can calculate values of prefix form of the formula faster and with less effort.
  4. For each row — a combination of atom values, calculate the given formula value. This is done by replacing atom values in the given formula with true or false and then simplifying the expression of the formula.
  5. Analyze the given formula. The last column that contains true (⊤) or false (⊥) for every indivudual assignment of atoms, provides an insight of the properties of the given formula. There are 3 possibilities:
    • The given formula is true (⊤, tautology) if and only if all the rows have formula value true.
    • The given formula is false (⊥, contradiction) if and only if all the rows have formula value false.
    • The given formula is true in some cases but false in others (contingency).

Uses

Truth tables can be used for the following applications.