import type { TSchema } from "typebox"; import type { TParserWarning, TParserBuildOptions } from "./types.js"; import type { TCoreArgument, TCorePremise, TCorePropositionalExpression, TCorePropositionalVariable, TCoreClaim, TCoreClaimConnection } from "../schemata/index.js"; import { ArgumentEngine } from "../core/argument-engine.js"; import { ClaimLibrary } from "../core/claim-library.js"; import { ClaimCitationLibrary } from "../core/claim-citation-library.js"; import { ClaimAxiomLibrary } from "../core/claim-axiom-library.js"; import type { TParsedArgumentResponse, TParsedArgument, TParsedClaim, TParsedVariable, TParsedPremise } from "./schemata.js"; /** * The result returned by `ArgumentParser.build()`. */ export type TArgumentParserResult = { engine: ArgumentEngine; claimLibrary: ClaimLibrary; claimCitationLibrary: ClaimCitationLibrary; claimAxiomLibrary: ClaimAxiomLibrary; warnings: TParserWarning[]; }; /** * Validates and builds an `ArgumentEngine` from a parsed LLM response. * * Override the protected `map*` hooks to inject custom fields into * the entities created during the build phase. */ export declare class ArgumentParser { protected readonly responseSchema: TSchema; constructor(responseSchema?: TSchema); /** * Validate raw LLM output against the response schema. */ validate(raw: unknown): TParsedArgumentResponse; /** * Build an ArgumentEngine from a validated response. * * @throws If `response.argument` is null * @throws If any formula references an undeclared variable * @throws If any formula contains nested implies/iff * @throws If a variable references an undeclared claim miniId * @throws If the conclusion premise miniId is unresolvable */ build(response: TParsedArgumentResponse, options?: TParserBuildOptions): TArgumentParserResult; /** * Parses every premise formula and checks that `implies` and `iff` * appear only at the root. A formula that fails either check throws in * strict mode and is skipped with a warning otherwise. */ private parseFormulas; /** * Creates a library claim for every parsed claim and records which * claim each miniId resolved to. */ private createClaims; /** * Adds a claim-bound variable to the engine for every parsed variable * whose claim miniId resolves. An unresolved one throws in strict mode; * otherwise it is skipped with a warning and its symbol is removed from * `declaredSymbols`. */ private createVariables; /** * Keeps the formulas whose variable symbols were all declared by a * surviving variable. A formula naming any other symbol throws in * strict mode and is dropped with a warning otherwise. */ private filterFormulasByDeclaredSymbols; /** * Creates a premise for every surviving formula and builds its * expression tree, returning the premise id each miniId resolved to. * * The build adds one expression per AST node, parents first, so it * passes through states where an operator has no children yet. It * therefore runs with auto-normalization switched off, and a single * `engine.normalize()` runs over the finished trees afterwards. The * engine `build` creates uses the default `assistive` behavior, so the * returned engine is normalized and back in `assistive` mode. The * parser test 'auto-normalizes nested operators by inserting formula * buffers' checks that AN-1 fires on the finished tree. */ private buildPremises; /** * Marks the premise named by `conclusionPremiseMiniId` as the * conclusion. An unresolvable miniId throws in strict mode and leaves * the conclusion unset with a warning otherwise. */ private setConclusion; /** * The pipeline's deterministic relation sort extracted * citation/axiomatic antecedents out of freeform premises into * `derivationBacking` (each backed claim → its citation/axiomatic * supporters). Materialize each as a ClaimCitationLibrary / * ClaimAxiomLibrary edge. */ private addDerivationBackingEdges; /** * Adds one support edge to its library, once per consequent/supporter * pair. A library rejection throws in strict mode and becomes a warning * otherwise. */ private tryAddSupportEdge; protected mapArgument(_parsed: TParsedArgument): Record; protected mapClaim(_parsed: TParsedClaim): Record; protected mapVariable(_parsed: TParsedVariable): Record; protected mapPremise(_parsed: TParsedPremise): Record; protected mapClaimCitation(_dependentParsed: TParsedClaim, _supportingParsed: TParsedClaim, _dependentClaimId: string, _supportingClaimId: string): Record; protected mapClaimAxiom(_dependentParsed: TParsedClaim, _supportingParsed: TParsedClaim, _dependentClaimId: string, _supportingClaimId: string): Record; } //# sourceMappingURL=argument-parser.d.ts.map