Associative law: (A AND B) AND C = A AND (B AND C)
The associative law says that regrouping a chain of the same operator does not change its value: (A AND B) AND C = A AND (B AND C), and likewise for OR and XOR.
Regrouping a chain of the same operator (AND, OR, or XOR) does not change its value.
Because the grouping does not matter, the engine writes a chain without inner brackets, A AND B AND C, and treats it as one gate with three inputs. That is also why the parser lets you omit brackets in a same-operator chain but insists on them when operators are mixed: A AND B OR C is read by precedence, and A -> B -> C associates to the right, which is a different rule.
Associativity is what lets a circuit designer build a four-input AND from three two-input gates in any tree shape, and what lets the simplifier regroup (A AND B) AND A into one chain, recorded as an associativity step, before idempotence removes the duplicate.
The proof below is over three variables, eight rows, and the engine checks each regrouping against the flat chain.
Statement
(A AND B) AND C = A AND (B AND C) = A AND B AND C Proof by truth table: (A AND B) AND C = A AND (B AND C) = A AND B AND C
| # | A | B | C | lhs | mid1 | rhs |
|---|---|---|---|---|---|---|
| 0 | FALSE | FALSE | FALSE | FALSE | FALSE | FALSE |
| 1 | FALSE | FALSE | TRUE | FALSE | FALSE | FALSE |
| 2 | FALSE | TRUE | FALSE | FALSE | FALSE | FALSE |
| 3 | FALSE | TRUE | TRUE | FALSE | FALSE | FALSE |
| 4 | TRUE | FALSE | FALSE | FALSE | FALSE | FALSE |
| 5 | TRUE | FALSE | TRUE | FALSE | FALSE | FALSE |
| 6 | TRUE | TRUE | FALSE | FALSE | FALSE | FALSE |
| 7 | TRUE | TRUE | TRUE | TRUE | TRUE | TRUE |
The same law in four notations
(A AND B) AND C(A && B) && C(A ∧ B) ∧ C(A·B)·C\left(A \cdot B\right) \cdot CA AND (B AND C)A && (B && C)A ∧ (B ∧ C)A·(B·C)A \cdot \left(B \cdot C\right)A AND B AND CA && B && CA ∧ B ∧ CA·B·CA \cdot B \cdot CThe common slip
Assuming implication is associative. (A -> B) -> C and A -> (B -> C) are different formulas; the engine reads an unbracketed chain A -> B -> C as A -> (B -> C), and the equivalence checker shows the row where the other grouping differs.
Questions
Does associativity hold for NAND and NOR?
No, and that is why the engine only accepts them in function form with exactly two operands. NAND(NAND(A, B), C) and NAND(A, NAND(B, C)) are different functions.
Related
Lesson that teaches this
Pitfalls
Tools
- Boolean algebra calculator and simplifier with steps (every law named and verified)
- Logical equivalence checker: two expressions, exact verdict, counterexample
See also
- Operator precedence in Boolean logic: NOT, then AND, then XOR, then OR
- Lesson 3: Grouping and precedence (beginner, 12 min)
- “A or B and C”: the grouping ambiguity and how to resolve it
- Commutative law: A AND B = B AND A, A OR B = B OR A
Laws
Generated from the Tangibool engine, semantics tangibool-semantics/1, engine 1.0.0, build . Every table, map, simplification and verdict on these pages was computed by the Tangibool engine when the site was built, and every claim was re-checked by the same exact checker the app uses. Limits are stated where they apply. © 2026 Foreranger LTD.