# 真理値表（truth_table）

条件の真理値表。値の組み合わせごとに1行。

## 書き方

### truth_table(p)

**p**

条件。条件（真または偽）を受け取ります。

## 例題

- $\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)`

  ソルバーでは、`truth_table(p and q)` の答えは `[[false, false, false], [true, false, false], [false, true, false], [true, true, true]]` です。

  [ソルバーで開く](https://ja.hilberon.com/?q=truth_table%28p%20and%20q%29)

## 関連する関数

- [unequal](https://ja.hilberon.com/library/unequal)

  2つの値が異なるとき真。!=の関数形です。
- [satisfiability_instances](https://ja.hilberon.com/library/satisfiability_instances)

  条件を真にする変数の割り当て。
- [xor](https://ja.hilberon.com/library/xor)

  真である条件の個数が奇数のとき真。
- [satisfiability_count](https://ja.hilberon.com/library/satisfiability_count)

  条件を真にする変数の割り当ての数。
- [boolean_minimize](https://ja.hilberon.com/library/boolean_minimize)

  条件の最短の同値な形。
- [nor](https://ja.hilberon.com/library/nor)

  すべての条件が偽のときに真。

---
Source: https://ja.hilberon.com/library/truth_table
