executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
evaluate-boolean-expressionEvaluate and simplify Boolean expressions using truth tables, algebraic laws (De Morgan, distributive, absorption, idempotent, consensus), and Karnaugh maps for up to six variables. Use when you need to reduce a Boolean expression to its minimal sum-of-products or product-of-sums form, verify logical equivalence between two expressions, or prepare a minimiz…
Independent GitHub snapshot · Automated classification · Original documentation governs
Reduce Boolean expr → minimal form. Parse → canonical, truth table, algebraic laws, K-map (≤6 vars), verify equivalent to original.
A AND (B OR NOT C), A * (B + C'), A & (B | ~C))Convert to standard internal rep.
* AND, + OR, ' NOT, ^ XOR.X = X*(Y + Y').X = X + Y*Y'.## Normalized Expression
- **Variables**: [A, B, C, ...]
- **Variable count**: [n]
- **Original expression**: [as given]
- **Canonical SOP (minterms)**: Sigma m(i, j, k, ...)
- **Canonical POS (maxterms)**: Pi M(i, j, k, ...)
- **Don't-care set**: d(i, j, ...) [if any]
→ Expr converted canonical SOP/POS w/ all min/maxterms listed, don't-cares separated.
If err: syntax/precedence ambiguous → clarify. Standard: NOT (highest) > AND > XOR > OR (lowest). >6 vars → K-map needs Quine-McCluskey.
Build complete table for behavior over all inputs.
X instead of 0/1.## Truth Table
| A | B | C | F |
|---|---|---|---|
| 0 | 0 | 0 | _ |
| 0 | 0 | 1 | _ |
| ... | ... | ... | ... |
→ Complete 2^n rows, outputs match canonical, don't-cares marked.
If err: table disagrees w/ canonical → recheck Step 1 expansion. Common: misapply De Morgan during canonical → verify each step.
Reduce via Boolean identities.
A + 0 = A, A * 1 = A, A + 1 = 1, A * 0 = 0.A + A = A, A * A = A.A + A' = 1, A * A' = 0.A + A*B = A, A * (A + B) = A.(A * B)' = A' + B', (A + B)' = A' * B'.A * (B + C) = A*B + A*C, A + B*C = (A + B) * (A + C).A*B + A'*C + B*C = A*B + A'*C (B*C redundant).A*B' + A'*B = A ^ B.## Algebraic Simplification Trace
1. Original: [expression]
2. Apply [law name]: [result]
3. Apply [law name]: [result]
...
n. Final algebraic form: [simplified expression]
→ Step-by-step reduction w/ law citations, converging simpler. Trace = verifiable proof.
If err: no further simplify but non-minimal → Step 4 (K-map). Algebraic ≠ guaranteed global min — depends on order.
Provably minimal SOP/POS (≤6 vars).
## K-map Result
- **Prime implicants**: [list with covered minterms]
- **Essential prime implicants**: [list]
- **Minimal SOP**: [expression]
- **Minimal POS**: [expression, if requested]
- **Literal count**: [number of literals in minimal form]
→ Minimal SOP/POS fewest literals, all PIs documented.
If err: ambiguous (multiple minimal covers) → list all equivalent. >6 vars → Quine-McCluskey tabular or Espresso heuristic, note change.
Confirm logical equivalence simplified vs original.
## Equivalence Verification
- **Method**: [truth table comparison / algebraic proof / both]
- **Mismatched rows**: [none, or list row numbers]
- **Verdict**: [Equivalent / Not equivalent]
- **Final minimal expression**: [the verified result]
→ Simplified matches original all non-don't-care. Final min form clear.
If err: mismatch → trace Steps 3-4. Common: incorrect K-map grouping (non-rect / non-power-of-2), forget wrap, group 0 cell.
A + B * C ≠ (A + B) * C.design-logic-circuit — map minimized expr → gate-levelargumentation — structured logical reasoning, shares formal logic