Access Control Lists — UNIX file permissions are
AND/OR/NOT over user, group, and other permission bits.
chmod 755 sets specific bits; ls -l reads them
back as boolean flags. The execute bit for a directory
means “can traverse” — a compound access decision ANDs the traverse bit
with the parent directory’s bits recursively.
Kubernetes Pod Scheduling — a Pod’s scheduling
constraints are boolean expressions. nodeAffinity
expressions use AND/OR to combine requirements. A node must match all
required terms (AND) and any of the preferred terms (OR). The scheduler
evaluates these expressions for every candidate node. An incorrectly
specified affinity expression causes Pods to be scheduled to wrong nodes
or not scheduled at all.
Firewall Rules — iptables and cloud security groups evaluate packets against chains of rules, each of which is a conjunction (AND) of match criteria: source IP AND destination port AND protocol. The rule matches only when all criteria match. De Morgan’s appears when rules are negated: “block all traffic except from 10.0.0.0/8” is implemented as two rules because negation distributes differently over sets of criteria.
Circuit Breakers — a circuit breaker opens (stops
traffic) when
failure_rate > threshold AND window_is_active. It resets
(allows traffic) when
probe_succeeds OR reset_timeout_expired. These are literal
boolean expressions evaluated by the circuit breaker at each request.
Short-circuit evaluation applies: if
failure_rate > threshold is False,
window_is_active may not be checked.
SQL WHERE Clauses — every SQL WHERE
clause is a boolean expression over column predicates. The query
optimizer applies De Morgan’s Laws and boolean identities to rewrite the
expression into a form that can use indexes efficiently.
WHERE NOT (a = 1 AND b = 2) may be rewritten as
WHERE a != 1 OR b != 2 if that form better exploits
available indexes. The optimizer is an automated De Morgan’s
transformer.
Concept: Logical Operators (AND, OR, NOT, XOR) and De Morgan’s Laws
Thread: T7 (State Machines) ← atomic propositions (Ch 1) → compound state (Ch 13) → stateless design (Book 3, Ch 3)
Core Idea: AND, OR, NOT, and XOR combine atomic statements into compound ones. De Morgan’s Laws define how negation distributes over AND and OR — misapplying them is a consistent source of authorization bugs.
Tradeoff: AT3 — Simplicity vs. Flexibility (four operators are minimally sufficient but verbose for complex conditions; named atomic variables trade brevity for clarity)
Failure Mode: FM4 — Data Consistency Failure (two components applying De Morgan’s independently can evaluate the same rule differently)
Signal: When an authorization check produces unexpected results, or when a NOT distributes over a compound condition during refactoring — check De Morgan’s. Draw the truth table.
Maps to: Book 0, Framework 5 (State)