A collection of tools for working with and generating Dimacs CNF files.
Project description
A collection of tools for working with and generating Dimacs CNF files.
Installation
pip install cnftools
cnftools is listed in PyPI and can be installed with pip.
Usage
cnftools exposes the cnf command-line interface for quickly generating Dimacs CNF files typically for use with a SAT solver.
3cnf
Apply the Tseytin transformation [TSEY1970] to a CNF file producing an output where all clauses contain 3 or fewer literals.
cnf 3cnf -i [input.cnf]
simplify
Simply the input CNF file.
cnf simplify -i [input.cnf] -o [output.cnf]
stats
Provide details about contents of a CNF file. This includes the number of literals, the total number of clauses, as well as a histogram of clause lengths.
cnf stats -i [input.cnf]
karps21
This sub-command exposes utilities for generating CNF files based on Karp’s 21 NP-Complete problems [KARP1972]. For more details on this utility use the -h/--help option.
cnf karps21 --help
References
Tseitin, Grigori. “On the complexity of derivation in propositional calculus.” Studies in constructive mathematics and mathematical logic (1968): 115-125.
Cook, Stephen A. “The complexity of theorem-proving procedures.” Proceedings of the third annual ACM symposium on Theory of computing. ACM, 1971.
Karp, Richard M. “Reducibility among combinatorial problems.” Complexity of computer computations. Springer, Boston, MA, 1972. 85-103.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cnftools-0.0.2.tar.gz
.
File metadata
- Download URL: cnftools-0.0.2.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c67561ad035b45ae5bbe5cd435c476a2714a0ac4c3f4827b9886415ebb370e9d |
|
MD5 | 43f81d5f0aefa8360915829333caa69a |
|
BLAKE2b-256 | a631d7841440aaeb983b1244ce6fb81f7d7bf47ba700082a3c678d4bed867712 |
Provenance
File details
Details for the file cnftools-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: cnftools-0.0.2-py3-none-any.whl
- Upload date:
- Size: 14.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c63156d035f4ac1d051067ee61d52b9e80fcadee638c8f34a3df4ea9517b5281 |
|
MD5 | a2d22292bc9cf22dc44e9d3f5e3d812e |
|
BLAKE2b-256 | 5fbf59afe6f1697f01edd7354141f2433b09d18e95ae2a0b1613a5eaff90f361 |