chop-logic-core
Version:
Core classes, methods and functions for calculating logical formulas and constructing proofs within the Chop Logic project.
31 lines (30 loc) • 1.19 kB
TypeScript
import type { PropFormula } from "../../../models";
import type { NaturalProof } from "../classes/natural-proof";
import type { NaturalProofBuilder } from "../classes/natural-proof-builder";
/**
* Creates a proof from a functional composition of step generators.
* Useful for building proofs from higher-order functions and callbacks.
*
* @param goal - The target formula to prove
* @param stepGenerators - Functions that add steps to the proof
* @returns The completed NaturalProof instance
*
* @example
* ```typescript
* const createPremises = (builder: NaturalProofBuilder) => {
* builder.addPremise(p, "First premise")
* .addPremise(q, "Second premise");
* };
*
* const createSubProof = (builder: NaturalProofBuilder) => {
* builder.addAssumption(r, "Assume r")
* .addDerivedStep(derivedPayload, "Rule application")
* .closeSubProof("Implication Introduction");
* };
*
* const proof = composeNaturalProof(goal, createPremises, createSubProof);
* ```
*
* @category Natural Calculus
*/
export declare function composeNaturalProof(goal: PropFormula, ...stepGenerators: Array<(builder: NaturalProofBuilder) => void>): NaturalProof;