Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

flamapy-sharpsat

flamapy-sharpsat is a flamapy plugin that adds scalable approximate model counting and almost-uniform sampling of feature-model configurations, on top of the CNF produced by the SAT metamodel.

It complements the existing backends:

  • The SAT (flamapy-sat) and Z3 backends count configurations by full enumeration, which does not scale; the BDD backend counts exactly but the diagram can blow up on large models.
  • flamapy-sharpsat uses ApproxMC for an (epsilon, delta) approximate count and UniGen for almost-uniform sampling — both hashing-based tools from the CryptoMiniSat family that scale to far larger models.

Installation

pip install flamapy-sharpsat

This pulls in pyunigen (which bundles ApproxMC), and the flamapy core/FM/SAT plugins.

Operations

Operation Class
Approximate number of configurations SharpSATConfigurationsNumber
Almost-uniform sampling SharpSATSampling

Usage

from flamapy.metamodels.fm_metamodel.transformations import UVLReader
from flamapy.metamodels.sharpsat_metamodel.transformations import FmToSharpSAT
from flamapy.metamodels.sharpsat_metamodel.operations import (
    SharpSATConfigurationsNumber,
    SharpSATSampling,
)

fm = UVLReader('model.uvl').transform()
model = FmToSharpSAT(fm).transform()

count = SharpSATConfigurationsNumber().execute(model).get_result()

sampler = SharpSATSampling()
sampler.set_sample_size(10)
sample = sampler.execute(model).get_sample()

Counting and sampling are projected onto the feature variables, so auxiliary variables (such as the ones introduced by the optional Tseytin CNF encoding, available through FmToSharpSAT(fm, cnf_method='tseytin')) never distort the results.

License

GPL-3.0-or-later.

Metadata

Release files for flamapy-sharpsat 2.9.0.dev1

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

Source distribution (sdist)

Source distribution for flamapy-sharpsat 2.9.0.dev1
File Size Uploaded Provenance Actions
flamapy_sharpsat-2.9.0.dev1.tar.gz 12.4 kB Without provenance Details for flamapy_sharpsat-2.9.0.dev1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for flamapy-sharpsat 2.9.0.dev1
File Interpreter ABI Platform Actions
flamapy_sharpsat-2.9.0.dev1-py3-none-any.whl Python 3 none any Details for flamapy_sharpsat-2.9.0.dev1-py3-none-any.whl

Total release size: 24.5 kB

Release files / flamapy_sharpsat-2.9.0.dev1.tar.gz

Download URL flamapy_sharpsat-2.9.0.dev1.tar.gz
Size 12.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3f51e9ec82f9a492a038b5a97f37d108df5b6154711262995eea83497ff43468
BLAKE2b-256 checksum
How to use checksums
9e223db1259c5f2e3c44d91ca13c8b68c16dc653c6b7900662d6e7ce2a6531f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.18

Release files / flamapy_sharpsat-2.9.0.dev1-py3-none-any.whl

Download URL flamapy_sharpsat-2.9.0.dev1-py3-none-any.whl
Size 12.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a39c728adfdfb4a56f42512b13d7d68b3ca68b6bff1642b69dc10c2acfc89e6e
BLAKE2b-256 checksum
How to use checksums
fee626ab3a3ff5ebda0f39b8c62328712c50471fcc17f85f2db43cc6e4ec9df5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.18

Security for flamapy-sharpsat 2.9.0.dev1

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