{"id":37069743,"url":"https://github.com/vaibhavkarve/normal-form","last_synced_at":"2026-01-14T08:01:46.259Z","repository":{"id":58680155,"uuid":"529635200","full_name":"vaibhavkarve/normal-form","owner":"vaibhavkarve","description":"A Python package for working with Conjunctive Normal Form (CNFs) and Boolean Satisfiability (SAT)","archived":false,"fork":false,"pushed_at":"2024-09-30T00:11:54.000Z","size":1298,"stargazers_count":3,"open_issues_count":13,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-25T00:36:54.786Z","etag":null,"topics":["clause","cnf","logic","python3","sat","sat-solver"],"latest_commit_sha":null,"homepage":"https://vaibhavkarve.github.io/normal-form/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vaibhavkarve.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2022-08-27T16:15:16.000Z","updated_at":"2025-04-11T14:31:46.000Z","dependencies_parsed_at":"2024-07-06T22:37:55.954Z","dependency_job_id":null,"html_url":"https://github.com/vaibhavkarve/normal-form","commit_stats":{"total_commits":65,"total_committers":1,"mean_commits":65.0,"dds":0.0,"last_synced_commit":"4819a3f0210bb2c5e9004c0ed9ff521abef0f982"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/vaibhavkarve/normal-form","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaibhavkarve%2Fnormal-form","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaibhavkarve%2Fnormal-form/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaibhavkarve%2Fnormal-form/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaibhavkarve%2Fnormal-form/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vaibhavkarve","download_url":"https://codeload.github.com/vaibhavkarve/normal-form/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaibhavkarve%2Fnormal-form/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28413527,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["clause","cnf","logic","python3","sat","sat-solver"],"created_at":"2026-01-14T08:01:45.599Z","updated_at":"2026-01-14T08:01:46.247Z","avatar_url":"https://github.com/vaibhavkarve.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"**A Python package for working with Conjunctive Normal Form (CNFs) and Boolean Satisfiability (SAT)**\n\n\u003ca href=\"https://img.shields.io/github/license/vaibhavkarve/normal-form?style=flat-square\"\u003e \u003cimg src=\"https://img.shields.io/github/license/vaibhavkarve/normal-form?style=flat-square\" alt=\"License\"\u003e \u003c/a\u003e\n\u003ca href=\"https://img.shields.io/badge/Python-v3.10-blue?style=flat-square\"\u003e \u003cimg src=\"https://img.shields.io/badge/Python-v3.10-blue?style=flat-square\" alt=\"Python:v3.10\"\u003e \u003c/a\u003e\n\nThis Python package is brought to you by [Vaibhav Karve](https://vaibhavkarve.github.io) and [Anil N. Hirani](https://faculty.math.illinois.edu/~hirani/), Department of Mathematics, University of Illinois at Urbana-Champaign.\n\n`normal-form` recognizes variables, literals, clauses, and CNFs. The package implements an interface to easily construct CNFs and SAT-check them via third-part libraries [MINISAT](http://minisat.se/) and [PySAT](https://pysathq.github.io/).\n\nThis package is written in Python v3.10, and is publicly available under the [GNU-GPL-v3.0 license](https://github.com/vaibhavkarve/normal-form/blob/main/LICENSE). It is set to be released on the [Python Packaging Index](https://pypi.org/) as an open-source scientific package written in the literate programming style. We specifically chose to write this package as a literate program, despite the verbosity of this style, with the goal to create reproducible computational research.\n\n\n# Installation and usage\n\nTo get started on using this package,\n\n1.  Istall Python 3.10 or higher.\n2.  `python3.10 -m pip install normal-form`\n3.  Use it in a python script (or interactive REPL) as \u0026#x2013;\n    \n    ```python\n    from normal_form import cnf\n    from normal_form import sat\n    \n    # This is the CNF (a ∨ b ∨ ¬c) ∧ (¬b ∨ c ∨ ¬d) ∧ (¬a ∨ d).\n    x1: cnf.Cnf = cnf.cnf([[1, 2, -3], [-2, 3, -4], [-1, 4]])\n    \n    sat_x1: bool = sat.cnf_bruteforce_satcheck(x1)\n    print(sat_x1)  # prints: True because x1 is satisfiable.\n    ```\n\n\n# Overview of modules\n\nThe package consists of the following modules.\n\n| **Modules that act on Cnfs**      |                                                                                     |\n| [`cnf.py`](cnf)                   | Constructors and functions for sentences in conjunctive normal form                 |\n| [`cnf_simplify.py`](cnf_simplify) | Functions for simplifying Cnfs, for example (a∨b∨c) ∧ (a∨b∨\u0026not; c) ⇝ (a ∨ b)       |\n| [`prop.py`](prop)                 | Functions for propositional calculus \u0026#x2013; conjunction, disjunction and negation |\n| **Modules concerning SAT**        |                                                                                     |\n| [`sat.py`](sat)                   | Functions for sat-checking Cnfs                                                     |\n| [`sxpr.py`](sxpr)                 | Functions for working with s-expressions                                            |\n| **Test suite**                    |                                                                                     |\n| `tests/*`                         | Unit- and property-based tests for each module                                      |\n\n\n# Algorithms\n\nCurrently, `normal-form` implements the following algorithms \u0026#x2013;\n\n-   For formulae in conjunctive normal forms (CNFs), it implements variables, literals, clauses, Boolean formulae, and truth-assignments. It includes an API for reading, parsing and defining new instances.\n\n-   For satisfiability of CNFs, it contains a bruteforce algorithm, an implementation that uses the open-source sat-solver [PySAT](https://pysathq.github.io/), and an implementation using the [MiniSAT](http://minisat.se/) solver.\n\n\n# Principles\n\n`normal-form` has been written in the functional-programming style with the following principles in mind \u0026#x2013;\n\n-   Avoid classes as much as possible. Prefer defining functions instead.\n\n-   Write small functions and then compose/map/filter them to create more complex functions.\n\n-   Use lazy evaluation strategy whenever possible (using the [itertools](https://docs.python.org/3/library/itertools.html) library).\n\n-   Add type hints wherever possible (checked using the [mypy](https://mypy.readthedocs.io/en/stable/) static type-checker).\n\n-   Add unit-tests for each function (checked using the [pytest](https://docs.pytest.org/en/latest/) framework). Further, add property-based testing wherever possible (using the [hypothesis](https://hypothesis.readthedocs.io) framework).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaibhavkarve%2Fnormal-form","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvaibhavkarve%2Fnormal-form","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaibhavkarve%2Fnormal-form/lists"}