Equivalence Check
Updated 2026-08-13
Summary
An equivalence check verifies that two expressions, systems, or plans produce identical outputs for identical inputs, confirming that a transformation preserved the original behavior.
Definition
An equivalence check is a verification procedure that compares two implementations, formulations, or plans and asks whether they behave identically: the same input must yield the same output, and any difference must be explained rather than ignored. Its core proposition is that a refactor, migration, or substitution is safe only when observable behavior is preserved, not merely when the new version looks correct. The key qualification is coverage, because the check is only as strong as the cases it exercises, so boundary and edge conditions must be included deliberately.
Introduction
How to use
- Refactor guard: compare old and new outputs on identical inputs before deleting the original. - Migration gate: run both systems in parallel and diff their results on real traffic. - Difference triage: treat every mismatch as a defect until it is proven to be an intended change.
Mechanism
Reasoning about code or plans is unreliable because the mind fills gaps with assumptions. Executing both versions on identical inputs replaces that reasoning with observed behavior, so any divergence becomes visible. Differences then point directly to the change that caused them, which localizes errors that inspection alone would miss.
Practice
In progress 0/1Practice this model in one real situation:
Cases
- A team migrating a database replays historical queries against both the old and new systems and compares row-level results.
- Compiler projects use differential testing, running the same programs under two implementations to expose miscompilations.
Common pitfalls
- Using unrepresentative test cases, so the check passes while boundary differences remain undetected.
- Declaring equivalence from a sample of outputs without a stated criterion, which turns verification into a hopeful guess.
Sources
Source support: Explicit
References currently contain only Wikipedia links; primary sources still need review.
- en.wikipedia.orghttps://en.wikipedia.org/wiki/Formal_equivalence_checkingverified
account_treeGenealogyexpand_more
PRIVATE NOTES · Only visible to you
SAVED Q&A
ENTRY Q&A · Private saving available
Ask with a clear boundary
thinkingmodels answers from published entry context only.
Your question is sent to thinkingmodels. The answer uses public entry context only.
RELATED MODELS