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
Shrink Boolean expression to smallest form: parse into canonical shape, build truth table, apply algebra laws, do Karnaugh map min (up to six vars), check new expression same logic as old.
A AND (B OR NOT C), A * (B + C'), A & (B | ~C))Turn input expression into standard inner shape:
* for AND, + for OR, ' for NOT (complement), ^ for 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]
Got: Expression turned to canonical SOP and/or POS with all minterms/maxterms listed clear and don't-care cases kept apart.
If fail: Expression has syntax errors or vague op precedence? Ask for clarity. Standard precedence: NOT (highest) > AND > XOR > OR (lowest). Var count over 6? Note K-map step will need Quine-McCluskey algorithm instead.
Build full truth table to pin function behavior over all input combos:
X not 0 or 1.## Truth Table
| A | B | C | F |
|---|---|---|---|
| 0 | 0 | 0 | _ |
| 0 | 0 | 1 | _ |
| ... | ... | ... | ... |
Got: Full truth table with 2^n rows, outputs matching canonical form, don't-cares marked right.
If fail: Truth table clash with canonical form? Recheck expand in Step 1. Common slip: De Morgan's law mis-applied during canonical expand -- check each expand step one by one.
Shrink expression with Boolean algebra rules:
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 (the B*C term is extra).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]
Got: Step-by-step shrink with each law apply named, going to simpler expression. Trace is checkable proof of same-logic.
If fail: Expression won't shrink more but still feels not-min? Go to Step 4 (K-map). Algebra moves not guaranteed to find global min -- depend on order of law apply.
Use K-map to find provably min SOP or POS form (for up to 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]
Got: Min SOP (and/or POS) with fewest literals, all prime implicants and essential prime implicants logged.
If fail: Groupings vague (many min covers exist)? List all same-value min forms. Var count over 6? Switch to Quine-McCluskey tabular method or Espresso heuristic; note the swap.
Check same logic between shrunk and original expressions:
## 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]
Got: Shrunk expression matches original on all non-don't-care inputs. Final min form stated clear.
If fail: Any row mismatch? Trace error back through Steps 3-4. Common causes: wrong K-map grouping (non-rectangular or non-power-of-2 group), forget wrap-around adjacency, or slip grouping a 0 cell.
A + B * C as (A + B) * C not A + (B * C) changes function full.design-logic-circuit -- map shrunk expression to gate-level circuitargumentation -- structured logic reason that shares formal logic base