PySDD 0.2.11__tar.gz → 1.0.0__tar.gz

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.
Files changed (125) hide show
  1. {PySDD-0.2.11 → pysdd-1.0.0}/PKG-INFO +44 -50
  2. {PySDD-0.2.11 → pysdd-1.0.0}/PySDD.egg-info/PKG-INFO +44 -50
  3. {PySDD-0.2.11 → pysdd-1.0.0}/PySDD.egg-info/SOURCES.txt +7 -37
  4. pysdd-1.0.0/PySDD.egg-info/requires.txt +5 -0
  5. {PySDD-0.2.11 → pysdd-1.0.0}/README.rst +18 -39
  6. pysdd-1.0.0/pyproject.toml +120 -0
  7. pysdd-1.0.0/pysdd/__init__.py +1 -0
  8. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/basic/hash.c +14 -0
  9. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/basic/memory.c +3 -2
  10. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/manager/interface.c +5 -4
  11. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/sdds/exists_multiple.c +2 -1
  12. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/sdds/io.c +2 -1
  13. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/util.c +3 -2
  14. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/version.c +1 -1
  15. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/vtrees/compare.c +9 -0
  16. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/vtrees/static.c +2 -1
  17. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/sdd-2.0/src/fnf/compiler.c +4 -3
  18. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/sdd-2.0/src/fnf/fnf.c +1 -0
  19. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/sdd-2.0/src/fnf/io.c +3 -2
  20. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/sdd-2.0/src/fnf/utils.c +3 -1
  21. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/sdd.pyx +25 -131
  22. {PySDD-0.2.11 → pysdd-1.0.0}/setup.cfg +0 -3
  23. pysdd-1.0.0/tests/test_iterator.py +156 -0
  24. pysdd-1.0.0/tests/test_minimize.py +85 -0
  25. pysdd-1.0.0/tests/test_nnf.py +94 -0
  26. pysdd-1.0.0/tests/test_psdd.py +28 -0
  27. pysdd-1.0.0/tests/test_util.py +48 -0
  28. pysdd-1.0.0/tests/test_vtree.py +31 -0
  29. pysdd-1.0.0/tests/test_wmcstochastic.py +75 -0
  30. PySDD-0.2.11/MANIFEST.in +0 -2
  31. PySDD-0.2.11/PySDD.egg-info/not-zip-safe +0 -1
  32. PySDD-0.2.11/PySDD.egg-info/requires.txt +0 -9
  33. PySDD-0.2.11/pyproject.toml +0 -4
  34. PySDD-0.2.11/pysdd/__init__.py +0 -1
  35. PySDD-0.2.11/pysdd/compiler_c.pxd +0 -37
  36. PySDD-0.2.11/pysdd/fnf_c.pxd +0 -17
  37. PySDD-0.2.11/pysdd/io_c.pxd +0 -22
  38. PySDD-0.2.11/pysdd/lib/libsdd-2.0/include/iterators.h +0 -243
  39. PySDD-0.2.11/pysdd/lib/libsdd-2.0/include/macros.h +0 -272
  40. PySDD-0.2.11/pysdd/lib/libsdd-2.0/include/parameters.h +0 -71
  41. PySDD-0.2.11/pysdd/lib/libsdd-2.0/include/sdd.h +0 -814
  42. PySDD-0.2.11/pysdd/lib/libsdd-2.0/include/stacks.h +0 -86
  43. PySDD-0.2.11/pysdd/lib/libsdd-2.0/sddapi.h +0 -247
  44. PySDD-0.2.11/pysdd/lib/libsdd-2.0/src/fnf/io.c +0 -125
  45. PySDD-0.2.11/pysdd/lib/libsdd-2.0/src/vtree_operations/vtree_ops.h +0 -48
  46. PySDD-0.2.11/pysdd/lib/sdd-2.0/include/compiler.h +0 -103
  47. PySDD-0.2.11/pysdd/lib/sdd-2.0/include/fnf.h +0 -13
  48. PySDD-0.2.11/pysdd/lib/sdd-2.0/include/io.h +0 -11
  49. PySDD-0.2.11/pysdd/lib/sdd-2.0/include/sddapi.h +0 -340
  50. PySDD-0.2.11/pysdd/lib/sdd-2.0/lib/Darwin/libsdd.a +0 -0
  51. PySDD-0.2.11/pysdd/lib/sdd-2.0/lib/Darwin-arm/libsdd.a +0 -0
  52. PySDD-0.2.11/pysdd/lib/sdd-2.0/lib/Linux/libsdd.a +0 -0
  53. PySDD-0.2.11/pysdd/lib/sdd-2.0/lib/Linux/libsdd.so +0 -0
  54. PySDD-0.2.11/pysdd/lib/sdd-2.0/lib/Windows/sdd.dll +0 -0
  55. PySDD-0.2.11/pysdd/lib/sdd-2.0/lib/Windows/sdd.lib +0 -0
  56. PySDD-0.2.11/pysdd/lib/sdd-2.0/src/getopt.c +0 -146
  57. PySDD-0.2.11/pysdd/lib/sdd-2.0/src/main.c +0 -159
  58. PySDD-0.2.11/pysdd/lib/sdd_extra/include/sddapi_extra.h +0 -22
  59. PySDD-0.2.11/pysdd/lib/weight_optimization/include/arithmetic_ansi.h +0 -133
  60. PySDD-0.2.11/pysdd/lib/weight_optimization/include/lbfgs.h +0 -736
  61. PySDD-0.2.11/pysdd/lib/weight_optimization/include/weight_optimizer.h +0 -114
  62. PySDD-0.2.11/pysdd/lib/weight_optimization/src/lbfgs.c +0 -1360
  63. PySDD-0.2.11/pysdd/lib/weight_optimization/src/weight_optimizer.c +0 -257
  64. PySDD-0.2.11/pysdd/sdd.c +0 -61929
  65. PySDD-0.2.11/pysdd/sdd.dll +0 -0
  66. PySDD-0.2.11/pysdd/sddapi_c.pxd +0 -240
  67. PySDD-0.2.11/pysdd/weight_optimization_c.pxd +0 -18
  68. PySDD-0.2.11/setup.py +0 -270
  69. {PySDD-0.2.11 → pysdd-1.0.0}/LICENSE +0 -0
  70. {PySDD-0.2.11 → pysdd-1.0.0}/PySDD.egg-info/dependency_links.txt +0 -0
  71. {PySDD-0.2.11 → pysdd-1.0.0}/PySDD.egg-info/entry_points.txt +0 -0
  72. {PySDD-0.2.11 → pysdd-1.0.0}/PySDD.egg-info/top_level.txt +0 -0
  73. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/__main__.py +0 -0
  74. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/cli.py +0 -0
  75. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/iterator.py +0 -0
  76. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/basic/computed.c +0 -0
  77. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/basic/count_and_size.c +0 -0
  78. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/basic/gc.c +0 -0
  79. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/basic/multiply.c +0 -0
  80. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/basic/nodes.c +0 -0
  81. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/basic/partitions.c +0 -0
  82. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/basic/references.c +0 -0
  83. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/basic/replace.c +0 -0
  84. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/basic/shadows.c +0 -0
  85. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/basic/sort.c +0 -0
  86. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/manager/copy.c +0 -0
  87. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/manager/manager.c +0 -0
  88. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/manager/stats.c +0 -0
  89. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/manager/variables.c +0 -0
  90. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/sdds/apply.c +0 -0
  91. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/sdds/bits.c +0 -0
  92. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/sdds/cardinality.c +0 -0
  93. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/sdds/condition.c +0 -0
  94. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/sdds/copy.c +0 -0
  95. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/sdds/count.c +0 -0
  96. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/sdds/essential_vars.c +0 -0
  97. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/sdds/exists.c +0 -0
  98. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/sdds/exists_multiple_static.c +0 -0
  99. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/sdds/forall.c +0 -0
  100. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/sdds/model_count.c +0 -0
  101. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/sdds/rename_vars.c +0 -0
  102. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/sdds/size.c +0 -0
  103. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/sdds/wmc.c +0 -0
  104. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/verify.c +0 -0
  105. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/vtree_fragments/construction.c +0 -0
  106. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/vtree_fragments/moves.c +0 -0
  107. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/vtree_fragments/operations.c +0 -0
  108. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/vtree_operations/cartesian_product.c +0 -0
  109. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/vtree_operations/dissect.c +0 -0
  110. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/vtree_operations/limits.c +0 -0
  111. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/vtree_operations/op_left_rotate.c +0 -0
  112. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/vtree_operations/op_right_rotate.c +0 -0
  113. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/vtree_operations/op_swap.c +0 -0
  114. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/vtree_operations/rollback.c +0 -0
  115. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/vtree_operations/split.c +0 -0
  116. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/vtree_search/auto.c +0 -0
  117. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/vtree_search/search.c +0 -0
  118. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/vtree_search/state.c +0 -0
  119. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/vtrees/edit.c +0 -0
  120. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/vtrees/io.c +0 -0
  121. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/vtrees/maps.c +0 -0
  122. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/vtrees/moves.c +0 -0
  123. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/lib/libsdd-2.0/src/vtrees/vtree.c +0 -0
  124. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/util.py +0 -0
  125. {PySDD-0.2.11 → pysdd-1.0.0}/pysdd/wmcstochastic.py +0 -0
@@ -1,48 +1,46 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PySDD
3
- Version: 0.2.11
3
+ Version: 1.0.0
4
4
  Summary: Sentential Decision Diagrams
5
- Home-page: https://github.com/wannesm/PySDD
6
- Author: Wannes Meert, Arthur Choi
7
- Author-email: wannes.meert@cs.kuleuven.be
8
- License: Apache 2.0
9
- Project-URL: PySDD documentation, http://pysdd.readthedocs.io/en/latest/
10
- Project-URL: PySDD source, https://github.com/wannesm/PySDD
11
- Keywords: sdd,knowledge compilation
5
+ Author: Arthur Choi
6
+ Author-email: Wannes Meert <wannes.meert@cs.kuleuven.be>
7
+ License: Copyright 2018, KU Leuven and Regents of the University of California
8
+
9
+ Licensed under the Apache License, Version 2.0 (the "License");
10
+ you may not use this file except in compliance with the License.
11
+ You may obtain a copy of the License at
12
+
13
+ http://www.apache.org/licenses/LICENSE-2.0
14
+
15
+ Unless required by applicable law or agreed to in writing, software
16
+ distributed under the License is distributed on an "AS IS" BASIS,
17
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ See the License for the specific language governing permissions and
19
+ limitations under the License.
20
+
21
+ Project-URL: Homepage, https://github.com/wannesm/PySDD
22
+ Project-URL: Documentation, https://pysdd.readthedocs.io/en/latest/
23
+ Keywords: sdd, knowledge compilation
12
24
  Classifier: Intended Audience :: Developers
13
25
  Classifier: License :: OSI Approved :: Apache Software License
14
26
  Classifier: Programming Language :: Python :: 3
15
27
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
16
- Requires-Python: >=3.6
17
- Provides-Extra: all
18
- Provides-Extra: dev
28
+ Requires-Python: >=3.8
29
+ Description-Content-Type: text/x-rst
19
30
  License-File: LICENSE
31
+ Requires-Dist: cython
32
+ Requires-Dist: numpy
33
+ Provides-Extra: tests
34
+ Requires-Dist: pytest; extra == "tests"
20
35
 
21
36
  =====
22
37
  PySDD
23
38
  =====
24
39
 
25
- Python wrapper package to interactively use `Sententical Decision Diagrams (SDD) <http://reasoning.cs.ucla.edu/sdd/>`_.
40
+ Python wrapper package to interactively use `Sentential Decision Diagrams (SDD) <http://reasoning.cs.ucla.edu/sdd/>`_.
26
41
 
27
42
  Full documentation available on http://pysdd.readthedocs.io.
28
43
 
29
- ------------
30
- Dependencies
31
- ------------
32
-
33
- * Python >=3.6
34
- * Cython
35
-
36
- Optional:
37
-
38
- * cysignals
39
- * numpy
40
-
41
- Make sure to have the correct development tools installed:
42
-
43
- * C compiler (see `Installing Cython <https://cython.readthedocs.io/en/latest/src/quickstart/install.html>`_)
44
- * The Python development version that includes Python header files and static library (e.g. libpython3-dev, python-dev, ...)
45
-
46
44
  ------------
47
45
  Installation
48
46
  ------------
@@ -148,31 +146,27 @@ perform memory management.
148
146
  Compilation from source
149
147
  -----------------------
150
148
 
149
+ To install from source, make sure to have the correct development tools installed:
150
+
151
+ * C compiler (see `Installing Cython <https://cython.readthedocs.io/en/latest/src/quickstart/install.html>`_)
152
+ * The Python development version that includes Python header files and static library (e.g. libpython3-dev, python-dev, ...)
153
+
154
+ The build process will download Cython and numpy in an isolated environment.
155
+
156
+ Then run:
157
+
151
158
  .. code-block:: shell
152
159
 
153
- $ pip install git+https://github.com/wannesm/PySDD.git#egg=PySDD
160
+ $ pip install build
161
+ $ python -m build
154
162
 
155
- The repository should contain all the required files and libraries (unless
156
- you use Windows). If you want to compile from source, note that some c-source
157
- files from the SDD package have been updated to work with this wrapper and are
158
- included in this repository. Do not overwrite these new files with the original
159
- files.
160
163
 
161
- * Download the SDD package from http://reasoning.cs.ucla.edu/sdd/.
162
- * Install the SDD package in the PySDD package in directories
163
- ``pysdd/lib/sdd-2.0`` and ``pysdd/lib/sddlib-2.0`` without overwriting
164
- the already available files.
165
- * Run ``python3 setup.py build_ext --inplace`` or ``make build`` to compile the
166
- library in the current directory. If you want to install the library such
167
- that the library is available for your local installation or in your virtual
168
- environment, use ``python3 setup.py install``.
164
+ To install the main branch:
169
165
 
170
- For some Linux platforms, it might be necessary to recompile the libsdd-2.0 code with
171
- the gcc option ``-fPIC`` and replace the ``pysdd/lib/sdd-2.0/lib/Linux/libsdd.a``
172
- library with your newly compiled version.
166
+ .. code-block:: shell
167
+
168
+ $ pip install git+https://github.com/wannesm/PySDD.git#egg=PySDD
173
169
 
174
- The Windows platform is not supported. There is some initial support but we cannot
175
- offer guarantees or detailed instructions (but are happy to accept pull requests).
176
170
 
177
171
 
178
172
  ----------
@@ -184,7 +178,7 @@ programming language `ProbLog <https://dtai.cs.kuleuven.be/problog/>`_.
184
178
 
185
179
  References:
186
180
 
187
- * Wannes Meert, PySDD,
181
+ * Wannes Meert & Arthur Choi, PySDD,
188
182
  in `Recent Trends in Knowledge Compilation
189
183
  <http://drops.dagstuhl.de/opus/volltexte/2018/8589/pdf/dagrep_v007_i009_p062_17381.pdf>`_,
190
184
  Report from Dagstuhl Seminar 17381, Sep 2017.
@@ -210,7 +204,7 @@ License
210
204
 
211
205
  Python SDD wrapper:
212
206
 
213
- Copyright 2017-2018, KU Leuven and Regents of the University of California.
207
+ Copyright 2017-2024, KU Leuven and Regents of the University of California.
214
208
  Licensed under the Apache License, Version 2.0.
215
209
 
216
210
 
@@ -1,48 +1,46 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PySDD
3
- Version: 0.2.11
3
+ Version: 1.0.0
4
4
  Summary: Sentential Decision Diagrams
5
- Home-page: https://github.com/wannesm/PySDD
6
- Author: Wannes Meert, Arthur Choi
7
- Author-email: wannes.meert@cs.kuleuven.be
8
- License: Apache 2.0
9
- Project-URL: PySDD documentation, http://pysdd.readthedocs.io/en/latest/
10
- Project-URL: PySDD source, https://github.com/wannesm/PySDD
11
- Keywords: sdd,knowledge compilation
5
+ Author: Arthur Choi
6
+ Author-email: Wannes Meert <wannes.meert@cs.kuleuven.be>
7
+ License: Copyright 2018, KU Leuven and Regents of the University of California
8
+
9
+ Licensed under the Apache License, Version 2.0 (the "License");
10
+ you may not use this file except in compliance with the License.
11
+ You may obtain a copy of the License at
12
+
13
+ http://www.apache.org/licenses/LICENSE-2.0
14
+
15
+ Unless required by applicable law or agreed to in writing, software
16
+ distributed under the License is distributed on an "AS IS" BASIS,
17
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ See the License for the specific language governing permissions and
19
+ limitations under the License.
20
+
21
+ Project-URL: Homepage, https://github.com/wannesm/PySDD
22
+ Project-URL: Documentation, https://pysdd.readthedocs.io/en/latest/
23
+ Keywords: sdd, knowledge compilation
12
24
  Classifier: Intended Audience :: Developers
13
25
  Classifier: License :: OSI Approved :: Apache Software License
14
26
  Classifier: Programming Language :: Python :: 3
15
27
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
16
- Requires-Python: >=3.6
17
- Provides-Extra: all
18
- Provides-Extra: dev
28
+ Requires-Python: >=3.8
29
+ Description-Content-Type: text/x-rst
19
30
  License-File: LICENSE
31
+ Requires-Dist: cython
32
+ Requires-Dist: numpy
33
+ Provides-Extra: tests
34
+ Requires-Dist: pytest; extra == "tests"
20
35
 
21
36
  =====
22
37
  PySDD
23
38
  =====
24
39
 
25
- Python wrapper package to interactively use `Sententical Decision Diagrams (SDD) <http://reasoning.cs.ucla.edu/sdd/>`_.
40
+ Python wrapper package to interactively use `Sentential Decision Diagrams (SDD) <http://reasoning.cs.ucla.edu/sdd/>`_.
26
41
 
27
42
  Full documentation available on http://pysdd.readthedocs.io.
28
43
 
29
- ------------
30
- Dependencies
31
- ------------
32
-
33
- * Python >=3.6
34
- * Cython
35
-
36
- Optional:
37
-
38
- * cysignals
39
- * numpy
40
-
41
- Make sure to have the correct development tools installed:
42
-
43
- * C compiler (see `Installing Cython <https://cython.readthedocs.io/en/latest/src/quickstart/install.html>`_)
44
- * The Python development version that includes Python header files and static library (e.g. libpython3-dev, python-dev, ...)
45
-
46
44
  ------------
47
45
  Installation
48
46
  ------------
@@ -148,31 +146,27 @@ perform memory management.
148
146
  Compilation from source
149
147
  -----------------------
150
148
 
149
+ To install from source, make sure to have the correct development tools installed:
150
+
151
+ * C compiler (see `Installing Cython <https://cython.readthedocs.io/en/latest/src/quickstart/install.html>`_)
152
+ * The Python development version that includes Python header files and static library (e.g. libpython3-dev, python-dev, ...)
153
+
154
+ The build process will download Cython and numpy in an isolated environment.
155
+
156
+ Then run:
157
+
151
158
  .. code-block:: shell
152
159
 
153
- $ pip install git+https://github.com/wannesm/PySDD.git#egg=PySDD
160
+ $ pip install build
161
+ $ python -m build
154
162
 
155
- The repository should contain all the required files and libraries (unless
156
- you use Windows). If you want to compile from source, note that some c-source
157
- files from the SDD package have been updated to work with this wrapper and are
158
- included in this repository. Do not overwrite these new files with the original
159
- files.
160
163
 
161
- * Download the SDD package from http://reasoning.cs.ucla.edu/sdd/.
162
- * Install the SDD package in the PySDD package in directories
163
- ``pysdd/lib/sdd-2.0`` and ``pysdd/lib/sddlib-2.0`` without overwriting
164
- the already available files.
165
- * Run ``python3 setup.py build_ext --inplace`` or ``make build`` to compile the
166
- library in the current directory. If you want to install the library such
167
- that the library is available for your local installation or in your virtual
168
- environment, use ``python3 setup.py install``.
164
+ To install the main branch:
169
165
 
170
- For some Linux platforms, it might be necessary to recompile the libsdd-2.0 code with
171
- the gcc option ``-fPIC`` and replace the ``pysdd/lib/sdd-2.0/lib/Linux/libsdd.a``
172
- library with your newly compiled version.
166
+ .. code-block:: shell
167
+
168
+ $ pip install git+https://github.com/wannesm/PySDD.git#egg=PySDD
173
169
 
174
- The Windows platform is not supported. There is some initial support but we cannot
175
- offer guarantees or detailed instructions (but are happy to accept pull requests).
176
170
 
177
171
 
178
172
  ----------
@@ -184,7 +178,7 @@ programming language `ProbLog <https://dtai.cs.kuleuven.be/problog/>`_.
184
178
 
185
179
  References:
186
180
 
187
- * Wannes Meert, PySDD,
181
+ * Wannes Meert & Arthur Choi, PySDD,
188
182
  in `Recent Trends in Knowledge Compilation
189
183
  <http://drops.dagstuhl.de/opus/volltexte/2018/8589/pdf/dagrep_v007_i009_p062_17381.pdf>`_,
190
184
  Report from Dagstuhl Seminar 17381, Sep 2017.
@@ -210,7 +204,7 @@ License
210
204
 
211
205
  Python SDD wrapper:
212
206
 
213
- Copyright 2017-2018, KU Leuven and Regents of the University of California.
207
+ Copyright 2017-2024, KU Leuven and Regents of the University of California.
214
208
  Licensed under the Apache License, Version 2.0.
215
209
 
216
210
 
@@ -1,36 +1,19 @@
1
1
  LICENSE
2
- MANIFEST.in
3
2
  README.rst
4
3
  pyproject.toml
5
- setup.cfg
6
- setup.py
7
4
  PySDD.egg-info/PKG-INFO
8
5
  PySDD.egg-info/SOURCES.txt
9
6
  PySDD.egg-info/dependency_links.txt
10
7
  PySDD.egg-info/entry_points.txt
11
- PySDD.egg-info/not-zip-safe
12
8
  PySDD.egg-info/requires.txt
13
9
  PySDD.egg-info/top_level.txt
14
10
  pysdd/__init__.py
15
11
  pysdd/__main__.py
16
12
  pysdd/cli.py
17
- pysdd/compiler_c.pxd
18
- pysdd/fnf_c.pxd
19
- pysdd/io_c.pxd
20
13
  pysdd/iterator.py
21
- pysdd/sdd.c
22
- pysdd/sdd.dll
23
14
  pysdd/sdd.pyx
24
- pysdd/sddapi_c.pxd
25
15
  pysdd/util.py
26
- pysdd/weight_optimization_c.pxd
27
16
  pysdd/wmcstochastic.py
28
- pysdd/lib/libsdd-2.0/sddapi.h
29
- pysdd/lib/libsdd-2.0/include/iterators.h
30
- pysdd/lib/libsdd-2.0/include/macros.h
31
- pysdd/lib/libsdd-2.0/include/parameters.h
32
- pysdd/lib/libsdd-2.0/include/sdd.h
33
- pysdd/lib/libsdd-2.0/include/stacks.h
34
17
  pysdd/lib/libsdd-2.0/src/util.c
35
18
  pysdd/lib/libsdd-2.0/src/verify.c
36
19
  pysdd/lib/libsdd-2.0/src/version.c
@@ -46,7 +29,6 @@ pysdd/lib/libsdd-2.0/src/basic/references.c
46
29
  pysdd/lib/libsdd-2.0/src/basic/replace.c
47
30
  pysdd/lib/libsdd-2.0/src/basic/shadows.c
48
31
  pysdd/lib/libsdd-2.0/src/basic/sort.c
49
- pysdd/lib/libsdd-2.0/src/fnf/io.c
50
32
  pysdd/lib/libsdd-2.0/src/manager/copy.c
51
33
  pysdd/lib/libsdd-2.0/src/manager/interface.c
52
34
  pysdd/lib/libsdd-2.0/src/manager/manager.c
@@ -79,7 +61,6 @@ pysdd/lib/libsdd-2.0/src/vtree_operations/op_right_rotate.c
79
61
  pysdd/lib/libsdd-2.0/src/vtree_operations/op_swap.c
80
62
  pysdd/lib/libsdd-2.0/src/vtree_operations/rollback.c
81
63
  pysdd/lib/libsdd-2.0/src/vtree_operations/split.c
82
- pysdd/lib/libsdd-2.0/src/vtree_operations/vtree_ops.h
83
64
  pysdd/lib/libsdd-2.0/src/vtree_search/auto.c
84
65
  pysdd/lib/libsdd-2.0/src/vtree_search/search.c
85
66
  pysdd/lib/libsdd-2.0/src/vtree_search/state.c
@@ -90,25 +71,14 @@ pysdd/lib/libsdd-2.0/src/vtrees/maps.c
90
71
  pysdd/lib/libsdd-2.0/src/vtrees/moves.c
91
72
  pysdd/lib/libsdd-2.0/src/vtrees/static.c
92
73
  pysdd/lib/libsdd-2.0/src/vtrees/vtree.c
93
- pysdd/lib/sdd-2.0/include/compiler.h
94
- pysdd/lib/sdd-2.0/include/fnf.h
95
- pysdd/lib/sdd-2.0/include/io.h
96
- pysdd/lib/sdd-2.0/include/sddapi.h
97
- pysdd/lib/sdd-2.0/lib/Darwin/libsdd.a
98
- pysdd/lib/sdd-2.0/lib/Darwin-arm/libsdd.a
99
- pysdd/lib/sdd-2.0/lib/Linux/libsdd.a
100
- pysdd/lib/sdd-2.0/lib/Linux/libsdd.so
101
- pysdd/lib/sdd-2.0/lib/Windows/sdd.dll
102
- pysdd/lib/sdd-2.0/lib/Windows/sdd.lib
103
- pysdd/lib/sdd-2.0/src/getopt.c
104
- pysdd/lib/sdd-2.0/src/main.c
105
74
  pysdd/lib/sdd-2.0/src/fnf/compiler.c
106
75
  pysdd/lib/sdd-2.0/src/fnf/fnf.c
107
76
  pysdd/lib/sdd-2.0/src/fnf/io.c
108
77
  pysdd/lib/sdd-2.0/src/fnf/utils.c
109
- pysdd/lib/sdd_extra/include/sddapi_extra.h
110
- pysdd/lib/weight_optimization/include/arithmetic_ansi.h
111
- pysdd/lib/weight_optimization/include/lbfgs.h
112
- pysdd/lib/weight_optimization/include/weight_optimizer.h
113
- pysdd/lib/weight_optimization/src/lbfgs.c
114
- pysdd/lib/weight_optimization/src/weight_optimizer.c
78
+ tests/test_iterator.py
79
+ tests/test_minimize.py
80
+ tests/test_nnf.py
81
+ tests/test_psdd.py
82
+ tests/test_util.py
83
+ tests/test_vtree.py
84
+ tests/test_wmcstochastic.py
@@ -0,0 +1,5 @@
1
+ cython
2
+ numpy
3
+
4
+ [tests]
5
+ pytest
@@ -2,27 +2,10 @@
2
2
  PySDD
3
3
  =====
4
4
 
5
- Python wrapper package to interactively use `Sententical Decision Diagrams (SDD) <http://reasoning.cs.ucla.edu/sdd/>`_.
5
+ Python wrapper package to interactively use `Sentential Decision Diagrams (SDD) <http://reasoning.cs.ucla.edu/sdd/>`_.
6
6
 
7
7
  Full documentation available on http://pysdd.readthedocs.io.
8
8
 
9
- ------------
10
- Dependencies
11
- ------------
12
-
13
- * Python >=3.6
14
- * Cython
15
-
16
- Optional:
17
-
18
- * cysignals
19
- * numpy
20
-
21
- Make sure to have the correct development tools installed:
22
-
23
- * C compiler (see `Installing Cython <https://cython.readthedocs.io/en/latest/src/quickstart/install.html>`_)
24
- * The Python development version that includes Python header files and static library (e.g. libpython3-dev, python-dev, ...)
25
-
26
9
  ------------
27
10
  Installation
28
11
  ------------
@@ -128,31 +111,27 @@ perform memory management.
128
111
  Compilation from source
129
112
  -----------------------
130
113
 
114
+ To install from source, make sure to have the correct development tools installed:
115
+
116
+ * C compiler (see `Installing Cython <https://cython.readthedocs.io/en/latest/src/quickstart/install.html>`_)
117
+ * The Python development version that includes Python header files and static library (e.g. libpython3-dev, python-dev, ...)
118
+
119
+ The build process will download Cython and numpy in an isolated environment.
120
+
121
+ Then run:
122
+
131
123
  .. code-block:: shell
132
124
 
133
- $ pip install git+https://github.com/wannesm/PySDD.git#egg=PySDD
125
+ $ pip install build
126
+ $ python -m build
134
127
 
135
- The repository should contain all the required files and libraries (unless
136
- you use Windows). If you want to compile from source, note that some c-source
137
- files from the SDD package have been updated to work with this wrapper and are
138
- included in this repository. Do not overwrite these new files with the original
139
- files.
140
128
 
141
- * Download the SDD package from http://reasoning.cs.ucla.edu/sdd/.
142
- * Install the SDD package in the PySDD package in directories
143
- ``pysdd/lib/sdd-2.0`` and ``pysdd/lib/sddlib-2.0`` without overwriting
144
- the already available files.
145
- * Run ``python3 setup.py build_ext --inplace`` or ``make build`` to compile the
146
- library in the current directory. If you want to install the library such
147
- that the library is available for your local installation or in your virtual
148
- environment, use ``python3 setup.py install``.
129
+ To install the main branch:
149
130
 
150
- For some Linux platforms, it might be necessary to recompile the libsdd-2.0 code with
151
- the gcc option ``-fPIC`` and replace the ``pysdd/lib/sdd-2.0/lib/Linux/libsdd.a``
152
- library with your newly compiled version.
131
+ .. code-block:: shell
132
+
133
+ $ pip install git+https://github.com/wannesm/PySDD.git#egg=PySDD
153
134
 
154
- The Windows platform is not supported. There is some initial support but we cannot
155
- offer guarantees or detailed instructions (but are happy to accept pull requests).
156
135
 
157
136
 
158
137
  ----------
@@ -164,7 +143,7 @@ programming language `ProbLog <https://dtai.cs.kuleuven.be/problog/>`_.
164
143
 
165
144
  References:
166
145
 
167
- * Wannes Meert, PySDD,
146
+ * Wannes Meert & Arthur Choi, PySDD,
168
147
  in `Recent Trends in Knowledge Compilation
169
148
  <http://drops.dagstuhl.de/opus/volltexte/2018/8589/pdf/dagrep_v007_i009_p062_17381.pdf>`_,
170
149
  Report from Dagstuhl Seminar 17381, Sep 2017.
@@ -190,7 +169,7 @@ License
190
169
 
191
170
  Python SDD wrapper:
192
171
 
193
- Copyright 2017-2018, KU Leuven and Regents of the University of California.
172
+ Copyright 2017-2024, KU Leuven and Regents of the University of California.
194
173
  Licensed under the Apache License, Version 2.0.
195
174
 
196
175
 
@@ -0,0 +1,120 @@
1
+ [build-system]
2
+ requires = ["setuptools", "cython"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "PySDD"
7
+ version = "1.0.0"
8
+ description = "Sentential Decision Diagrams"
9
+ authors = [
10
+ { name = "Wannes Meert", email = "wannes.meert@cs.kuleuven.be" },
11
+ { name = "Arthur Choi" },
12
+ ]
13
+ readme = "README.rst"
14
+ license = { file = "LICENSE" }
15
+ requires-python = ">=3.8"
16
+ dependencies = [
17
+ "cython",
18
+ "numpy",
19
+ ]
20
+ keywords = ["sdd, knowledge compilation"]
21
+ classifiers = [
22
+ "Intended Audience :: Developers",
23
+ "License :: OSI Approved :: Apache Software License",
24
+ "Programming Language :: Python :: 3",
25
+ "Topic :: Scientific/Engineering :: Artificial Intelligence"
26
+ ]
27
+
28
+ [project.optional-dependencies]
29
+ tests = ["pytest"]
30
+
31
+
32
+
33
+ [project.urls]
34
+ Homepage = "https://github.com/wannesm/PySDD"
35
+ Documentation = "https://pysdd.readthedocs.io/en/latest/"
36
+
37
+ [project.entry-points."console_scripts"]
38
+ pysdd = "pysdd.cli:main"
39
+
40
+ [tool.setuptools]
41
+ packages=["pysdd"]
42
+
43
+ [[tool.setuptools.ext-modules]]
44
+ name = "pysdd.sdd"
45
+ sources = [
46
+ "pysdd/sdd.pyx",
47
+ "pysdd/lib/libsdd-2.0/src/util.c",
48
+ "pysdd/lib/libsdd-2.0/src/verify.c",
49
+ "pysdd/lib/libsdd-2.0/src/version.c",
50
+ "pysdd/lib/libsdd-2.0/src/basic/computed.c",
51
+ "pysdd/lib/libsdd-2.0/src/basic/count_and_size.c",
52
+ "pysdd/lib/libsdd-2.0/src/basic/gc.c",
53
+ "pysdd/lib/libsdd-2.0/src/basic/hash.c",
54
+ "pysdd/lib/libsdd-2.0/src/basic/memory.c",
55
+ "pysdd/lib/libsdd-2.0/src/basic/multiply.c",
56
+ "pysdd/lib/libsdd-2.0/src/basic/nodes.c",
57
+ "pysdd/lib/libsdd-2.0/src/basic/partitions.c",
58
+ "pysdd/lib/libsdd-2.0/src/basic/references.c",
59
+ "pysdd/lib/libsdd-2.0/src/basic/replace.c",
60
+ "pysdd/lib/libsdd-2.0/src/basic/shadows.c",
61
+ "pysdd/lib/libsdd-2.0/src/basic/sort.c",
62
+ "pysdd/lib/libsdd-2.0/src/manager/copy.c",
63
+ "pysdd/lib/libsdd-2.0/src/manager/interface.c",
64
+ "pysdd/lib/libsdd-2.0/src/manager/manager.c",
65
+ "pysdd/lib/libsdd-2.0/src/manager/stats.c",
66
+ "pysdd/lib/libsdd-2.0/src/manager/variables.c",
67
+ "pysdd/lib/libsdd-2.0/src/sdds/apply.c",
68
+ "pysdd/lib/libsdd-2.0/src/sdds/bits.c",
69
+ "pysdd/lib/libsdd-2.0/src/sdds/cardinality.c",
70
+ "pysdd/lib/libsdd-2.0/src/sdds/condition.c",
71
+ "pysdd/lib/libsdd-2.0/src/sdds/copy.c",
72
+ "pysdd/lib/libsdd-2.0/src/sdds/count.c",
73
+ "pysdd/lib/libsdd-2.0/src/sdds/essential_vars.c",
74
+ "pysdd/lib/libsdd-2.0/src/sdds/exists.c",
75
+ "pysdd/lib/libsdd-2.0/src/sdds/exists_multiple.c",
76
+ "pysdd/lib/libsdd-2.0/src/sdds/exists_multiple_static.c",
77
+ "pysdd/lib/libsdd-2.0/src/sdds/forall.c",
78
+ "pysdd/lib/libsdd-2.0/src/sdds/io.c",
79
+ "pysdd/lib/libsdd-2.0/src/sdds/model_count.c",
80
+ "pysdd/lib/libsdd-2.0/src/sdds/rename_vars.c",
81
+ "pysdd/lib/libsdd-2.0/src/sdds/size.c",
82
+ "pysdd/lib/libsdd-2.0/src/sdds/wmc.c",
83
+ "pysdd/lib/libsdd-2.0/src/vtree_fragments/construction.c",
84
+ "pysdd/lib/libsdd-2.0/src/vtree_fragments/moves.c",
85
+ "pysdd/lib/libsdd-2.0/src/vtree_fragments/operations.c",
86
+ "pysdd/lib/libsdd-2.0/src/vtree_operations/cartesian_product.c",
87
+ "pysdd/lib/libsdd-2.0/src/vtree_operations/dissect.c",
88
+ "pysdd/lib/libsdd-2.0/src/vtree_operations/limits.c",
89
+ "pysdd/lib/libsdd-2.0/src/vtree_operations/op_left_rotate.c",
90
+ "pysdd/lib/libsdd-2.0/src/vtree_operations/op_right_rotate.c",
91
+ "pysdd/lib/libsdd-2.0/src/vtree_operations/op_swap.c",
92
+ "pysdd/lib/libsdd-2.0/src/vtree_operations/rollback.c",
93
+ "pysdd/lib/libsdd-2.0/src/vtree_operations/split.c",
94
+ "pysdd/lib/libsdd-2.0/src/vtree_search/auto.c",
95
+ "pysdd/lib/libsdd-2.0/src/vtree_search/search.c",
96
+ "pysdd/lib/libsdd-2.0/src/vtree_search/state.c",
97
+ "pysdd/lib/libsdd-2.0/src/vtrees/compare.c",
98
+ "pysdd/lib/libsdd-2.0/src/vtrees/edit.c",
99
+ "pysdd/lib/libsdd-2.0/src/vtrees/io.c",
100
+ "pysdd/lib/libsdd-2.0/src/vtrees/maps.c",
101
+ "pysdd/lib/libsdd-2.0/src/vtrees/moves.c",
102
+ "pysdd/lib/libsdd-2.0/src/vtrees/static.c",
103
+ "pysdd/lib/libsdd-2.0/src/vtrees/vtree.c",
104
+ "pysdd/lib/sdd-2.0/src/fnf/compiler.c",
105
+ "pysdd/lib/sdd-2.0/src/fnf/fnf.c",
106
+ "pysdd/lib/sdd-2.0/src/fnf/io.c",
107
+ "pysdd/lib/sdd-2.0/src/fnf/utils.c",
108
+ ]
109
+ include-dirs = [
110
+ "pysdd/lib/libsdd-2.0/include",
111
+ "pysdd/lib/sdd-2.0/include",
112
+ "pysdd/lib/sdd_extra/include",
113
+ ]
114
+
115
+ [tool.cibuildwheel]
116
+ environment = {CFLAGS="-std=c99 -O2 -finline-functions" }
117
+
118
+ [tool.cibuildwheel.windows]
119
+ environment = {CL = "/O2"}
120
+
@@ -0,0 +1 @@
1
+ __version__ = "1.0.0"
@@ -2,6 +2,7 @@
2
2
  * The Sentential Decision Diagram Package
3
3
  * sdd version 2.0, January 8, 2018
4
4
  * http://reasoning.cs.ucla.edu/sdd
5
+ * Modified by DTAI.
5
6
  ****************************************************************************************/
6
7
 
7
8
  #include "sdd.h"
@@ -103,6 +104,19 @@ SddSize key_sdd_node(SddNode* node, SddHash* hash) {
103
104
  * hash table properties
104
105
  *******************************************************************************************/
105
106
 
107
+ #if defined(WIN32) || defined(_WIN32)
108
+ #else
109
+ inline
110
+ float hit_rate(SddHash* hash) {
111
+ return 100.0*hash->hit_count/hash->lookup_count;
112
+ }
113
+
114
+ inline
115
+ float ave_lookup_cost(SddHash* hash) {
116
+ return ((float)hash->lookup_cost)/hash->lookup_count;
117
+ }
118
+ #endif
119
+
106
120
 
107
121
  //percentage of entries in hash table that have non-empty collision lists
108
122
  float saturation(SddHash* hash) {
@@ -2,6 +2,7 @@
2
2
  * The Sentential Decision Diagram Package
3
3
  * sdd version 2.0, January 8, 2018
4
4
  * http://reasoning.cs.ucla.edu/sdd
5
+ * Modified by DTAI.
5
6
  ****************************************************************************************/
6
7
 
7
8
  #include "sdd.h"
@@ -84,7 +85,7 @@ SddNode* new_sdd_node(SddNodeType type, SddNodeSize size, Vtree* vtree, SddManag
84
85
  else { //allocate decomposition
85
86
  assert(size > 0);
86
87
  //allocate decomposition node
87
- int bucket = (size < GC_BUCKETS_COUNT? size: 0);
88
+ size_t bucket = (size < GC_BUCKETS_COUNT? size: 0);
88
89
  node = manager->gc_node_lists[bucket];
89
90
  if(node != NULL) { //allocating from gc list
90
91
  --manager->gc_node_count;
@@ -156,7 +157,7 @@ void gc_sdd_node(SddNode* node, SddManager* manager) {
156
157
  ++manager->gc_node_count;
157
158
  manager->gc_element_count += node->size; //no change for literal sdds
158
159
 
159
- int bucket = (node->size < GC_BUCKETS_COUNT? node->size: 0); //literal sdds go into bucket 0
160
+ size_t bucket = (node->size < GC_BUCKETS_COUNT? node->size: 0); //literal sdds go into bucket 0
160
161
  node->next = manager->gc_node_lists[bucket];
161
162
  manager->gc_node_lists[bucket] = node; //add node to corresponding bucket
162
163