Skip to content

Esta página también está en español.

Léela en español

このページは日本語でも読めます。

日本語で読む

本页也有简体中文版本。

阅读简体中文版本

Truth table (truth_table)

The truth table of a condition: a row for each choice of values.

How to write it

truth_table(p)

p
A condition. Takes a condition, true or false.

Examples

  • truth_table⁡(p∧q)=(false⁡false⁡false⁡true⁡false⁡false⁡false⁡true⁡false⁡true⁡true⁡true⁡)\displaystyle \operatorname{truth\_table}(p \land q) = \begin{pmatrix} \operatorname{false} & \operatorname{false} & \operatorname{false} \\ \operatorname{true} & \operatorname{false} & \operatorname{false} \\ \operatorname{false} & \operatorname{true} & \operatorname{false} \\ \operatorname{true} & \operatorname{true} & \operatorname{true} \end{pmatrix}
    truth_table(p and q)

    In the solver, truth_table(p and q) gives [[false, false, false], [true, false, false], [false, true, false], [true, true, true]].

    Open in the solver
  • unequal

    True when two values differ: the function form of !=.

  • satisfiability_instances

    The assignments of its variables that make a condition true.

  • xor

    True when an odd number of conditions are true.

  • satisfiability_count

    How many assignments of its variables make a condition true.

  • boolean_minimize

    A shortest equivalent form of a condition.

  • nor

    True when every condition is false.