Skip to main content

vitri for Python

Python bindings for vitri, built with PyO3 and maturin. vitri preprocesses a DIMACS CNF, records how to lift a model count of the reduced formula back to the original, and builds a vtree for the reduced formula.

Use

import vitri

with open("formula.cnf", "rb") as stream:
    result = vitri.prepare(stream.read(), mode="mc", budget_ms=60_000)

result.status            # "built", "fully_resolved" or "refuted"
result.summary["lift"]   # how a count of the reduced formula becomes the input's
result.reduced_cnf       # the formula to compile, as DIMACS text
result.vtree             # the vtree over it in SDD format, or None unless built
result.write("bundle/")  # the files `vitri formula.cnf --out-dir bundle/` writes

help(vitri.prepare) covers the settings, the errors, calls from threads and budgets. The bundle reference describes the files. examples/ counts models with PySDD over the emitted vtree, and runs a call under a hard time limit.

Platforms

The Python workflow builds a wheel for CPython 3.10 and later on x86-64 Linux with glibc 2.34 or newer. It carries GMP 6.3.0 as shared libraries, with its licence texts; the GMP source is attached to each GitHub release. The wheel is not published to an index yet: install it from the workflow's artifact, or build from source. Anywhere else, build from source.

Building from source

The extension compiles the vitri sources in this repository, so it needs the toolchain and system packages listed in building.md, and maturin. PEP 639 resolves license-files against this directory and forbids .., so the notices are copied in first:

.github/scripts/collect-notices.sh bindings/python/notices
pip install maturin
maturin build --release --manifest-path bindings/python/Cargo.toml

maturin develop installs the extension into the active virtual environment for pytest bindings/python/tests. Give pytest --vitri-cli PATH to also compare the bundles with those of the vitri executable.

Metadata

Release files for pyvitri 0.3.0

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

Source distribution (sdist)

Source distribution for pyvitri 0.3.0
File Size Uploaded Provenance
pyvitri-0.3.0.tar.gz 3.0 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pyvitri 0.3.0
File Interpreter ABI Platform
pyvitri-0.3.0-cp310-abi3-manylinux_2_34_x86_64.whl CPython 3.10 abi3 Linux glibc 2.34+ x86-64 Details

Total release size: 6.8 MB

Release files / pyvitri-0.3.0.tar.gz

Download URL pyvitri-0.3.0.tar.gz
Size 3.0 MB
Tags Source
SHA-256 checksum
How to use checksums
f3290291d2a3e12255a3c5c3e5f3c26ceb88a43746409286506fb40c80bacdfa
BLAKE2b-256 checksum
How to use checksums
a24aabd399bc6f9a3165ecca4958bc574d8e3263c9b4fa462e767a6a1c4dfcb7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / pyvitri-0.3.0-cp310-abi3-manylinux_2_34_x86_64.whl

Download URL pyvitri-0.3.0-cp310-abi3-manylinux_2_34_x86_64.whl
Size 3.8 MB
Tags CPython 3.10 Linux glibc 2.34+ x86-64 abi3
SHA-256 checksum
How to use checksums
aaa18d2043ee416cb00aba2c310f7e627bf232a67c0276f985699aef3c20da5b
BLAKE2b-256 checksum
How to use checksums
1336db136f3890741be2e2aa2703382d9a90903e1b263389f5bb083c62f717ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for pyvitri 0.3.0

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.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files No provenance

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