flamapy-dnnf 2.6.0.dev12__py3-none-any.whl → 2.9.0.dev0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,35 @@
1
+ from flamapy.core.exceptions import FlamaException
2
+ from flamapy.core.manifest import PluginManifest, OperationCapability
3
+ from flamapy.core.models.language_level import LanguageLevel, MajorLevel, MinorLevel
4
+ from flamapy.metamodels.dnnf_metamodel.models.dnnf_model import locate_d4
5
+
6
+ # d-DNNF compilation scales further than BDDs for counting. The cost is a placeholder: the
7
+ # 2026-11-06 calibration machine had no d4, so this plugin is the one without measured curves.
8
+ # It declares no ``calibration``, so the planner only picks it when no calibrated plugin can
9
+ # run the operation.
10
+ # d4 is a native binary with no PyPI distribution (see models.locate_d4): without it the
11
+ # operations fail (the transformation, which only writes the DIMACS file, still runs), so the
12
+ # manifest declares the plugin unavailable and the planner never routes to it. The check runs
13
+ # once, when the plugin is imported: set FLAMAPY_D4_PATH before that.
14
+
15
+
16
+ def _d4_available() -> bool:
17
+ try:
18
+ locate_d4()
19
+ except FlamaException:
20
+ return False
21
+ return True
22
+
23
+
24
+ _D4_AVAILABLE = _d4_available()
25
+
26
+ MANIFEST = PluginManifest(
27
+ name='dnnf',
28
+ extension='dnnf',
29
+ available=_D4_AVAILABLE,
30
+ unavailable_reason='the d4 compiler is not installed (set FLAMAPY_D4_PATH or put d4 on PATH)',
31
+ supported_level=LanguageLevel(MajorLevel.BOOLEAN, {MinorLevel.GROUP_CARDINALITY}),
32
+ operations={
33
+ 'configurations_number': OperationCapability(cost=80),
34
+ },
35
+ )
@@ -14,9 +14,10 @@ def locate_d4() -> str:
14
14
  installed separately.
15
15
  """
16
16
  candidate = os.environ.get('FLAMAPY_D4_PATH') or shutil.which('d4')
17
- if not candidate or not os.path.exists(candidate):
17
+ if not candidate or not os.path.isfile(candidate) or not os.access(candidate, os.X_OK):
18
18
  raise FlamaException(
19
- 'The d4 compiler was not found. Install d4 (https://github.com/crillab/d4) and '
19
+ 'The d4 compiler was not found (or is not executable). Install d4 '
20
+ '(https://github.com/crillab/d4) and '
20
21
  'expose it as "d4" on PATH or via the FLAMAPY_D4_PATH environment variable.'
21
22
  )
22
23
  return candidate
@@ -3,7 +3,7 @@ import subprocess
3
3
  import tempfile
4
4
 
5
5
  from flamapy.core.transformations import ModelToModel
6
- from flamapy.metamodels.fm_metamodel.models import FeatureModel, ClauseSet
6
+ from flamapy.metamodels.fm_metamodel.models import ClauseSet, DEFAULT_CNF_METHOD, FeatureModel
7
7
  from flamapy.metamodels.dnnf_metamodel.models import DDNNFModel, locate_d4
8
8
 
9
9
 
@@ -26,7 +26,7 @@ class FmToDDNNF(ModelToModel):
26
26
  def __init__(
27
27
  self,
28
28
  source_model: FeatureModel,
29
- cnf_method: str = 'distributive',
29
+ cnf_method: str = DEFAULT_CNF_METHOD,
30
30
  compile: bool = False,
31
31
  ) -> None:
32
32
  self.source_model = source_model
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flamapy-dnnf
3
- Version: 2.6.0.dev12
3
+ Version: 2.9.0.dev0
4
4
  Summary: flamapy-dnnf is a plugin to flamapy providing exact analysis of feature models via d-DNNF knowledge compilation with the d4 compiler
5
5
  Author-email: Flamapy <flamapy@us.es>
6
6
  License-Expression: GPL-3.0-or-later
@@ -8,8 +8,8 @@ Project-URL: Homepage, https://github.com/flamapy/dnnf_metamodel
8
8
  Requires-Python: >=3.11
9
9
  Description-Content-Type: text/markdown
10
10
  License-File: LICENSE
11
- Requires-Dist: flamapy-fw~=2.6.0.dev12
12
- Requires-Dist: flamapy-fm~=2.6.0.dev12
11
+ Requires-Dist: flamapy-fw~=2.9.0.dev0
12
+ Requires-Dist: flamapy-fm~=2.9.0.dev0
13
13
  Provides-Extra: dev
14
14
  Requires-Dist: pytest; extra == "dev"
15
15
  Requires-Dist: pytest-mock; extra == "dev"
@@ -0,0 +1,15 @@
1
+ flamapy/metamodels/dnnf_metamodel/__init__.py,sha256=Iv11jf1HvnoRoxOYz5AjZ6P7_5qviw8gdFJwBz6bonc,1457
2
+ flamapy/metamodels/dnnf_metamodel/models/__init__.py,sha256=MsY_d8olfDnKbMIRffYoTcUugwpnepWGVVkPtvsuL3Q,86
3
+ flamapy/metamodels/dnnf_metamodel/models/dnnf_model.py,sha256=MKsfpopTM2M0oy_B3lf7YWC14g2L_C3Dnopl-jNs7qk,1919
4
+ flamapy/metamodels/dnnf_metamodel/operations/__init__.py,sha256=-rQUSdkgFB4EIY5DP9Hnx-6Hfoe1ShHD3PPDhunpBZE,186
5
+ flamapy/metamodels/dnnf_metamodel/operations/d4_runner.py,sha256=83O9PBjZAe-rAy_z_Xv2MyWX2FC5VqPo6gtyeuovHP8,830
6
+ flamapy/metamodels/dnnf_metamodel/operations/dnnf_configurations_number.py,sha256=r1CPoEw7BR9bMd-Uw8uhBtvYVEaU6iq0VZbX0heQKxc,1058
7
+ flamapy/metamodels/dnnf_metamodel/operations/dnnf_satisfiable.py,sha256=498psoZ_4o_pooZk5KcHESkAgANRIUtGfuaRPXu1tds,799
8
+ flamapy/metamodels/dnnf_metamodel/transformations/__init__.py,sha256=Q6WARzcEmkKdUzGPlx-aYVWBz9jon4zzx8OfAZ9tUZE,60
9
+ flamapy/metamodels/dnnf_metamodel/transformations/fm_to_dnnf.py,sha256=qvzK2Uy2xwspX8bYQ4NBWOknS9AwWCDOufZnGHf7MSw,2459
10
+ flamapy_dnnf-2.9.0.dev0.dist-info/licenses/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
11
+ flamapy_dnnf-2.9.0.dev0.dist-info/METADATA,sha256=AijUlpkp8GZ0LZeKRXQ214CY8ik4xhcBm87QdxlXL1Y,2392
12
+ flamapy_dnnf-2.9.0.dev0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
13
+ flamapy_dnnf-2.9.0.dev0.dist-info/entry_points.txt,sha256=uav9uzkEap7XNHkrhfQ8ccu0F2VeORmXKyfBWSqQTtA,59
14
+ flamapy_dnnf-2.9.0.dev0.dist-info/top_level.txt,sha256=2YBI9dg4GVk28AJuyNu6dldi5Riwt5SP0zpNe2lSU5M,8
15
+ flamapy_dnnf-2.9.0.dev0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (82.0.1)
2
+ Generator: setuptools (84.2.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -0,0 +1,2 @@
1
+ [flamapy.plugins]
2
+ dnnf = flamapy.metamodels.dnnf_metamodel
@@ -1,14 +0,0 @@
1
- flamapy/metamodels/dnnf_metamodel/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- flamapy/metamodels/dnnf_metamodel/models/__init__.py,sha256=MsY_d8olfDnKbMIRffYoTcUugwpnepWGVVkPtvsuL3Q,86
3
- flamapy/metamodels/dnnf_metamodel/models/dnnf_model.py,sha256=vueXAkWwV5wK7GnUHSmsrAAXQJgMnn5_pclbYw7sFgk,1844
4
- flamapy/metamodels/dnnf_metamodel/operations/__init__.py,sha256=-rQUSdkgFB4EIY5DP9Hnx-6Hfoe1ShHD3PPDhunpBZE,186
5
- flamapy/metamodels/dnnf_metamodel/operations/d4_runner.py,sha256=83O9PBjZAe-rAy_z_Xv2MyWX2FC5VqPo6gtyeuovHP8,830
6
- flamapy/metamodels/dnnf_metamodel/operations/dnnf_configurations_number.py,sha256=r1CPoEw7BR9bMd-Uw8uhBtvYVEaU6iq0VZbX0heQKxc,1058
7
- flamapy/metamodels/dnnf_metamodel/operations/dnnf_satisfiable.py,sha256=498psoZ_4o_pooZk5KcHESkAgANRIUtGfuaRPXu1tds,799
8
- flamapy/metamodels/dnnf_metamodel/transformations/__init__.py,sha256=Q6WARzcEmkKdUzGPlx-aYVWBz9jon4zzx8OfAZ9tUZE,60
9
- flamapy/metamodels/dnnf_metamodel/transformations/fm_to_dnnf.py,sha256=2P9xm5LwqNAMj4l_Cj7qPRgJzdtkpJ8IxsKCoYBr9XI,2435
10
- flamapy_dnnf-2.6.0.dev12.dist-info/licenses/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
11
- flamapy_dnnf-2.6.0.dev12.dist-info/METADATA,sha256=zzRpM-K4sGPDm_sMEXvnapUvkKgKvkh0MYYye2UjyD8,2395
12
- flamapy_dnnf-2.6.0.dev12.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
13
- flamapy_dnnf-2.6.0.dev12.dist-info/top_level.txt,sha256=2YBI9dg4GVk28AJuyNu6dldi5Riwt5SP0zpNe2lSU5M,8
14
- flamapy_dnnf-2.6.0.dev12.dist-info/RECORD,,