{"id":20227756,"url":"https://github.com/kamdz/logiqual","last_synced_at":"2026-03-05T02:30:55.911Z","repository":{"id":260301178,"uuid":"880907757","full_name":"kamdz/logiqual","owner":"kamdz","description":"⚖️ A lightweight library for comparing boolean functions and generating truth tables.","archived":false,"fork":false,"pushed_at":"2025-05-12T08:03:34.000Z","size":542,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-06T01:06:28.806Z","etag":null,"topics":["algebra","boolean","comparison","functions","logic","logical","truth-table"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/logiqual","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kamdz.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-10-30T15:23:41.000Z","updated_at":"2025-02-13T23:00:40.000Z","dependencies_parsed_at":"2025-04-10T17:24:33.756Z","dependency_job_id":"84a81f72-13a4-4a5c-84d8-0a8fa5c37d83","html_url":"https://github.com/kamdz/logiqual","commit_stats":null,"previous_names":["kamdz/logiqual"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/kamdz/logiqual","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamdz%2Flogiqual","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamdz%2Flogiqual/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamdz%2Flogiqual/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamdz%2Flogiqual/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kamdz","download_url":"https://codeload.github.com/kamdz/logiqual/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamdz%2Flogiqual/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30107199,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T01:39:18.192Z","status":"online","status_checked_at":"2026-03-05T02:00:06.710Z","response_time":93,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algebra","boolean","comparison","functions","logic","logical","truth-table"],"created_at":"2024-11-14T07:26:24.908Z","updated_at":"2026-03-05T02:30:55.894Z","avatar_url":"https://github.com/kamdz.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⚖️ logiqual\n\nA lightweight library for comparing boolean functions and generating truth tables. This tool allows you to validate the equality of logical expressions efficiently and effectively.\n\n## 🚀 Features\n\n- **Functions comparison** – determine if two boolean functions produce the same outputs for all possible inputs.\n- **Truth table generation** – create detailed truth tables for any variadic boolean function.\n- **Detailed mismatch reporting** – provides specific input combinations where functions differ.\n\n## 🛠️ Installation\n\n```bash\nnpm install logiqual\n```\n\n## 📖 Usage\n\n### Comparing Functions\n\n```javascript\nimport { compareFunctions } from 'logiqual';\n\nconst result = compareFunctions(\n  (x, y) =\u003e x \u0026\u0026 y,\n  (x, y) =\u003e x || y\n);\n\nconsole.log(result.isEqual); // false\nconsole.log(result.differences); // Detailed differences\n```\n\n### Generating a Truth Table\n\n```javascript\nimport { generateTruthTable } from 'logiqual';\n\nconst table = generateTruthTable((a, b) =\u003e a \u0026\u0026 b);\nconsole.table(table);\n```\n\n### Command Line Interface (CLI)\nYou can also use it via the command line:\n\n```bash\nnpx logiqual '(x, y) =\u003e x \u0026\u0026 y' '(x, y) =\u003e x || y'\n# false\n# [\n#   [\n#     { x: false, y: true, result: false },\n#     { x: false, y: true, result: true }\n#   ],\n#   [\n#     { x: true, y: false, result: false },\n#     { x: true, y: false, result: true }\n#   ]\n# ]\n```\n\n## 🔧 API\n\n### `compareFunctions(funcA: VariadicFunction, funcB: VariadicFunction): { isEqual: boolean; differences: Difference[] }`\n\nCompares two boolean functions for equality based on their outputs for all possible input combinations.\n\n- `funcA` (VariadicFunction): The first function to compare.\n- `funcB` (VariadicFunction): The second function to compare.\n- **Returns**: An object with:\n  - `isEqual` (boolean): Whether the functions are equal.\n  - `differences` (Difference[]): An array of mismatches found.\n\n### `generateTruthTable(func: VariadicFunction): TruthTableEntry[]`\n\nGenerates a truth table for a given variadic boolean function.\n\n- `func` (VariadicFunction): The function to generate the truth table for.\n- **Returns**: An array of objects representing the truth table.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamdz%2Flogiqual","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkamdz%2Flogiqual","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamdz%2Flogiqual/lists"}