PySDD 1.0.5__tar.gz → 1.0.6__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 (86) hide show
  1. {pysdd-1.0.5 → pysdd-1.0.6}/PKG-INFO +3 -2
  2. {pysdd-1.0.5 → pysdd-1.0.6}/PySDD.egg-info/PKG-INFO +3 -2
  3. {pysdd-1.0.5 → pysdd-1.0.6}/pyproject.toml +1 -1
  4. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/sdd.pyx +4 -1
  5. {pysdd-1.0.5 → pysdd-1.0.6}/tests/test_minimize.py +16 -0
  6. {pysdd-1.0.5 → pysdd-1.0.6}/LICENSE +0 -0
  7. {pysdd-1.0.5 → pysdd-1.0.6}/PySDD.egg-info/SOURCES.txt +0 -0
  8. {pysdd-1.0.5 → pysdd-1.0.6}/PySDD.egg-info/dependency_links.txt +0 -0
  9. {pysdd-1.0.5 → pysdd-1.0.6}/PySDD.egg-info/entry_points.txt +0 -0
  10. {pysdd-1.0.5 → pysdd-1.0.6}/PySDD.egg-info/requires.txt +0 -0
  11. {pysdd-1.0.5 → pysdd-1.0.6}/PySDD.egg-info/top_level.txt +0 -0
  12. {pysdd-1.0.5 → pysdd-1.0.6}/README.rst +0 -0
  13. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/__init__.py +0 -0
  14. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/__main__.py +0 -0
  15. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/cli.py +0 -0
  16. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/iterator.py +0 -0
  17. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/basic/computed.c +0 -0
  18. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/basic/count_and_size.c +0 -0
  19. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/basic/gc.c +0 -0
  20. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/basic/hash.c +0 -0
  21. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/basic/memory.c +0 -0
  22. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/basic/multiply.c +0 -0
  23. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/basic/nodes.c +0 -0
  24. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/basic/partitions.c +0 -0
  25. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/basic/references.c +0 -0
  26. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/basic/replace.c +0 -0
  27. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/basic/shadows.c +0 -0
  28. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/basic/sort.c +0 -0
  29. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/manager/copy.c +0 -0
  30. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/manager/interface.c +0 -0
  31. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/manager/manager.c +0 -0
  32. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/manager/stats.c +0 -0
  33. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/manager/variables.c +0 -0
  34. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/sdds/apply.c +0 -0
  35. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/sdds/bits.c +0 -0
  36. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/sdds/cardinality.c +0 -0
  37. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/sdds/condition.c +0 -0
  38. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/sdds/copy.c +0 -0
  39. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/sdds/count.c +0 -0
  40. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/sdds/essential_vars.c +0 -0
  41. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/sdds/exists.c +0 -0
  42. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/sdds/exists_multiple.c +0 -0
  43. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/sdds/exists_multiple_static.c +0 -0
  44. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/sdds/forall.c +0 -0
  45. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/sdds/io.c +0 -0
  46. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/sdds/model_count.c +0 -0
  47. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/sdds/rename_vars.c +0 -0
  48. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/sdds/size.c +0 -0
  49. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/sdds/wmc.c +0 -0
  50. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/util.c +0 -0
  51. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/verify.c +0 -0
  52. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/version.c +0 -0
  53. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/vtree_fragments/construction.c +0 -0
  54. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/vtree_fragments/moves.c +0 -0
  55. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/vtree_fragments/operations.c +0 -0
  56. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/vtree_operations/cartesian_product.c +0 -0
  57. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/vtree_operations/dissect.c +0 -0
  58. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/vtree_operations/limits.c +0 -0
  59. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/vtree_operations/op_left_rotate.c +0 -0
  60. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/vtree_operations/op_right_rotate.c +0 -0
  61. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/vtree_operations/op_swap.c +0 -0
  62. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/vtree_operations/rollback.c +0 -0
  63. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/vtree_operations/split.c +0 -0
  64. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/vtree_search/auto.c +0 -0
  65. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/vtree_search/search.c +0 -0
  66. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/vtree_search/state.c +0 -0
  67. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/vtrees/compare.c +0 -0
  68. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/vtrees/edit.c +0 -0
  69. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/vtrees/io.c +0 -0
  70. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/vtrees/maps.c +0 -0
  71. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/vtrees/moves.c +0 -0
  72. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/vtrees/static.c +0 -0
  73. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/libsdd-2.0/src/vtrees/vtree.c +0 -0
  74. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/sdd-2.0/src/fnf/compiler.c +0 -0
  75. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/sdd-2.0/src/fnf/fnf.c +0 -0
  76. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/sdd-2.0/src/fnf/io.c +0 -0
  77. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/lib/sdd-2.0/src/fnf/utils.c +0 -0
  78. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/util.py +0 -0
  79. {pysdd-1.0.5 → pysdd-1.0.6}/pysdd/wmcstochastic.py +0 -0
  80. {pysdd-1.0.5 → pysdd-1.0.6}/setup.cfg +0 -0
  81. {pysdd-1.0.5 → pysdd-1.0.6}/tests/test_iterator.py +0 -0
  82. {pysdd-1.0.5 → pysdd-1.0.6}/tests/test_nnf.py +0 -0
  83. {pysdd-1.0.5 → pysdd-1.0.6}/tests/test_psdd.py +0 -0
  84. {pysdd-1.0.5 → pysdd-1.0.6}/tests/test_util.py +0 -0
  85. {pysdd-1.0.5 → pysdd-1.0.6}/tests/test_vtree.py +0 -0
  86. {pysdd-1.0.5 → pysdd-1.0.6}/tests/test_wmcstochastic.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: PySDD
3
- Version: 1.0.5
3
+ Version: 1.0.6
4
4
  Summary: Sentential Decision Diagrams
5
5
  Author: Arthur Choi
6
6
  Author-email: Wannes Meert <wannes.meert@cs.kuleuven.be>, Robin Manhaeve <robin.manhaeve@kuleuven.be>
@@ -33,6 +33,7 @@ Provides-Extra: tests
33
33
  Requires-Dist: pytest; extra == "tests"
34
34
  Provides-Extra: notebooks
35
35
  Requires-Dist: numpy; extra == "notebooks"
36
+ Dynamic: license-file
36
37
 
37
38
  =====
38
39
  PySDD
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: PySDD
3
- Version: 1.0.5
3
+ Version: 1.0.6
4
4
  Summary: Sentential Decision Diagrams
5
5
  Author: Arthur Choi
6
6
  Author-email: Wannes Meert <wannes.meert@cs.kuleuven.be>, Robin Manhaeve <robin.manhaeve@kuleuven.be>
@@ -33,6 +33,7 @@ Provides-Extra: tests
33
33
  Requires-Dist: pytest; extra == "tests"
34
34
  Provides-Extra: notebooks
35
35
  Requires-Dist: numpy; extra == "notebooks"
36
+ Dynamic: license-file
36
37
 
37
38
  =====
38
39
  PySDD
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "PySDD"
7
- version = "1.0.5"
7
+ version = "1.0.6"
8
8
  description = "Sentential Decision Diagrams"
9
9
  authors = [
10
10
  { name = "Wannes Meert", email = "wannes.meert@cs.kuleuven.be" },
@@ -53,6 +53,7 @@ cdef class SddNode:
53
53
  wrapper._sddnode = node
54
54
  if wrapper.garbage_collected():
55
55
  return None
56
+ wrapper.ref()
56
57
  if sddapi_c.sdd_node_is_literal(node):
57
58
  wrapper._name = sddapi_c.sdd_node_literal(node)
58
59
  elif sddapi_c.sdd_node_is_true(node):
@@ -63,6 +64,9 @@ cdef class SddNode:
63
64
  wrapper._name = "Decision"
64
65
  return wrapper
65
66
 
67
+ def __del__(self):
68
+ # clean up _sddnode ref
69
+ self.deref()
66
70
 
67
71
  @property
68
72
  def id(self):
@@ -306,7 +310,6 @@ cdef class SddNode:
306
310
 
307
311
  Returns the node.
308
312
  """
309
- # TODO: Should we ref every Python SDDNode object on creation and deref on Python GC?
310
313
  sddapi_c.sdd_ref(self._sddnode, self._manager._sddmanager)
311
314
 
312
315
  def deref(self):
@@ -74,6 +74,22 @@ def test_min2():
74
74
  # with (directory / "sdd2_before_b.gv").open("w") as out:
75
75
  # print(sdd_to_dot(sdd), file=out)
76
76
 
77
+ def test_refcount():
78
+ sdd = SddManager(var_count=2)
79
+ a, b = sdd.vars
80
+ f = a | b
81
+ assert f.ref_count() == 1
82
+ f.ref()
83
+ assert f.ref_count() == 2
84
+ f.deref()
85
+ assert f.ref_count() == 1
86
+ # equivalent formula will
87
+ # ref same formula object
88
+ f2 = b | a
89
+ assert f2.ref_count() == 2
90
+ assert f.ref_count() == 2
91
+ del f2
92
+ assert f.ref_count() == 1
77
93
 
78
94
  if __name__ == "__main__":
79
95
  logger.setLevel(logging.DEBUG)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes