import { type TBoundAspect, type TCorePropositionalExpression, type TCorePropositionalVariable } from "../../schemata/index.js"; import type { TPositionClass } from "../../types/response.js"; import type { TArgumentEngineSnapshot } from "../argument-engine.js"; /** * A reference, from inside a subtree, to one element of another argument at * a pinned version: the expression an expression-bound variable names, or * the premise an externally premise-bound variable names. */ export type TOutsideReference = { kind: "expression"; argumentId: string; argumentVersion: number; expressionId: string; aspect: TBoundAspect; } | { kind: "premise"; argumentId: string; argumentVersion: number; premiseId: string; }; /** * A subtree's structure written out in full, and the references it makes * into other arguments, in the order the structure meets them. Two subtrees * with equal `shape` hold references to the same elements in the same order, * so their `outside` lists line up entry by entry, differing at most in the * versions they pin. */ export interface TSubtreeDescription { shape: string; outside: TOutsideReference[]; } export interface TSnapshotIndex { argumentId: string; conclusionPremiseId: string | undefined; expressions: Map; children: Map; variables: Map; premiseOfExpression: Map; premiseRoots: Map; } /** * The snapshot's expressions, premises and variables, indexed once per * snapshot object. Shared by everything in this folder that reads a target * snapshot. */ export declare function indexOf(snapshot: TArgumentEngineSnapshot): TSnapshotIndex; /** Whether an expression of the snapshot is its premise's root, as `isAtRoot` reads it. */ export declare function isPremiseRootExpression(snapshot: TArgumentEngineSnapshot, expressionId: string): boolean; /** Whether the snapshot holds the expression. */ export declare function snapshotHasExpression(snapshot: TArgumentEngineSnapshot, expressionId: string): boolean; /** * The root expression of one premise of a snapshot: `null` when the premise * is empty, `undefined` when the snapshot has no such premise. */ export declare function premiseRootOf(snapshot: TArgumentEngineSnapshot, premiseId: string): string | null | undefined; /** * Writes out a subtree's structure: each node's type, operator and child * order, and each variable's referent. The argument's own ids and versions * never appear, and neither do the versions of other arguments; those are * collected into `outside` instead, so the caller can judge a re-pinned * reference separately. * * A variable's referent is: * - for a claim-bound variable, the claim id and claim version; * - for a variable bound to a premise of the same argument, the structure * of that premise's root, followed recursively; * - for a variable bound to a premise of another argument, that argument's * id and the premise id; * - for an expression-bound variable, the argument id, expression id and * aspect. * * @throws When the snapshot has no such expression, or when bindings between * its premises form a cycle. */ export declare function describeSubtree(snapshot: TArgumentEngineSnapshot, expressionId: string): TSubtreeDescription; /** * A hash over the structure of the subtree rooted at one expression of a * snapshot. It covers each node's type, operator and child order, and each * variable's referent: claim id and claim version for a claim-bound * variable; the bound premise's root, recursively, for a variable bound to a * premise of the same argument; argument id and premise id for one bound to * a premise of another argument; argument id, expression id and aspect for * an expression-bound variable. It ignores the argument's own ids and * versions, and leaves out the versions of other arguments, so moving * another argument to a new version does not change it. * * Two versions of an argument that keep an expression's id and give it the * same fingerprint hold the same structure under it. * * @throws When the snapshot has no such expression, or when bindings between * its premises form a cycle. */ export declare function structuralFingerprint(snapshot: TArgumentEngineSnapshot, expressionId: string): string; /** * The position class, refined by whether a nested expression sits in the * conclusion premise. Carrying an undercut strikes a premise for an operator * nested in any other premise but ignores one nested in the conclusion, so * two places with the same class can still mean different things to a link. * (Inside a derivation premise no finer split is needed: its root is a * variable, `implies` or `iff`, and those operators occur only at a root, so * an operator keeping its structure cannot move between root and nested.) * * @throws When the snapshot has no such expression. */ export declare function bindingPositionOf(snapshot: TArgumentEngineSnapshot, expressionId: string): string; /** * Where an expression sits in its argument: the root of a freeform premise, * the root of the conclusion premise, below a premise root, or anywhere in a * derivation premise. * * @throws When the snapshot has no such expression. */ export declare function positionClassOf(snapshot: TArgumentEngineSnapshot, expressionId: string): TPositionClass; //# sourceMappingURL=fingerprint.d.ts.map