import type { AgencyNode } from "../types.js"; import type { ScopeInfo, TypeCheckerContext } from "./types.js"; import { type FlowNode, type FlowEnvironment } from "./flow.js"; /** * Attach `flow` to every variable-referencing node inside an expression. The * leaf rule (set `flowOf` on `variableName`/`valueAccess`) plus a recurse over * `expressionChildren` is the whole walk. Short-circuit operators get per-side * flow in Task 4 as a special case ahead of this general path. */ export declare function attachExpressionsToFlow(node: AgencyNode | null | undefined, flow: FlowNode, env: FlowEnvironment): void; /** * Names of variables a body rebinds (for loop widening). Bare `x = …` only — * access-chain mutations and destructuring patterns are excluded, matching the * `assignment` rule below. */ export declare function assignedNames(body: AgencyNode[]): string[]; /** * Build the flow graph for one body. A pure fold: each statement's rule maps * the incoming flow to the next. Once `flow` is `exit`, the remaining * statements are unreachable, so the rule is not applied (no node is built * rooted at `exit`, where typeAt throws; dead-code refs go unattached, which * is harmless — PR 2 falls back to scope.lookup for nodes with no flow). */ export declare function buildFlowGraph(nodes: AgencyNode[], entry: FlowNode, env: FlowEnvironment): FlowNode; /** * Pass entry: build a flow graph per scope, sharing one `flowOf`/`memo` across * the whole check so PR 2 can look up any node. Each scope's build env carries * that scope (typeAt reads scope from `start` nodes, not `env.scope`, so the * shared graph state is safe). Stores a representative env on `ctx`; nothing * consults it yet (PR 1b is behavior-preserving). */ export declare function buildFlowGraphs(scopes: ScopeInfo[], ctx: TypeCheckerContext): void;