This release is a pre-release and may not be stable for production use.
coom-clingo
The reference solver of the COOM product configuration language, built on clingo.
from coom.clingo.solver import ClingoSolver
from coom.compiler import compile_files
model = compile_files(["Bike.model"]).model
configuration = ClingoSolver(model).solve()
The solver works on the model of coom-core. Reading models from COOM source text needs coom-lang as well, which
coom-api installs together with this package. Sources live in the
coom-lang repository under packages/coom-clingo.
Purpose
This solver is a semantic reference. It exists to show what the language means and to decide conformance questions, so it favours a readable encoding and exact arithmetic over speed. It is not optimized for performance and not meant for productive use. Every operation grounds the whole model again, all potential instances are unrolled up front, and numbers are computed in Python on every candidate the search proposes. Models with many instances or deep cardinality nesting will be slow.
Operations
| method | result |
|---|---|
solve |
one completion of the inputs with defaults applied, or None if there is none |
satisfiable |
whether the inputs have a completion, ignoring defaults |
enumerate |
all completions of the inputs, ignoring defaults |
feasible |
the options or truth values some completion holds in a slot |
In a solved configuration, values held in every completion of the inputs take the role consequence unless they are
selected. coom.clingo.testrun runs the test blocks of a model against these operations.
Limitations
The solver aims to implement the language specification faithfully, but it does not cover all of it yet. The points below are known gaps, and anything not listed that disagrees with the specification is a bug.
Rejected with a diagnostic
- Unbounded cardinalities (
*). - Implications and defaults that assign instances, and discrete ones whose value is not an option, a truth value or a path.
- Writing numeric or text slots addressed from the end (
last).
Ignored with a warning
minimizeandmaximize.
Not supported by the operations or the test runner
- Optimization and explanations of conflicts.
- Tests of structures other than the product.
Semantic differences to the language specification
- Defaults are applied greedily. A domain heuristic decides higher priorities first and the first model found is returned. The specification asks for a maximal application of defaults under their priorities, which this approximates but does not guarantee. The result can depend on the search order, and equal priority defaults with different values are not reported as a tie. Applying a default may also force its condition to hold.
- A numeric value is only ever produced by an input, an implication, an applied default or an equality in a
requirement with a bare path on one side. The solver never searches for numbers, so a requirement such as
x * x = 4leavesxopen. - Only
solveapplies defaults. If a slot can only get its value from a default,solvemay find a configuration wheresatisfiable,enumerateandfeasiblefind none. - Where several statements write one numeric slot, the one whose value counts at the most digits gives the value. The others only have to agree with it at the lowest precision of both sides, as an input does.
- A computed number or text is a consequence only if some producer of it writes it in every completion from values that are the same in every completion. Different producers that compute the same value in different completions do not make it a consequence.
Open points
- The exact meaning of maximal default application, in particular whether a default may force its own condition. Defaults stay greedy until this is defined.
- Whether a condition may hold through the absence of a value it produces. The solver says no, so with
condition z || !z imply y = 3andimply z = ythere is no configuration. - Unbounded cardinalities through incremental grounding.
- Optimization statements and explanations.
Metadata
Release files for coom-clingo 0.0.1a1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| coom_clingo-0.0.1a1.tar.gz | 28.3 kB | Without provenance | Details for coom_clingo-0.0.1a1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| coom_clingo-0.0.1a1-py3-none-any.whl | Python 3 | none | any | Details for coom_clingo-0.0.1a1-py3-none-any.whl |
Total release size: 61.6 kB
Release files / coom_clingo-0.0.1a1.tar.gz
| Download URL | coom_clingo-0.0.1a1.tar.gz |
|---|---|
| Size | 28.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b8f0d2e13349210da665cdb9065ae8ae5d8f919aca53e3e0c7ed5b0d0a982b1b
|
|
BLAKE2b-256 checksum How to use checksums |
d0bc064aaeb9183883d0be69e9e4df768f7d9d31ee650becc0e986e650402680
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / coom_clingo-0.0.1a1-py3-none-any.whl
| Download URL | coom_clingo-0.0.1a1-py3-none-any.whl |
|---|---|
| Size | 33.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c236e2db848f4a9bb6fa4b11a30019efa33701824f282bdd2ea200edecabeccf
|
|
BLAKE2b-256 checksum How to use checksums |
5c9153e863e2d88c199e2d0eeb13e4d5a45ef8d26223a4d62a2865cfcb3816df
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for coom-clingo 0.0.1a1
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.