Equivalence-Preserving Rewriting¶
Core Idea¶
Equivalence-preserving rewriting transforms an object into a behaviourally equivalent but operationally different form under an explicit equivalence relation, then selects among the admissible rewrites by a cost criterion the equivalence itself does not adjudicate — the discipline lies in keeping the two factored: the equivalence carves a space of safe moves, the cost picks one point in it.
How would you explain it like I'm…
Same Thing, Easier Way
Swap Without Changing Meaning
Meaning-Safe Rewrites
Broad Use¶
- Database query optimisation: relational-algebra rewrites (selection push-down, join reordering) transform a query into result-equivalent plans, and the optimiser picks the lowest estimated cost.
- Compiler optimisation: loop unrolling, dead-code elimination, and peephole rewrites, each program-equivalence-preserving and scored by an execution-cost model.
- Theorem proving: normal-form rewriting and proof restructuring under preserved logical content.
- Symbolic computation: factoring, expanding, and simplifying under symbolic equivalence, scored by length or depth.
- Natural-language paraphrase: meaning-preserving rewordings scored by clarity, register, or length.
- Legal drafting: restating a clause to clarify or consolidate without changing its legal effect.
- Hardware synthesis: equivalent-circuit rewrites under logical equivalence, scored by gate count or power.
Clarity¶
Forces two questions ordinary language conflates — under what equivalence relation are these rewrites admissible? and what cost are we minimising? — exposing the grain problem: a too-coarse equivalence admits behaviour-changing rewrites ("correct by the spec, wrong by the user"); a too-fine one forbids safe ones.
Manages Complexity¶
Separates safe-space construction from cost minimisation — generating a good rewrite is hard, checking one preserves meaning is mechanisable, and choosing by cost is separate — so the equivalence relation, once written down, is reusable across many swappable cost models.
Abstract Reasoning¶
Licenses equivalence-as-design-choice, verification asymmetry (checking beats generating, so generate-then-verify architectures dominate), cost-equivalence orthogonality (re-tune by swapping cost models), and the non-obvious move of treating the equivalence relation — not the visible cost work — as the primary object of scrutiny, since correctness lives there.
Knowledge Transfer¶
- Compiler to legal drafting: declare the "preserved legal effects" relation up front and screen rewrites against it, rather than ad-hoc redrafting.
- Database optimiser to paraphrase: the search-then-verify architecture ports to controlled-language and assisted-editing tooling.
- Term rewriting to product design: the normal-form idea underwrites style guides, code formatters, and design-system standardisation.
Example¶
A database query optimiser generates candidate plans, each provably inside relational-algebra equivalence so correctness is never at issue, then ranks them by an orthogonal cost model — so re-tuning to new hardware swaps the cost model over a fixed, declared equivalence rather than rebuilding the safe space.
Relationships to Other Abstractions¶
Current abstraction Equivalence-Preserving Rewriting Prime
Parents (2) — more general patterns this builds on
-
Equivalence-Preserving Rewriting is a kind of Transformation Prime
The MEANING-PRESERVING subclass of transformation: an explicit equivalence relation carves a space of safe moves, plus an orthogonal cost criterion that selects within it.
-
Equivalence-Preserving Rewriting presupposes Equivalence Relation Prime
The rewriting move presupposes and operates under an explicit equivalence relation as a component, but is itself a transformation process, not a relation.
Children (15) — more specific cases that build on this
-
Codd's theorem Domain-specific is a kind of Equivalence-Preserving Rewriting
The proposed strict upward parent is
prime:equivalence_preserving_rewriting. -
Covector mapping principle Domain-specific is a kind of Equivalence-Preserving Rewriting
The proposed strict upward parent is
prime:equivalence_preserving_rewriting. -
Ddbar lemma Domain-specific is a kind of Equivalence-Preserving Rewriting
The proposed strict upward parent is
prime:equivalence_preserving_rewriting. -
Equivalent impedance transforms Domain-specific is a kind of Equivalence-Preserving Rewriting
The proposed strict upward parent is
prime:equivalence_preserving_rewriting. -
Flow to HDL Domain-specific is a kind of Equivalence-Preserving Rewriting
The proposed strict upward parent is
prime:equivalence_preserving_rewriting.
- Graph reduction Domain-specific is a kind of Equivalence-Preserving Rewriting
The proposed strict upward parent is `prime:equivalence_preserving_rewriting`.
- Köthe conjecture Domain-specific is a kind of Equivalence-Preserving Rewriting
The proposed strict upward parent is `prime:equivalence_preserving_rewriting`.
- Lambda lifting Domain-specific is a kind of Equivalence-Preserving Rewriting
The proposed strict upward parent is `prime:equivalence_preserving_rewriting`.
- Paraphrasing of copyrighted material Domain-specific is a kind of Equivalence-Preserving Rewriting
The proposed strict upward parent is `prime:equivalence_preserving_rewriting`.
- Query rewriting Domain-specific is a kind of Equivalence-Preserving Rewriting
The proposed strict upward parent is `prime:equivalence_preserving_rewriting`.
- Rule of replacement Domain-specific is a kind of Equivalence-Preserving Rewriting
Rule of Replacement instantiates Equivalence-Preserving Rewriting because it changes operational form inside a declared context while preserving logical meaning under an explicit equivalence relation.
- Semantic translation Domain-specific is a kind of Equivalence-Preserving Rewriting
The proposed strict upward parent is `prime:equivalence_preserving_rewriting`.
- Transpositional pun Domain-specific is a kind of Equivalence-Preserving Rewriting
The proposed strict upward parent is `prime:equivalence_preserving_rewriting`.
- Hartman–Grobman Theorem Domain-specific presupposes Equivalence-Preserving Rewriting
The theorem most directly instantiates **Equivalence-Preserving Rewriting**: nonlinear dynamics are recast in linear coordinates while a declared equivalence—local topological conjugacy—preserves the behavior relevant to qualitative.
- Revelation Principle Domain-specific is a decomposition of Equivalence-Preserving Rewriting
The theorem rewrites an indirect mechanism into an operationally different direct truthful form while preserving its equilibrium outcome under an explicit equivalence.
Hierarchy paths (2) — routes to 2 parentless roots
- Equivalence-Preserving Rewriting → Transformation → Function (Mapping)
- Equivalence-Preserving Rewriting → Equivalence Relation
Not to Be Confused With¶
- Equivalence-Preserving Rewriting is not Transformation in general because a transformation may change meaning freely, whereas this prime is the meaning-preserving subclass constrained by an explicit equivalence relation.
- Equivalence-Preserving Rewriting is not Optimization generically because this prime factors the search into safe-space construction (the equivalence) and within-space selection (the cost), which generic optimisation fuses.
- Equivalence-Preserving Rewriting is not Canonical Form because a canonical form is a single distinguished representative, whereas this prime is cost-driven navigation among many admissible forms that need not converge on any one.