Constraint Then Solve
Reasoning fails when the solver answers a different problem than the one asked. Restate the problem, separate hard from soft constraints, then solve.
Procedure
1 - Restate the problem
One short paragraph: goal, known context, unknowns, assumptions. If the request is unambiguous, the restatement can be a sentence.
2 - State the unknowns
Name what you do not have and what you will infer. Example: "I do not have the production schema; I infer the column from the migration." Do not silently fill a gap with a confident guess.
3 - Catalog constraints
Number them and mark each hard or soft:
Hard:
1. Must run on Python 3.10.
2. Must not change the public response shape.
Soft:
3. Prefer fewer dependencies.
Hard constraints can fail the solution. Soft constraints trade off against each other and must be named as tradeoffs.
4 - Derive requirements
State what the solution must satisfy, derived from the catalog. This catches a constraint that the obvious solution violates.
5 - Solve
Generate the smallest solution that satisfies the hard constraints. If a soft constraint is violated, say which one and why.
6 - Verify each constraint
Mark every item pass, fail, or unverified, with the evidence. A solution that passes the tests but violates a hard constraint is not done.
When to Use
- Ambiguous requests with costly wrong assumptions
- Compatibility or migration work
- Debugging before choosing a fix
- Any decision where constraints conflict
Anti-patterns
- Solving before listing the constraints.
- Treating a preference as a hard requirement.
- Hiding an unverified assumption inside confident prose.
- Declaring success after checking only the easy constraints.
- Adding style rules about how the reasoning must be phrased.
Verification Checklist
- [ ] The problem is restated in one short paragraph.
- [ ] Unknowns and inferred assumptions are explicit.
- [ ] Constraints are numbered and marked hard or soft.
- [ ] Every hard constraint is marked pass, fail, or unverified.
- [ ] Any violated soft constraint is named as a tradeoff.