Chop Logic Core is a TypeScript library providing core functions for working with symbolic logic. It is part of the broader Chop Logic project and offers essential utilities for logic processing and deduction.
You can install chop-logic-core via npm:
npm install chop-logic-core
Or using yarn:
yarn add chop-logic-core
The following npm scripts are available for development and maintenance:
npm run build โ Builds both ESM and CJS versions of the library.npm run prepare โ Runs build and husky commands.npm run clean โ Removes the generated lib folder.npm run format โ Formats all supported files using Biome.npm run lint โ Runs Biome linter to check for code style and quality issues.npm run lint:errors โ Shows only error-level diagnostics from Biome (limited to 100).npm run lint:warnings โ Shows only warning-level diagnostics from Biome (limited to 100 issues).npm run lint:fix โ Automatically fixes Biome issues where possible.npm run test โ Runs Jest in watch mode.npm run test:ci โ Runs Jest in CI mode, allowing zero tests to pass.npm run test:coverage โ Generates a test coverage report.npm run typecheck โ Performs a full type check without emitting output.npm run docs โ Generates documentation using typedoc.release:version โ Bumps the version (patch, minor, or major), commits the change, creates a Git tag, and pushes to main. Usage:
npm run release:version patchimport { ChopLogicCore } from 'chop-logic-core';
const { PropositionalFactory, PropositionalUtils, HilbertCalculus } = ChopLogicCore;
const { createExpression, createFormula } = PropositionalFactory;
const { generateTT, convertToString } = PropositionalUtils;
const expression = createExpression('((A => B) & ~C)');
const formula = createFormula(expression);
const truthTable = generateTT(formula);
const A = createFormula(createExpression('A'));
const implicationAB = createFormula(createExpression('(A => B)'));
const consequent = HilbertCalculus.IE([implicationAB, A]);
const stringView = convertToString(consequent);
Contributions are welcome! If you find a bug or have an idea for improvement, feel free to open an issue or submit a pull request. Please check the Contribution guide for additional info.
This project is licensed under MIT. See the LICENSE file for details.
Let's build better logic tools together! ๐