✨ Logic Truth Table Generator

Enter a Boolean expression: enumerate every variable assignment, evaluate it and build the full truth table.

📐 計算規則
解析布林表示式並列舉全部 2ⁿ 種變數取值:變數 A–H,非 ! / ~,與 & / &&,或 | / ||,異或 ^,蘊含 ->,等價 <-> / ==,亦支援 AND / OR / NOT / XOR 關鍵字;逐行輸出各變數值與表示式結果,並統計真值行數、判定重言式/矛盾式/可滿足式。

📚 深度解析:邏輯真值表生成器(表示式輸入)

💡 常見使用場景

  • 數字邏輯教學:輸入布林表示式,自動生成真值表
  • 電路驗證:核對組合邏輯輸出與預期
  • 化簡輔助:從真值表觀察冗餘項
方法
用法:輸入布林表示式(變數 A–H,支援 ! / & / | / ^ / -> / <-> 與 AND/OR/NOT/XOR 關鍵字及括號),工具按優先順序解析後列舉全部 2ⁿ 種取值,逐行求值並統計真值行數。n 個變數固定 2ⁿ 行。
算例
例:A && (B || !C),變數 A/B/C 共 8 行,結果為真的僅 3 行(A=1 且 B=1,或 A=1 且 C=0),判定為可滿足式。 再例:A || !A → 2 行均為 1,判定重言式;A && !A → 2 行均為 0,判定矛盾式。

❓ 常見問題(FAQ)

支援哪些運算子?
非(! / ~)、與(& / && / AND)、或(| / || / OR)、異或(^ / XOR)、蘊含(->)、等價(<-> / ==) 與括號,優先順序由高到低:! → & → ^ → | → -> → <->。
變數數上限?
最多 8 個變數(2⁸ = 256 行);超出會提示,避免頁面過長。

Formula & Standard References

ItemFormulaSource / Standard
Sampling Pick n rows from pool by ⌊random × pool size⌋ (n ≤ 50) Boolean logic demo
Render Render var column + expression column + all value combinations Boolean logic demo
Purpose For logic-circuit truth-table teaching Boolean logic demo
⚠️ 使用說明與注意事項