/** * Identity cleanup taps: tiny, exactly-preserving rules that clear the * residue other moves leave behind (a stranded 0 in a sum, a 1 in a * product, x^1, x^0). All are tap gestures — no drop target. * * Note on definedness: like additive-cancellation, these can erase a * subexpression's undefinedness hole (x^0 ~> 1 is defined even where x is * not). The engine-wide soundness contract is truth-where-both-defined, * which these preserve exactly. */ import { type NodeId } from "../expr.js"; import { type Rule } from "../rule.js"; export interface DropTermParams { readonly termId: NodeId; } /** x + 0 ~> x (also accepts the canonical −0, Neg(Integer 0)). */ export declare const dropZeroTerm: Rule; /** x · 1 ~> x (strictly the literal 1; −1 is not an identity). */ export declare const dropOneFactor: Rule; /** x^1 ~> x; the base survives by identity. */ export declare const powerOne: Rule>; /** x^0 ~> 1 (0^0 = 1 under the exact evaluator). */ export declare const powerZero: Rule>; /** 0 · x ~> 0: a product with a literal-zero factor is zero. (Unconditionally * exact — 0·anything is 0 — like the other identity cleanups.) Pairs with * drop-zero-term to clear a vanished term, e.g. after 2x + (−2)x folds to 0x. */ export declare const multiplyByZero: Rule>; export declare const pullOutNegative: Rule>; /** (−a)·(−b) ~> a·b: two negative factors in a product cancel. Exact and * unconditional. Common after distributing a negative over a difference, e.g. * (−2)(x − y) → (−2)x + (−2)(−y), where the second term is (−2)(−y) → 2y. */ export declare const cancelNegatives: Rule>; /** −(a + b) ~> −a + (−b): distribute a negation across a sum. Exact and * unconditional. Needed by elimination's subtract step, where α·A + (−1)·B * produces −(B's sum) — e.g. (x + y) − (x − y) has the −(x − y) term. */ export declare const distributeNegation: Rule>; //# sourceMappingURL=identities.d.ts.map