/** * Move enumeration: the bridge from "legal moves are possible, illegal moves * are impossible" to an interface a finger can use. The UI never invents * rule applications — it asks this module what is legal and renders those * affordances. Every returned Move passes its rule's precondition against * the judgment it was enumerated for (preconditions are the single source of * truth; enumerators only generate the candidate space). * * Two kinds of rule, two kinds of enumeration: * - Id-parameterized rules (cancellations, combine-integers) have a FINITE * candidate space — pairs of children at a site. Enumeration is complete: * every legal application is returned (property-tested). * - Expr-parameterized rules (add/divide/multiply both sides) have an * infinite parameter space. Enumeration returns the gesture-meaningful * instances derived from the tree: drag a term across the equals sign, * drag a factor under the other side, drag a denominator factor across to * clear it. Free-form parameters remain available through Derivation.apply. */ import { type NodeId } from "./expr.js"; import type { Judgment } from "./assumptions.js"; import type { BranchingRule, Location, Rule } from "./rule.js"; export type AnyRule = Rule; /** Every rule the engine knows. UI dispatch goes through ruleById. */ export declare const allRules: readonly AnyRule[]; export declare function ruleById(id: string): AnyRule; export type AnyBranchingRule = BranchingRule; /** Disjunctive rules: dispatched through Derivation.applyBranching. */ export declare const allBranchingRules: readonly AnyBranchingRule[]; export declare function branchingRuleById(id: string): AnyBranchingRule; /** * A concrete legal move: ready to hand to Derivation.apply. `handle` is the * node the user grabs; `dropTarget`, when present, is the node the gesture * drops it onto (both exist in the current tree, so the UI can resolve them * to layout boxes). */ export interface Move { readonly ruleId: string; readonly location: Location; readonly params: unknown; readonly handle: NodeId; readonly dropTarget?: NodeId; /** Dispatch through applyBranching/branchingRuleById instead of apply. */ readonly branching?: boolean; } /** All legal moves for this judgment, every one precondition-checked. */ export declare function enumerateMoves(judgment: Judgment): Move[]; /** The legal moves that begin by grabbing this node. */ export declare function movesFrom(judgment: Judgment, handle: NodeId): Move[]; //# sourceMappingURL=moves.d.ts.map