chop-logic-core
Version:
Core classes, methods and functions for calculating logical formulas and constructing proofs within the Chop Logic project.
807 lines (762 loc) • 28.7 kB
TypeScript
/**
* Types of steps in logical proofs.
* Defines the different kinds of steps that can appear in a logical proof.
* @enum {string}
*
* @category Proof System Enums
*/
declare enum Step {
/** Initial assumption or given statement */
Premise = "Premise",
/** Temporary assumption for sub-proof */
Assumption = "Assumption",
/** Abbreviated proof step */
Shortcut = "Shortcut",
/** Repetition of a previous step */
Reiteration = "Reiteration",
/** Step derived from previous steps */
Derivation = "Derivation",
/** Basic axiom of the system */
Axiom = "Axiom"
}
/**
* Axiom schemas for the Hilbert-style calculus.
* These represent the fundamental axioms of propositional logic in Hilbert's system.
* @enum {string}
*
* @category Proof System Enums
*/
declare enum HilbertCalculusSchema {
/** Implication Introduction */
II = "II",
/** Implication Distribution */
ID = "ID",
/** Implication Reversal */
IR = "IR",
/** Implication Elimination */
IE = "IE"
}
/**
* Rules for natural deduction system.
* Defines both introduction and elimination rules for logical connectives.
* @enum {string}
*
* @category Proof System Enums
*/
declare enum NaturalCalculusRule {
/** Negation Introduction */
NI = "NI",
/** Conjunction Introduction */
CI = "CI",
/** Disjunction Introduction */
DI = "DI",
/** Implication Introduction */
II = "II",
/** Equivalence Introduction */
EI = "EI",
/** Negation Elimination */
NE = "NE",
/** Conjunction Elimination */
CE = "CE",
/** Disjunction Elimination */
DE = "DE",
/** Implication Elimination */
IE = "IE",
/** Equivalence Elimination */
EE = "EE"
}
/**
* Types of formula validation checks.
* Used to verify the applicability of logical rules and structural equality.
* @enum {string}
*
* @category Proof System Enums
*/
declare enum PropFormulaCheck {
/** Check if two formulas are structurally equal */
areEqual = "areEqual",
/** Check if Implication Elimination is applicable */
isIE = "isIE",
/** Check if Disjunction Elimination is applicable */
isDE = "isDE",
/** Check if Conjunction Elimination is applicable */
isCE = "isCE",
/** Check if Equivalence Elimination is applicable */
isEE = "isEE",
/** Check if Negation Elimination is applicable */
isNE = "isNE",
/** Check if Disjunction Introduction is applicable */
isDI = "isDI",
/** Check if Conjunction Introduction is applicable */
isCI = "isCI",
/** Check if Equivalence Introduction is applicable */
isEI = "isEI",
/** Check if Negation Introduction is applicable */
isNI = "isNI",
/** Check if Implication Introduction is applicable */
isII = "isII"
}
/**
* Standard textual representations of logical symbols.
* Provides ASCII-compatible symbols for logical operators.
* @enum {string}
*
* @category Symbols and Operators
*/
declare enum Glyph {
/** Implication (→) */
Implication = "=>",
/** Reversed implication (←) */
ReversedImplication = "<=",
/** Conjunction (∧) */
Conjunction = "&",
/** Disjunction (∨) */
Disjunction = "|",
/** Negation (¬) */
Negation = "~",
/** Equivalence (≡) */
Equivalence = "<=>",
/** Exclusive disjunction (⊕) */
ExclusiveConjunction = "^",
/** Sheffer stroke (↑, NAND) */
ShefferStroke = "!&",
/** Webb operation (↓, NOR) */
WebbOperation = "!|",
/** Anti-implication (↛) */
AntiImplication = "!=>",
/** Reversed anti-implication (↚) */
ReversedAntiImplication = "!<=",
/** Contradiction (⊥) */
Contradiction = "#",
/** Tautology (⊤) */
Tautology = "@",
/** Opening parenthesis */
OpenParenthesis = "(",
/** Closing parenthesis */
CloseParenthesis = ")"
}
/**
* Types of glyphs in logical expressions.
* @enum {string}
*
* @category Symbols and Operators
*/
declare enum GlyphType {
/** Variable symbols */
Variable = "variable",
/** Logical operator symbols */
Operator = "operator",
/** Grouping parentheses */
Parenthesis = "parenthesis"
}
/**
* Unicode representations of logical symbols.
* Maps logical operators to their proper Unicode characters.
* @enum {string}
*
* @category Symbols and Operators
*/
declare enum GlyphUnicode {
/** Implication (→) */
Implication = "\u2192",
/** Reversed implication (←) */
ReversedImplication = "\u2190",
/** Conjunction (∧) */
Conjunction = "\u2227",
/** Disjunction (∨) */
Disjunction = "\u2228",
/** Negation (¬) */
Negation = "\u00AC",
/** Equivalence (≡) */
Equivalence = "\u2261",
/** Exclusive disjunction (⊕) */
ExclusiveConjunction = "\u2295",
/** Sheffer stroke (↑) */
ShefferStroke = "\u2191",
/** Webb operation (↓) */
WebbOperation = "\u2193",
/** Anti-implication (↛) */
AntiImplication = "\u219B",
/** Reversed anti-implication (↚) */
ReversedAntiImplication = "\u219A",
/** Contradiction (⊥) */
Contradiction = "\u22A5",
/** Tautology (⊤) */
Tautology = "\u22A4",
/** Opening parenthesis */
OpenParenthesis = "(",
/** Closing parenthesis */
CloseParenthesis = ")"
}
/**
* Logical operator types supported in the system.
* Defines the core logical operations available in propositional logic.
*
* @enum {string}
*
* @category Symbols and Operators
*/
declare enum Operator {
/** Variable placeholder */
Var = "VAR",
/** Logical negation (NOT) */
Not = "NOT",
/** Logical conjunction (AND) */
And = "AND",
/** Logical disjunction (OR) */
Or = "OR",
/** Material implication (IF...THEN) */
Implies = "IMPLIES",
/** Reversed implication */
ReversedImplies = "REVERSED_IMPLIES",
/** Logical equivalence (IFF) */
Equiv = "EQUIV",
/** Exclusive disjunction (XOR) */
Xor = "XOR",
/** Not AND operation */
Nand = "NAND",
/** Not OR operation */
Nor = "NOR",
/** Anti-implication */
AntiImplies = "ANTI_IMPLIES",
/** Reversed anti-implication */
ReversedAntiImplies = "REVERSED_ANTI_IMPLIES",
/** Logical contradiction (always false) */
Contradiction = "CONTRADICTION",
/** Logical tautology (always true) */
Tautology = "TAUTOLOGY"
}
/**
* Represents an atomic proposition in the logical system.
* An atomic proposition is the simplest form of a logical statement.
*
* @category Basic Types
*/
type PropAtom = [string];
/**
* Represents a symbol in a propositional formula.
* Could be a variable, operator, or parenthesis.
*
* @category Basic Types
*/
interface PropSymbol {
/** The atomic component of the symbol */
atom: PropAtom;
/** Type classification of the symbol */
type: GlyphType;
/** Position in the expression */
position: number;
/** String representation */
view: string;
}
/**
* A sequence of propositional symbols forming a logical expression.
*
* @category Basic Types
*/
type PropExpression = PropSymbol[];
/**
* Represents a well-formed formula in propositional logic.
* Can be either atomic or composite with an operator and subformulas.
*
* @category Formula Types
*/
interface PropFormula {
/** The main logical operator of the formula */
operator: Operator;
/** Either sub-formulas for composite formulas or an atomic proposition */
values: PropFormula[] | PropAtom;
}
/**
* Maps indices to atomic propositions for variable tracking.
* Used to maintain associations between formula parts.
*
* @category Formula Types
*/
type PropFormulaVariablesMap = Map<number, PropAtom>;
/**
* Represents a single step in a logical proof.
* Contains all information needed to display and validate the step.
*
* @category Proof System Types
*/
interface PropProofStep {
/** Sequential number of the step in the proof */
index: number;
/** Type of the proof step */
step: Step;
/** Logical formula for this step */
formula: PropFormula;
/** Symbolic expression of the formula */
expression: PropExpression;
/** String representation for display */
stringView: string;
/** Explanation or justification */
comment: string;
/** References to steps this was derived from */
derivedFrom?: number[];
/** Nesting level for sub-proofs */
level?: number;
/** Reference to the assumption this step depends on */
assumptionIndex?: number;
}
/**
* Maps indices to arrays of truth values.
* Used for managing truth assignments in evaluations.
*
* @category Truth Table Types
*/
type TruthAssignmentsMap = Map<number, boolean[]>;
/**
* Represents a single row in a truth table.
* Maps variable names to their truth values.
*
* @category Truth Table Types
*/
type TruthTableRow = Record<string, boolean>;
/**
* Complete truth table for a formula.
* Collection of all possible truth value combinations.
*
* @category Truth Table Types
*/
type TruthTable = TruthTableRow[];
/**
* Converts a given `PropSymbol` into its corresponding logical operator.
*
* - If the symbol represents a known logical operator glyph, returns the matching `Operator` enum.
* - If the symbol represents a variable, returns `Operator.Var`.
* - Throws an error if the symbol is neither a recognized operator nor a variable.
*
* @param symbol - The `PropSymbol` to be converted into an `Operator`.
* @returns The corresponding `Operator` enum value.
* @throws {Error} If the symbol is not recognized as an operator or a variable.
*/
declare function createOperator(symbol: PropSymbol): Operator;
/**
* Converts a logical expression string into an array of PropSymbols.
*
* - Uses `tokenizeString` to split the input string into tokens.
* - Uses `createPropositionalSymbol` to convert tokens into `PropSymbol` objects.
* - Assigns an index-based position to each symbol.
*
* @param input - The logical expression as a string.
* @returns An array of `PropSymbol` objects representing the parsed expression.
* @throws {Error} If the input contains invalid characters.
*/
declare function createPropExpression(input: string): PropSymbol[];
/**
* Converts a well-formed propositional expression into a tree-like PropFormula.
*
* @param expression - A validated propositional expression.
* @returns The corresponding PropFormula.
* @throws {Error} If the expression is not a well-formed formula.
*/
declare function createPropFormula(expression: PropExpression): PropFormula;
/**
* Creates a `PropSymbol` representing a propositional logic symbol.
*
* - If the character is a parenthesis, it is classified as `GlyphType.Parenthesis`.
* - If the character is a known logical glyph, it is classified as `GlyphType.Operator`.
* - If the character is a Latin letter, it is classified as `GlyphType.Variable`, and its view is the lowercase letter.
* - Throws an error if the character is unrecognized.
*
* @param char - A single character representing a logical symbol.
* @param position - The position of the symbol in the input expression.
* @returns A `PropSymbol` containing the atom, type, position, and view.
* @throws {Error} If the character is not a recognized logical symbol or a Latin letter.
*/
declare function createPropSymbol(char: string, position: number): PropSymbol;
/**
* Factory utilities for creating propositional logic components.
* Provides methods to create well-formed formulas, expressions, symbols, and operators.
*
* @namespace
* @category Utilities
*/
declare const PropositionalFactory: Readonly<{
createExpression: typeof createPropExpression;
createFormula: typeof createPropFormula;
createSymbol: typeof createPropSymbol;
createOperator: typeof createOperator;
}>;
type AxiomPayload = {
formulas: PropFormula[];
schema: HilbertCalculusSchema;
};
type DerivedPayload$1 = {
formulas: PropFormula[];
schema: HilbertCalculusSchema.IE;
derivedFrom: number[];
};
type BasePayload$1 = {
formula: PropFormula;
};
interface HilbertProofStepInput<T> {
index: number;
step: T extends Step.Derivation ? Step.Derivation : T extends Step.Axiom ? Step.Axiom : Exclude<Step, Step.Derivation | Step.Axiom | Step.Assumption>;
payload: T extends Step.Derivation ? DerivedPayload$1 : T extends Step.Axiom ? AxiomPayload : BasePayload$1;
}
/**
* Generates a PropProofStep object for use in Hilbert-style logic derivations.
* Supports Axiom, Derivation, Premise, Reiteration and Shortcut step types. Applies appropriate
* schema-based transformations and constructs the string and symbolic expression views.
* @param input - An object with necessary data for the new proof step.
* @returns A new proof step based on the input.
*/
declare function generateHilbertProofStep<T>(input: HilbertProofStepInput<T>): PropProofStep;
/**
* Constructs a formula based on the Implication Distribution axiom schema:
* ((A => (B => C)) => ((A => B) => (A => C)))
*
* @param formulas - An array of propositional formulas.
* @returns A new propositional formula representing the axiom schema.
*/
declare function implicationDistribution(formulas: PropFormula[]): PropFormula;
/**
* Applies the rule of Implication Elimination (Modus Ponens).
*
* Given an implication (A => B) and its antecedent A,
* it derives the consequent B.
*
* @param formulas - An array of propositional formulas.
* @returns The consequent of the implication if the rule is applicable.
* @throws {Error} if implication elimination is not applicable.
*/
declare function implicationElimination$1(formulas: PropFormula[]): PropFormula;
/**
* Generates a formula based on the Implication Introduction axiom schema.
*
* Given two formulas A and B, this function returns the formula:
* (A => (B => A)).
*
* @param formulas - An array of propositional formulas.
* @returns A new formula representing (A => (B => A)).
*/
declare function implicationIntroduction$1(formulas: PropFormula[]): PropFormula;
/**
* Constructs a formula based on the Implication Reversal axiom schema:
* ((~A => ~B) => (B => A))
*
* @param formulas - An array of propositional formulas.
* @returns A new propositional formula representing the implication reversal.
*/
declare function implicationReversal(formulas: PropFormula[]): PropFormula;
/**
* Implementation of Hilbert-style propositional calculus.
* Provides axiom schemas and proof generation for the Hilbert system.
*
* @remarks
* Hilbert systems are characterized by a small number of axiom schemas and typically
* only one inference rule (usually modus ponens). While mathematically elegant,
* they can be more challenging to use for practical proof construction.
*
* @namespace
* @category Proof Systems
*/
declare const HilbertCalculus: Readonly<{
generateStep: typeof generateHilbertProofStep;
II: typeof implicationIntroduction$1;
ID: typeof implicationDistribution;
IR: typeof implicationReversal;
IE: typeof implicationElimination$1;
}>;
/**
* Applies Conjunction Elimination rule to an array of conjunction formulas.
*
* Given (A ∧ B), this rule allows us to infer A and B separately.
*
* @param formulas An array of conjunction formulas to eliminate.
* @returns {PropFormula[]} An array of inferred formulas after applying conjunction elimination.
* @throws {Error} if any formula is not a conjunction.
*/
declare function conjunctionElimination(formulas: PropFormula[]): PropFormula[];
/**
* Applies the conjunction introduction rule.
*
* Given two formulas A and B, it returns two conjunctions: (A ∧ B) and (B ∧ A)
*
* @param formulas An array of propositional formulas.
* @returns {[PropFormula, PropFormula]} A tuple containing the two inferred formulas.
* @throws {Error} if the formulas do not satisfy conjunction introduction conditions.
*/
declare function conjunctionIntroduction(formulas: PropFormula[]): [PropFormula, PropFormula];
/**
* Applies the disjunction elimination rule:
* Given formulas (A ∨ B), (A => C), and (B => C), we can infer C.
*
* @param formulas An array of propositional formulas.
* @returns {[PropFormula]} A tuple containing the inferred formula.
* @throws {Error} if the formulas do not satisfy disjunction elimination conditions.
*/
declare function disjunctionElimination(formulas: PropFormula[]): [PropFormula];
/**
* Applies the disjunction introduction rule.
*
* Given two formulas A and B, it returns two disjunctions: (A ∨ B) and (B ∨ A)
*
* @param formulas An array of propositional formulas.
* @returns {[PropFormula, PropFormula]} A tuple containing the two inferred formulas.
* @throws {Error} if the formulas do not satisfy disjunction introduction conditions.
*/
declare function disjunctionIntroduction(formulas: PropFormula[]): [PropFormula, PropFormula];
/**
* Performs equivalence elimination on the given formulas.
*
* If A <=> B, then we derive (A => B) and (B => A).
*
* @param formulas An array of propositional formulas.
* @returns {PropFormula[]} An array containing the inferred formulas.
* @throws {Error} if the formulas are not all equivalences.
*/
declare function equivalenceElimination(formulas: PropFormula[]): PropFormula[];
/**
* Introduces an equivalence (A <=> B) given two implications (A => B) and (B => A).
*
* @param formulas An array of propositional formulas.
* @returns {[PropFormula]} A tuple containing the inferred formula.
* @throws {Error} if the input formulas do not satisfy the equivalence introduction conditions.
*/
declare function equivalenceIntroduction(formulas: PropFormula[]): [PropFormula];
type DerivedPayload = {
formulas: PropFormula[];
rule: NaturalCalculusRule;
derivedFrom: number[];
};
type BasePayload = {
formula: PropFormula;
};
interface NaturalProofStepInput<T> {
index: number;
level: number;
assumptionIndex?: number;
step: T extends Step.Derivation ? Step.Derivation : Exclude<Step, Step.Derivation | Step.Axiom>;
payload: T extends Step.Derivation ? DerivedPayload : BasePayload;
}
/**
* Generates a PropProofStep object for use in Natural-style logic derivations.
* Supports Assumption, Derivation, Premise, Reiteration and Shortcut step types. Applies appropriate
* rule-based transformations and constructs the string and symbolic expression views.
* @param input - An object with necessary data for the new proof step.
* @returns An array of new proof steps based on the input.
*/
declare function generateNaturalProofSteps<T>(input: NaturalProofStepInput<T>): PropProofStep[];
/**
* Applies the rule of Implication Elimination.
*
* Given an implication (A => B) and its antecedent A,
* it derives the consequent B.
*
* @param formulas An array of propositional formulas.
* @returns {[PropFormula]} A tuple containing the inferred formula.
* @throws {Error} if implication elimination is not applicable.
*/
declare function implicationElimination(formulas: PropFormula[]): [PropFormula];
/**
* Applies the implication introduction rule.
*
* Given two formulas premise and conclusion, it returns their implication
*
* @param formulas An array of propositional formulas.
* @returns {[PropFormula]} A tuple containing the inferred formula.
* @throws {Error} if the formulas do not satisfy disjunction introduction conditions.
*/
declare function implicationIntroduction(formulas: PropFormula[]): [PropFormula];
/**
* Applies negation elimination rule:
* If ~(~A), then we can infer ~A.
*
* @param formulas An array of propositional formulas.
* @returns {[PropFormula]} A tuple containing the inferred formula.
* @throws {Error} if negation introduction rule is not applicable.
*/
declare function negationElimination(formulas: PropFormula[]): [PropFormula];
/**
* Applies negation introduction rule:
* If (A => B) and (A => ~B), then we can infer ~A.
*
* @param formulas - An array of propositional formulas.
* @returns {[PropFormula]} A tuple containing the inferred formula.
* @throws {Error} if negation introduction rule is not applicable.
*/
declare function negationIntroduction(formulas: PropFormula[]): [PropFormula];
/**
* Implementation of natural deduction system for propositional logic.
* Provides introduction and elimination rules for logical connectives.
*
* @remarks
* Natural deduction is a more intuitive proof system that mirrors human reasoning.
* Each logical connective has its own introduction and elimination rules, making
* the system more practical for constructing proofs than axiomatic systems.
*
* @namespace
* @category Proof Systems
*/
declare const NaturalCalculus: Readonly<{
generateSteps: typeof generateNaturalProofSteps;
NI: typeof negationIntroduction;
CI: typeof conjunctionIntroduction;
DI: typeof disjunctionIntroduction;
II: typeof implicationIntroduction;
EI: typeof equivalenceIntroduction;
NE: typeof negationElimination;
CE: typeof conjunctionElimination;
DE: typeof disjunctionElimination;
IE: typeof implicationElimination;
EE: typeof equivalenceElimination;
}>;
/**
* Applies a series of propositional formula checks to an array of formulas.
*
* @param formulas - An array of propositional formulas to check.
* @param checks - An array of check names to apply (defaults to all available checks).
* @returns An object mapping each check name to its boolean result.
*/
declare function applyPropFormulaChecks(formulas: PropFormula[], checks?: PropFormulaCheck[]): Record<PropFormulaCheck, boolean>;
/**
* Evaluates a propositional formula based on a given truth assignment.
*
* @param {Object} params - Function parameters.
* @param {PropFormula} params.formula - The propositional formula in tree-like structure.
* @param {boolean[]} params.assignment - The truth assignment for the variables.
* @param {variablesMap} [params.variablesMap] - The map of formula variables ordered alphabetically
* @returns {boolean} - The boolean result of the evaluated formula.
* @throws {Error} If the number of variables in the formula does not match the assignment length.
*/
declare function calculatePropFormula({ formula, assignment, variablesMap, }: {
formula: PropFormula;
assignment: boolean[];
variablesMap?: PropFormulaVariablesMap;
}): boolean;
declare function convertPropFormulaToExpression(formula: PropFormula): PropExpression;
/**
* Converts a propositional formula into a string representation using Unicode logical symbols.
*
* @param {PropFormula} formula - The propositional formula to convert.
* @returns {string} The string representation of the formula using Unicode glyphs.
*/
declare function convertPropFormulaToString(formula: PropFormula): string;
/**
* Extracts all true sub-formulas from a given propositional formula.
* This function does not include atomic formulas (Operator.Var) as sub-formulas,
* nor does it include the input formula itself.
*
* @param {PropFormula} formula - The propositional formula to extract sub-formulas from.
* @returns {PropFormula[]} An array of unique sub-formulas, sorted in evaluation order.
*/
declare function extractPropSubFormulas(formula: PropFormula): PropFormula[];
/**
* Extracts all propositional variables from a given formula and returns them in a sorted map.
*
* @param formula - The propositional formula.
* @returns A map of variables, sorted alphabetically.
*/
declare function extractPropVariables(formula: PropFormula): PropFormulaVariablesMap;
/**
* Generates a truth table for the given propositional formula.
*
* @param {PropFormula} formula - The propositional formula.
* @param {number} [limit=100] - The max number of variables in the formula.
* @returns {TruthAssignmentsMap} - A map where keys are assignments, and values are truth values.
* @throws {Error} If the formula has more variables than the limit allows.
*/
declare function generatePropTruthTable(formula: PropFormula, limit?: number): TruthAssignmentsMap;
/**
* Generates all possible truth assignments for a given number of variables.
*
* @param varCount - The number of boolean variables.
* @param limit - The maximum allowed number of variables (default: 100).
* @returns A map of truth assignments, indexed by binary count.
* @throws {Error} If varCount exceeds the limit.
*/
declare function generateTruthAssignments(varCount: number, limit?: number): TruthAssignmentsMap;
/**
* Evaluates the logical value of a binary operation given two boolean operands.
*
* @param operator - The logical operator to apply.
* @param leftOperand - The boolean value of the left operand.
* @param rightOperand - The boolean value of the right operand.
* @returns The result of applying the operator to the operands.
* @throws {Error} If the operator is not a binary operator.
*/
declare function getBinaryOperationValue({ operator, leftOperand, rightOperand, }: {
operator: Operator;
leftOperand: boolean;
rightOperand: boolean;
}): boolean;
/**
* Computes the logical value of an unary operator applied to an operand.
*
* @param operator - The unary operator to evaluate.
* @param operand - The boolean value of the operand.
* @returns The computed boolean value after applying the unary operator.
* @throws {Error} If an unsupported operator is provided.
*/
declare function getUnaryOperationValue({ operator, operand, }: {
operator: Operator;
operand: boolean;
}): boolean;
/**
* Checks whether a given propositional expression is a well-formed formula (WFF).
*
* A WFF follows these rules:
* 1) Any single variable itself is a WFF.
* 2) Any WFF can be prefixed with "~" to form another WFF.
* 3) Any two WFFs can be combined with "&", "|", "=>", or "<=>" inside parentheses to form another WFF.
*
* Parentheses are mandatory when joining two WFFs using binary operators.
*
* @param expression - The propositional expression as an array of PropSymbols.
* @returns `true` if the expression is a valid WFF, otherwise `false`.
*/
declare function isWellFormedFormula(expression: PropExpression): boolean;
/**
* Utility functions for working with propositional formulas.
* Provides methods for formula manipulation, evaluation, and validation.
*
* @namespace
* @category Utilities
*/
declare const PropositionalUtils: Readonly<{
calculateFormula: typeof calculatePropFormula;
convertToString: typeof convertPropFormulaToString;
convertToExpression: typeof convertPropFormulaToExpression;
getVariables: typeof extractPropVariables;
getSubFormulas: typeof extractPropSubFormulas;
isWFF: typeof isWellFormedFormula;
getUnaryValue: typeof getUnaryOperationValue;
getBinaryValue: typeof getBinaryOperationValue;
generateTT: typeof generatePropTruthTable;
generateAssignments: typeof generateTruthAssignments;
applyChecks: typeof applyPropFormulaChecks;
}>;
/**
* Converts a given logical glyph character into its corresponding Unicode representation.
*
* @param char - A string representing a logical glyph (e.g., '=>', '&', '|', '~', etc.).
* @returns The corresponding Unicode character from the `GlyphUnicode` enum.
* @throws {Error} If the character is not a recognized `Glyph`.
*/
declare function getGlyphUnicode(char: string): GlyphUnicode;
/**
* Converts a given Operator into its corresponding Glyph.
*
* @param {Operator} operator - The logical operator to convert.
* @returns {Glyph} - The corresponding glyph.
* @throws {Error} If the operator is not recognized.
*/
declare function getOperatorGlyph(operator: Operator): Glyph;
/**
* Tokenizes an input string into an array of known logical glyphs and variable names.
*
* - Recognizes logical glyphs defined in `Glyph`.
* - Groups consecutive English letters into variables.
* - Ignores spaces in the input.
* - Throws an error if the input contains unsupported characters.
*
* @param input - The logical expression as a string.
* @returns An array of tokens (glyphs and variables).
* @throws {Error} If the input contains unsupported characters.
*/
declare function tokenizeString(input: string): string[];
export { Glyph, GlyphType, GlyphUnicode, HilbertCalculus, HilbertCalculusSchema, NaturalCalculus, NaturalCalculusRule, Operator, type PropAtom, type PropExpression, type PropFormula, PropFormulaCheck, type PropFormulaVariablesMap, type PropProofStep, type PropSymbol, PropositionalFactory, PropositionalUtils, Step, type TruthAssignmentsMap, type TruthTable, type TruthTableRow, getGlyphUnicode, getOperatorGlyph, tokenizeString };