chop-logic-core
Version:
Core classes, methods and functions for calculating logical formulas and constructing proofs within the Chop Logic project.
17 lines (16 loc) • 723 B
TypeScript
import type { PropExpression } from "../../models";
/**
* 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`.
* @category Validators
*/
export declare function isWellFormedFormula(expression: PropExpression): boolean;