Skip to main content

pycmsgen uniform-like sampler

This directory provides Python bindings to the CMSGen unform-like sampler,

Installing

pip install pycmsgen

Compiling

If you don't want to use the pip package, you can compile it as:

apt-get install python-dev
python -m build

Usage

The pycmsgen module has one object, Solver that has three main functions solve, add_clause, and get_model.

The function add_clause() takes an iterable list of literals such as [1, 2] which represents the truth 1 or 2 = True. For example, add_clause([1]) sets variable 1 to True.

The function solve() solves the system of equations that have been added with add_clause():

>>> from pycmsgen import Solver
>>> s = Solver()
>>> s.add_clause([1, 2])
>>> sat = s.solve()
True
>>> print(s.get_model())
[1, 2]

The solve() method optionally takes an argument assumptions that allows the user to set values to specific variables in the solver in a temporary fashion. This means that in case the problem is satisfiable but e.g it's unsatisfiable if variable 2 is FALSE, then solve([-2]) will return UNSAT. However, a subsequent call to solve() will still return a solution. If instead of an assumption add_clause() would have been used, subsequent solve() calls would have returned unsatisfiable.

Solver takes the following keyword arguments:

  • time_limit: the time limit (integer)
  • confl_limit: the propagation limit (integer)
  • verbose: the verbosity level (integer)

Both time_limit and confl_limit set a budget to the solver. The former is based on time elapsed while the former is based on number of conflicts met during search. If the solver runs out of budget, it returns with (None, None). If both limits are used, the solver will terminate whenever one of the limits are hit (whichever first). Warning: Results from time_limit may differ from run to run, depending on compute load, etc. Use confl_limit for more reproducible runs.

Metadata

Release files for pycmsgen 6.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pycmsgen 6.1.1
File Size Uploaded Provenance Actions
pycmsgen-6.1.1.tar.gz 247.3 kB Without provenance Details for pycmsgen-6.1.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for pycmsgen 6.1.1
File Actions
pycmsgen-6.1.1-pp310-pypy310_pp73-win_amd64.whl PyPy 3.10 PyPy 3.10 7.3 Windows x86-64 Details for pycmsgen-6.1.1-pp310-pypy310_pp73-win_amd64.whl
pycmsgen-6.1.1-pp39-pypy39_pp73-win_amd64.whl PyPy 3.9 PyPy 3.9 7.3 Windows x86-64 Details for pycmsgen-6.1.1-pp39-pypy39_pp73-win_amd64.whl
pycmsgen-6.1.1-pp38-pypy38_pp73-win_amd64.whl PyPy 3.8 PyPy 3.8 7.3 Windows x86-64 Details for pycmsgen-6.1.1-pp38-pypy38_pp73-win_amd64.whl
pycmsgen-6.1.1-pp37-pypy37_pp73-win_amd64.whl PyPy 3.7 PyPy 3.7 7.3 Windows x86-64 Details for pycmsgen-6.1.1-pp37-pypy37_pp73-win_amd64.whl
pycmsgen-6.1.1-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for pycmsgen-6.1.1-cp313-cp313-win_amd64.whl
pycmsgen-6.1.1-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for pycmsgen-6.1.1-cp312-cp312-win_amd64.whl
pycmsgen-6.1.1-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for pycmsgen-6.1.1-cp311-cp311-win_amd64.whl
pycmsgen-6.1.1-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for pycmsgen-6.1.1-cp310-cp310-win_amd64.whl
pycmsgen-6.1.1-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details for pycmsgen-6.1.1-cp39-cp39-win_amd64.whl
pycmsgen-6.1.1-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details for pycmsgen-6.1.1-cp38-cp38-win_amd64.whl
pycmsgen-6.1.1-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details for pycmsgen-6.1.1-cp37-cp37m-win_amd64.whl

Total release size: 3.1 MB

Release files / pycmsgen-6.1.1.tar.gz

Download URL pycmsgen-6.1.1.tar.gz
Size 247.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b1625d20d29d43cbe562b72c1656a6156ec59648a962005f761833a6e4833537
BLAKE2b-256 checksum
How to use checksums
946504400fa5e4dc87a5548b98ba4e056aa24b13bbcaf7a07d95ce0a096b2618
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / pycmsgen-6.1.1-pp310-pypy310_pp73-win_amd64.whl

Download URL pycmsgen-6.1.1-pp310-pypy310_pp73-win_amd64.whl
Size 262.6 kB
Tags PyPy 3.10 PyPy 3.10 7.3 Windows x86-64
SHA-256 checksum
How to use checksums
2293a85cc717350d806084e301e206e524524ed899e159d19bcbb90ac88b0f56
BLAKE2b-256 checksum
How to use checksums
0bcb342c30d02ab56b05eea39414810dddc9304edda3540bde582883d20d8367
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / pycmsgen-6.1.1-pp39-pypy39_pp73-win_amd64.whl

Download URL pycmsgen-6.1.1-pp39-pypy39_pp73-win_amd64.whl
Size 262.6 kB
Tags PyPy 3.9 PyPy 3.9 7.3 Windows x86-64
SHA-256 checksum
How to use checksums
7d29b0fe065af0d22f514b120f10b83ad6fb8dcb262da229b1f76ed5a8b3a034
BLAKE2b-256 checksum
How to use checksums
47a654660c698d12b78b404ae7c22060d04a372cb278e81579f36211a9e177df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / pycmsgen-6.1.1-pp38-pypy38_pp73-win_amd64.whl

Download URL pycmsgen-6.1.1-pp38-pypy38_pp73-win_amd64.whl
Size 262.7 kB
Tags PyPy 3.8 PyPy 3.8 7.3 Windows x86-64
SHA-256 checksum
How to use checksums
98f2108aaff02d2514e393cb749b46f9b5ea998fa136dfc2f1d90b9f65d83b11
BLAKE2b-256 checksum
How to use checksums
3a9dcda8b897c4e57f1369e46ea5b4ac921c8a8234688e3142b245028a29eaf7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / pycmsgen-6.1.1-pp37-pypy37_pp73-win_amd64.whl

Download URL pycmsgen-6.1.1-pp37-pypy37_pp73-win_amd64.whl
Size 262.7 kB
Tags PyPy 3.7 PyPy 3.7 7.3 Windows x86-64
SHA-256 checksum
How to use checksums
3cc0805ba38177bfed6e7d300128a946daa4b7bd215e52e1c16ad43627fa90ae
BLAKE2b-256 checksum
How to use checksums
ceb912ea242a9e3087aee559ddef990b8f12e0c41f25a1087e17c9c04238b3f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / pycmsgen-6.1.1-cp313-cp313-win_amd64.whl

Download URL pycmsgen-6.1.1-cp313-cp313-win_amd64.whl
Size 258.1 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
1203bb6ee7c80b2a7e9ad5ce66ffc50ca3d760118d08116ec36df803ca3241b4
BLAKE2b-256 checksum
How to use checksums
f3b0863c320184e7c44da34e7c7b307c618ac098cd6dbea8052e027173206b40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / pycmsgen-6.1.1-cp312-cp312-win_amd64.whl

Download URL pycmsgen-6.1.1-cp312-cp312-win_amd64.whl
Size 262.3 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
ce29ccdc1469c219d1e9b100ff1e62523e1b440f0b1e1791d867d07c0dbb42fd
BLAKE2b-256 checksum
How to use checksums
e0b9b5dc064ac9934d7744db4e6bcbb3d76aee05be7139bd036959c77da052a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / pycmsgen-6.1.1-cp311-cp311-win_amd64.whl

Download URL pycmsgen-6.1.1-cp311-cp311-win_amd64.whl
Size 262.2 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
7c81316c4fefb3bf4bf70802411b35926f5a4ddca29a45d6991d810862e61367
BLAKE2b-256 checksum
How to use checksums
681a252e2f97101f72dfac3b8da2ac86d9f9c7592c216f691ffd466481e3037c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / pycmsgen-6.1.1-cp310-cp310-win_amd64.whl

Download URL pycmsgen-6.1.1-cp310-cp310-win_amd64.whl
Size 262.1 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
edc291d6c2dcbdbe1a4316647dba1ac6344758219be3c2dd257510e9f443a46d
BLAKE2b-256 checksum
How to use checksums
0b65cde3be2dc134e996150b924ef2cfddd0c36379c2bbacf09e19cb76060219
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / pycmsgen-6.1.1-cp39-cp39-win_amd64.whl

Download URL pycmsgen-6.1.1-cp39-cp39-win_amd64.whl
Size 262.1 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
43710bf5a608dda165776b21d4a30bed54bf2ab19ee9af7c5dcb87726971db73
BLAKE2b-256 checksum
How to use checksums
14c7fd5acc67263fc9689c9bf83a4721684976bc90789dd72230dafc2bf4180b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / pycmsgen-6.1.1-cp38-cp38-win_amd64.whl

Download URL pycmsgen-6.1.1-cp38-cp38-win_amd64.whl
Size 262.0 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
3eab03ca87b7f9bf048a9e7e6ad172e8946fa079afc75a40f1308eb21a0e502a
BLAKE2b-256 checksum
How to use checksums
1794f6f0aebe8034ef394db42101e3b1bda00eedbcb67f9dcc42d9b5beb120fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / pycmsgen-6.1.1-cp37-cp37m-win_amd64.whl

Download URL pycmsgen-6.1.1-cp37-cp37m-win_amd64.whl
Size 259.9 kB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
c139b4d8ea1a1bf34982b84ecea4513e1d46d5a1eb97dec42678613a56683770
BLAKE2b-256 checksum
How to use checksums
c481b477316fe14097bebac4aec10bf42cf8a20a12a1872f58d09322c24535ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Security for pycmsgen 6.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page