BooleanTable[bf]
ブール関数 bf に渡された変数値のすべての可能な組合せに対する真理値のリストを返す.
BooleanTable[expr,{a1,a2,…}]
aiの値のすべての可能な組合せに対するブール式 expr の真理値のリストを返す.
BooleanTable[expr,{a1,a2,…},{b1,…},…]
最も外側のレベルが aiの可能な組合せを与える expr のネストした真理値表を返す.
BooleanTable
BooleanTable[bf]
ブール関数 bf に渡された変数値のすべての可能な組合せに対する真理値のリストを返す.
BooleanTable[expr,{a1,a2,…}]
aiの値のすべての可能な組合せに対するブール式 expr の真理値のリストを返す.
BooleanTable[expr,{a1,a2,…},{b1,…},…]
最も外側のレベルが aiの可能な組合せを与える expr のネストした真理値表を返す.
詳細
- 変数値の可能な組合せはTuples[{True,False},n]の順で与えられる.
- BooleanTableはTrue,Falseの値の配列のリストを返す.
- Boole[BooleanTable[…]]は1,0の値を返す.
- BooleanTable[expr,{a1,a2,…}]等では,ai等の中で明示的ではない expr 中の任意の変数は記号形式のままで残される.
- BooleanTable[expr,vars1,…,varss]はFold[BooleanTable,expr,{varss,…,vars1}]と等価である. »
- BooleanTable[bf,{r1,r2,…}]はブール関数 bf の r1, r2, … 番目の変数の可能な値に対応する真理値のリストを与える.
- BooleanTable[bf,{r1,…},{s1,…},…]は,最も外側のレベルが ri番目の変数の組合せを与える真理値のネストした表を与える. »
例題
すべて開く すべて閉じる例 (2)
スコープ (6)
BooleanTable[And[a, b], {a, b}]BooleanTable[And[a, b, c], {a, b, c}]BooleanTable[{a, b, And[a, b]}, {a, b}]//TableFormBooleanTable[{And[a, b], Or[a, b], Xor[a, b], Xnor[a, b]}, {a, b}]//TableFormBooleanTable[And[a, b], {a}, {b}]BooleanTable[And[a, b, c], {a}, {b}, {c}]BooleanTable[BooleanFunction[30, 3]]BooleanTable[BooleanCountingFunction[2, 3]]BooleanTable[And[#1, #2, #3]&]BooleanTable[BooleanFunction[30, 3], {3, 1, 2}]BooleanTable[BooleanFunction[30, 3][a, b, c], {c, a, b}]BooleanTable[BooleanFunction[30, 3], {1, 2}, {3}]BooleanTable[f[a, b], {a, b}]BooleanTable[{a, b} -> And[a, b], {a, b}]BooleanTable[Xor[a, b, c], {a, b}]BooleanTable[Graphics[{If[a, Red, Green], If[b, EdgeForm[Yellow], EdgeForm[Blue]], If[c, Disk[], Rectangle[]]}, ImageSize -> 30], {a, b, c}]一般化と拡張 (1)
t1 = BooleanTable[And[c, Or[a, b]]]使用する変数と順序はBooleanVariablesによって与えられる:
v = BooleanVariables[And[c, Or[a, b]]]t2 = BooleanTable[And[c, Or[a, b]], v]t1 === t2アプリケーション (3)
確率 (2)
BooleanProbability[e_, v_] := Count[BooleanTable[e, v], True] / 2 ^ Length[v]BooleanProbability[x∧y, {x, y}]BooleanProbability[Xor[x, y, z, w], {x, y, z, w}]BooleanProbability[BooleanCountingFunction[{3}, {x, y, z, u, v}], {x, y, z, u, v}]BooleanProbability[x∨y, {x, y}]BooleanProbability[x, {x, y}] + BooleanProbability[y, {x, y}] - BooleanProbability[x∧y, {x, y}]BooleanTable[-2 Boole[x∧y] + Boole[Xor[x, y, z]], {x, y, z}]x,y,z のそれぞれが真または偽となる確率が等しいときの予想される儲け:
Mean[%]Variance[%%]特性と関係 (6)
n 個の変数と
個の要素を持つBooleanTable:
X[n_] := Array[x, n]Table[Length@BooleanTable[Xor@@X[n], X[n]], {n, 10}]Y[n_] := Array[y, n]Table[Dimensions@BooleanTable[Xor@@Join[X[n], Y[m]], X[n], Y[m]], {n, 5}, {m, 5}];Apply[Times, %, {2}]//MatrixFormいくつかの変数の反復があるBooleanTableは最初に最も外側の反復子を評価する:
f = BooleanFunction[12345, 5][a, b, c, d, e]t1 = BooleanTable[f, {a, b}, {c, d, e}]t2 = Fold[BooleanTable, f, {{c, d, e}, {a, b}}]t1 === t2BooleanTableはTuples[{True,False},n]と同じ順序で値を列挙する:
BooleanTable[Xor[a, b], {a, b}]Xor@@@Tuples[{True, False}, 2]BooleanTable[Xnor[a, b, c], {a, b, c}]Xnor@@@Tuples[{True, False}, 3]SatisfiabilityCountは事実上BooleanTable中のTrue要素の数を数える:
Count[BooleanTable[BooleanFunction[200!, 10]], True]SatisfiabilityCount[BooleanFunction[200!, 10]]この場合,BooleanTableは
個の要素を持つだろう:
SatisfiabilityCount[BooleanCountingFunction[500, 1000]]列挙されたBooleanFunctionを返す:
BooleanFunction[30, 3]Boole[BooleanTable[%]]列挙順はFromDigitsに等しい:
FromDigits[%, 2]BooleanFunctionを使って真理値表を関数または式に変換する:
t = BooleanTable[Implies[a, b], {a, b}]f = BooleanFunction[t]BooleanTable[f[a, b], {a, b}]BooleanFunction[t, {a, b}]BooleanFunction[t, {a, b}, "NAND"]おもしろい例題 (1)
BooleanCountingFunctionの真理値表:
f = BooleanCountingFunction[8, 16]@@Array[x, 16];ArrayPlot[Boole@BooleanTable[f, Array[x, 8], Array[x, 8, 9]]]テキスト
Wolfram Research (2008), BooleanTable, Wolfram言語関数, https://reference.wolfram.com/language/ref/BooleanTable.html.
CMS
Wolfram Language. 2008. "BooleanTable." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/BooleanTable.html.
APA
Wolfram Language. (2008). BooleanTable. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/BooleanTable.html
BibTeX
@misc{reference.wolfram_2026_booleantable, author="Wolfram Research", title="{BooleanTable}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/BooleanTable.html}", note=[Accessed: 18-August-2026]}
BibLaTeX
@online{reference.wolfram_2026_booleantable, organization={Wolfram Research}, title={BooleanTable}, year={2008}, url={https://reference.wolfram.com/language/ref/BooleanTable.html}, note=[Accessed: 18-August-2026]}