PySDD 0.2.11__tar.gz → 0.2.12__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 (123) hide show
  1. {PySDD-0.2.11 → pysdd-0.2.12}/PKG-INFO +8 -3
  2. {PySDD-0.2.11 → pysdd-0.2.12}/PySDD.egg-info/PKG-INFO +8 -3
  3. {PySDD-0.2.11 → pysdd-0.2.12}/PySDD.egg-info/SOURCES.txt +7 -6
  4. {PySDD-0.2.11 → pysdd-0.2.12}/PySDD.egg-info/requires.txt +2 -2
  5. pysdd-0.2.12/pysdd/__init__.py +1 -0
  6. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/compiler_c.pxd +2 -2
  7. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/fnf_c.pxd +2 -2
  8. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/io_c.pxd +2 -2
  9. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/include/sdd.h +12 -4
  10. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/sddapi.h +3 -3
  11. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/basic/hash.c +13 -0
  12. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/basic/memory.c +2 -2
  13. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/manager/interface.c +4 -4
  14. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/sdds/exists_multiple.c +1 -1
  15. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/sdds/io.c +1 -1
  16. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/util.c +2 -2
  17. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtrees/compare.c +8 -0
  18. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtrees/static.c +1 -1
  19. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/sdd-2.0/include/sddapi.h +3 -3
  20. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/sdd-2.0/lib/Darwin-arm/libsdd.a +0 -0
  21. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/sdd-2.0/src/fnf/compiler.c +3 -3
  22. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/sdd-2.0/src/fnf/io.c +2 -2
  23. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/sdd-2.0/src/fnf/utils.c +2 -1
  24. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/sdd.c +66722 -44383
  25. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/sdd.pyx +25 -131
  26. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/sddapi_c.pxd +3 -3
  27. {PySDD-0.2.11 → pysdd-0.2.12}/setup.py +22 -11
  28. pysdd-0.2.12/tests/test_iterator.py +156 -0
  29. pysdd-0.2.12/tests/test_minimize.py +85 -0
  30. pysdd-0.2.12/tests/test_nnf.py +94 -0
  31. pysdd-0.2.12/tests/test_psdd.py +28 -0
  32. pysdd-0.2.12/tests/test_util.py +48 -0
  33. pysdd-0.2.12/tests/test_vtree.py +31 -0
  34. pysdd-0.2.12/tests/test_wmcstochastic.py +75 -0
  35. PySDD-0.2.11/pysdd/__init__.py +0 -1
  36. PySDD-0.2.11/pysdd/lib/weight_optimization/include/arithmetic_ansi.h +0 -133
  37. PySDD-0.2.11/pysdd/lib/weight_optimization/include/lbfgs.h +0 -736
  38. PySDD-0.2.11/pysdd/lib/weight_optimization/include/weight_optimizer.h +0 -114
  39. PySDD-0.2.11/pysdd/lib/weight_optimization/src/lbfgs.c +0 -1360
  40. PySDD-0.2.11/pysdd/lib/weight_optimization/src/weight_optimizer.c +0 -257
  41. PySDD-0.2.11/pysdd/weight_optimization_c.pxd +0 -18
  42. {PySDD-0.2.11 → pysdd-0.2.12}/LICENSE +0 -0
  43. {PySDD-0.2.11 → pysdd-0.2.12}/MANIFEST.in +0 -0
  44. {PySDD-0.2.11 → pysdd-0.2.12}/PySDD.egg-info/dependency_links.txt +0 -0
  45. {PySDD-0.2.11 → pysdd-0.2.12}/PySDD.egg-info/entry_points.txt +0 -0
  46. {PySDD-0.2.11 → pysdd-0.2.12}/PySDD.egg-info/not-zip-safe +0 -0
  47. {PySDD-0.2.11 → pysdd-0.2.12}/PySDD.egg-info/top_level.txt +0 -0
  48. {PySDD-0.2.11 → pysdd-0.2.12}/README.rst +0 -0
  49. {PySDD-0.2.11 → pysdd-0.2.12}/pyproject.toml +0 -0
  50. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/__main__.py +0 -0
  51. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/cli.py +0 -0
  52. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/iterator.py +0 -0
  53. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/include/iterators.h +0 -0
  54. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/include/macros.h +0 -0
  55. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/include/parameters.h +0 -0
  56. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/include/stacks.h +0 -0
  57. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/basic/computed.c +0 -0
  58. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/basic/count_and_size.c +0 -0
  59. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/basic/gc.c +0 -0
  60. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/basic/multiply.c +0 -0
  61. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/basic/nodes.c +0 -0
  62. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/basic/partitions.c +0 -0
  63. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/basic/references.c +0 -0
  64. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/basic/replace.c +0 -0
  65. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/basic/shadows.c +0 -0
  66. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/basic/sort.c +0 -0
  67. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/fnf/io.c +0 -0
  68. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/manager/copy.c +0 -0
  69. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/manager/manager.c +0 -0
  70. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/manager/stats.c +0 -0
  71. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/manager/variables.c +0 -0
  72. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/sdds/apply.c +0 -0
  73. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/sdds/bits.c +0 -0
  74. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/sdds/cardinality.c +0 -0
  75. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/sdds/condition.c +0 -0
  76. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/sdds/copy.c +0 -0
  77. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/sdds/count.c +0 -0
  78. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/sdds/essential_vars.c +0 -0
  79. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/sdds/exists.c +0 -0
  80. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/sdds/exists_multiple_static.c +0 -0
  81. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/sdds/forall.c +0 -0
  82. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/sdds/model_count.c +0 -0
  83. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/sdds/rename_vars.c +0 -0
  84. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/sdds/size.c +0 -0
  85. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/sdds/wmc.c +0 -0
  86. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/verify.c +0 -0
  87. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/version.c +0 -0
  88. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtree_fragments/construction.c +0 -0
  89. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtree_fragments/moves.c +0 -0
  90. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtree_fragments/operations.c +0 -0
  91. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtree_operations/cartesian_product.c +0 -0
  92. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtree_operations/dissect.c +0 -0
  93. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtree_operations/limits.c +0 -0
  94. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtree_operations/op_left_rotate.c +0 -0
  95. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtree_operations/op_right_rotate.c +0 -0
  96. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtree_operations/op_swap.c +0 -0
  97. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtree_operations/rollback.c +0 -0
  98. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtree_operations/split.c +0 -0
  99. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtree_operations/vtree_ops.h +0 -0
  100. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtree_search/auto.c +0 -0
  101. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtree_search/search.c +0 -0
  102. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtree_search/state.c +0 -0
  103. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtrees/edit.c +0 -0
  104. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtrees/io.c +0 -0
  105. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtrees/maps.c +0 -0
  106. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtrees/moves.c +0 -0
  107. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtrees/vtree.c +0 -0
  108. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/sdd-2.0/include/compiler.h +0 -0
  109. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/sdd-2.0/include/fnf.h +0 -0
  110. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/sdd-2.0/include/io.h +0 -0
  111. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/sdd-2.0/lib/Darwin/libsdd.a +0 -0
  112. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/sdd-2.0/lib/Linux/libsdd.a +0 -0
  113. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/sdd-2.0/lib/Linux/libsdd.so +0 -0
  114. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/sdd-2.0/lib/Windows/sdd.dll +0 -0
  115. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/sdd-2.0/lib/Windows/sdd.lib +0 -0
  116. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/sdd-2.0/src/fnf/fnf.c +0 -0
  117. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/sdd-2.0/src/getopt.c +0 -0
  118. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/sdd-2.0/src/main.c +0 -0
  119. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/sdd_extra/include/sddapi_extra.h +0 -0
  120. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/sdd.dll +0 -0
  121. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/util.py +0 -0
  122. {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/wmcstochastic.py +0 -0
  123. {PySDD-0.2.11 → pysdd-0.2.12}/setup.cfg +0 -0
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PySDD
3
- Version: 0.2.11
3
+ Version: 0.2.12
4
4
  Summary: Sentential Decision Diagrams
5
5
  Home-page: https://github.com/wannesm/PySDD
6
6
  Author: Wannes Meert, Arthur Choi
7
7
  Author-email: wannes.meert@cs.kuleuven.be
8
8
  License: Apache 2.0
9
- Project-URL: PySDD documentation, http://pysdd.readthedocs.io/en/latest/
9
+ Project-URL: PySDD documentation, https://pysdd.readthedocs.io/en/latest/
10
10
  Project-URL: PySDD source, https://github.com/wannesm/PySDD
11
11
  Keywords: sdd,knowledge compilation
12
12
  Classifier: Intended Audience :: Developers
@@ -14,9 +14,14 @@ Classifier: License :: OSI Approved :: Apache Software License
14
14
  Classifier: Programming Language :: Python :: 3
15
15
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
16
16
  Requires-Python: >=3.6
17
+ License-File: LICENSE
18
+ Requires-Dist: cython>=3.0.0
17
19
  Provides-Extra: all
20
+ Requires-Dist: cysignals; extra == "all"
21
+ Requires-Dist: numpy; extra == "all"
18
22
  Provides-Extra: dev
19
- License-File: LICENSE
23
+ Requires-Dist: pytest; extra == "dev"
24
+ Requires-Dist: cython>=3.0.0; extra == "dev"
20
25
 
21
26
  =====
22
27
  PySDD
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PySDD
3
- Version: 0.2.11
3
+ Version: 0.2.12
4
4
  Summary: Sentential Decision Diagrams
5
5
  Home-page: https://github.com/wannesm/PySDD
6
6
  Author: Wannes Meert, Arthur Choi
7
7
  Author-email: wannes.meert@cs.kuleuven.be
8
8
  License: Apache 2.0
9
- Project-URL: PySDD documentation, http://pysdd.readthedocs.io/en/latest/
9
+ Project-URL: PySDD documentation, https://pysdd.readthedocs.io/en/latest/
10
10
  Project-URL: PySDD source, https://github.com/wannesm/PySDD
11
11
  Keywords: sdd,knowledge compilation
12
12
  Classifier: Intended Audience :: Developers
@@ -14,9 +14,14 @@ Classifier: License :: OSI Approved :: Apache Software License
14
14
  Classifier: Programming Language :: Python :: 3
15
15
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
16
16
  Requires-Python: >=3.6
17
+ License-File: LICENSE
18
+ Requires-Dist: cython>=3.0.0
17
19
  Provides-Extra: all
20
+ Requires-Dist: cysignals; extra == "all"
21
+ Requires-Dist: numpy; extra == "all"
18
22
  Provides-Extra: dev
19
- License-File: LICENSE
23
+ Requires-Dist: pytest; extra == "dev"
24
+ Requires-Dist: cython>=3.0.0; extra == "dev"
20
25
 
21
26
  =====
22
27
  PySDD
@@ -23,7 +23,6 @@ pysdd/sdd.dll
23
23
  pysdd/sdd.pyx
24
24
  pysdd/sddapi_c.pxd
25
25
  pysdd/util.py
26
- pysdd/weight_optimization_c.pxd
27
26
  pysdd/wmcstochastic.py
28
27
  pysdd/lib/libsdd-2.0/sddapi.h
29
28
  pysdd/lib/libsdd-2.0/include/iterators.h
@@ -107,8 +106,10 @@ pysdd/lib/sdd-2.0/src/fnf/fnf.c
107
106
  pysdd/lib/sdd-2.0/src/fnf/io.c
108
107
  pysdd/lib/sdd-2.0/src/fnf/utils.c
109
108
  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
109
+ tests/test_iterator.py
110
+ tests/test_minimize.py
111
+ tests/test_nnf.py
112
+ tests/test_psdd.py
113
+ tests/test_util.py
114
+ tests/test_vtree.py
115
+ tests/test_wmcstochastic.py
@@ -1,4 +1,4 @@
1
- cython>=0.29.6
1
+ cython>=3.0.0
2
2
 
3
3
  [all]
4
4
  cysignals
@@ -6,4 +6,4 @@ numpy
6
6
 
7
7
  [dev]
8
8
  pytest
9
- cython>=0.29.6
9
+ cython>=3.0.0
@@ -0,0 +1 @@
1
+ __version__ = "0.2.12"
@@ -6,7 +6,7 @@ __license__ = "APL"
6
6
 
7
7
  """
8
8
 
9
- cimport sddapi_c
9
+ from . cimport sddapi_c
10
10
 
11
11
  cdef extern from "compiler.h":
12
12
  ctypedef struct SddCompilerOptions:
@@ -29,7 +29,7 @@ cdef extern from "compiler.h":
29
29
  int post_search # post-compilation search
30
30
  int verbose # print manager
31
31
  ctypedef struct Fnf:
32
- long var_count;
32
+ long long var_count;
33
33
  sddapi_c.SddSize litset_count;
34
34
  ctypedef Fnf Cnf;
35
35
  ctypedef Fnf Dnf;
@@ -7,8 +7,8 @@ pysdd.fnf_c
7
7
  :copyright: Copyright 2017-2018 KU Leuven and Regents of the University of California.
8
8
  :license: Apache License, Version 2.0, see LICENSE for details.
9
9
  """
10
- cimport sddapi_c
11
- cimport compiler_c
10
+ from . cimport sddapi_c
11
+ from . cimport compiler_c
12
12
 
13
13
  cdef extern from "fnf.h":
14
14
  void free_fnf(compiler_c.Fnf* fnf)
@@ -7,8 +7,8 @@ pysdd.io_c
7
7
  :copyright: Copyright 2017-2018 KU Leuven and Regents of the University of California.
8
8
  :license: Apache License, Version 2.0, see LICENSE for details.
9
9
  """
10
- cimport sddapi_c
11
- cimport compiler_c
10
+ from . cimport sddapi_c
11
+ from . cimport compiler_c
12
12
 
13
13
  cdef extern from "io.h":
14
14
  compiler_c.Fnf* read_fnf(const char* filename);
@@ -26,11 +26,11 @@
26
26
 
27
27
  //sdd types
28
28
  typedef size_t SddSize; //number of nodes, sizes of hash tables, etc
29
- typedef unsigned int SddNodeSize; //size of decomposition for sdd nodes
30
- typedef unsigned int SddRefCount; //refcount
29
+ typedef size_t SddNodeSize; //size of decomposition for sdd nodes
30
+ typedef size_t SddRefCount; //refcount
31
31
  typedef unsigned long long SddModelCount; //model count
32
32
  typedef double SddWmc; // weighted model count
33
- typedef long SddLiteral; //literals of clauses
33
+ typedef long long SddLiteral; //literals of clauses
34
34
 
35
35
  //control strings
36
36
  #define PRIsS "zu"
@@ -548,6 +548,7 @@ void cache_computation(SddNode* node1, SddNode* node2, SddNode* node, BoolOp op,
548
548
  void sdd_vtree_garbage_collect(Vtree* vtree, SddManager* manager);
549
549
 
550
550
  //hash.c
551
+ #if defined(WIN32) || defined(_WIN32)
551
552
  inline float hit_rate(SddHash* hash) {
552
553
  return 100.0 * hash->hit_count / hash->lookup_count;
553
554
  }
@@ -555,6 +556,10 @@ inline float hit_rate(SddHash* hash) {
555
556
  inline float ave_lookup_cost(SddHash* hash) {
556
557
  return ((float)hash->lookup_cost) / hash->lookup_count;
557
558
  }
559
+ #else
560
+ float hit_rate(SddHash* hash);
561
+ float ave_lookup_cost(SddHash* hash);
562
+ #endif
558
563
  float saturation(SddHash* hash);
559
564
 
560
565
  //reference.c
@@ -754,11 +759,14 @@ void sdd_vtree_save(const char* fname, Vtree* vtree);
754
759
  void sdd_vtree_save_as_dot(const char* fname, Vtree* vtree);
755
760
 
756
761
  //compare.c
757
- //int sdd_vtree_is_sub(const Vtree* vtree1, const Vtree* vtree2);
762
+ #if defined(WIN32) || defined(_WIN32)
758
763
  //tests whether vtree1 is a subtree of vtree2
759
764
  inline int sdd_vtree_is_sub(const Vtree* vtree1, const Vtree* vtree2) {
760
765
  return vtree1->position >= vtree2->first->position && vtree1->position <= vtree2->last->position;
761
766
  }
767
+ #else
768
+ int sdd_vtree_is_sub(const Vtree* vtree1, const Vtree* vtree2);
769
+ #endif
762
770
  Vtree* sdd_vtree_lca(Vtree* vtree1, Vtree* vtree2, Vtree* root);
763
771
  Vtree* lca_of_compressed_elements(SddNodeSize size, SddElement* elements, SddManager* manager);
764
772
 
@@ -23,11 +23,11 @@
23
23
 
24
24
  //sdd types
25
25
  typedef size_t SddSize; //number of nodes, sizes of hash tables, etc
26
- typedef unsigned int SddNodeSize; //size of decomposition for sdd nodes
27
- typedef unsigned int SddRefCount; //refcount
26
+ typedef size_t SddNodeSize; //size of decomposition for sdd nodes
27
+ typedef size_t SddRefCount; //refcount
28
28
  typedef unsigned long long SddModelCount; //model counts
29
29
  typedef double SddWmc; // weighted model count
30
- typedef long SddLiteral; //literals of clauses
30
+ typedef long long SddLiteral; //literals of clauses
31
31
 
32
32
  //control strings
33
33
  #define PRIsS "zu"
@@ -103,6 +103,19 @@ SddSize key_sdd_node(SddNode* node, SddHash* hash) {
103
103
  * hash table properties
104
104
  *******************************************************************************************/
105
105
 
106
+ #if defined(WIN32) || defined(_WIN32)
107
+ #else
108
+ inline
109
+ float hit_rate(SddHash* hash) {
110
+ return 100.0*hash->hit_count/hash->lookup_count;
111
+ }
112
+
113
+ inline
114
+ float ave_lookup_cost(SddHash* hash) {
115
+ return ((float)hash->lookup_cost)/hash->lookup_count;
116
+ }
117
+ #endif
118
+
106
119
 
107
120
  //percentage of entries in hash table that have non-empty collision lists
108
121
  float saturation(SddHash* hash) {
@@ -84,7 +84,7 @@ SddNode* new_sdd_node(SddNodeType type, SddNodeSize size, Vtree* vtree, SddManag
84
84
  else { //allocate decomposition
85
85
  assert(size > 0);
86
86
  //allocate decomposition node
87
- int bucket = (size < GC_BUCKETS_COUNT? size: 0);
87
+ size_t bucket = (size < GC_BUCKETS_COUNT? size: 0);
88
88
  node = manager->gc_node_lists[bucket];
89
89
  if(node != NULL) { //allocating from gc list
90
90
  --manager->gc_node_count;
@@ -156,7 +156,7 @@ void gc_sdd_node(SddNode* node, SddManager* manager) {
156
156
  ++manager->gc_node_count;
157
157
  manager->gc_element_count += node->size; //no change for literal sdds
158
158
 
159
- int bucket = (node->size < GC_BUCKETS_COUNT? node->size: 0); //literal sdds go into bucket 0
159
+ size_t bucket = (node->size < GC_BUCKETS_COUNT? node->size: 0); //literal sdds go into bucket 0
160
160
  node->next = manager->gc_node_lists[bucket];
161
161
  manager->gc_node_lists[bucket] = node; //add node to corresponding bucket
162
162
 
@@ -268,16 +268,16 @@ void sdd_manager_minimize_limited(SddManager* manager) {
268
268
 
269
269
 
270
270
  // these are checked by exceeded_limits(), invoked by l_apply
271
- void sdd_manager_set_vtree_search_time_limit(float time_limit, SddManager* manager) {
271
+ void sdd_manager_set_vtree_search_time_limit(clock_t time_limit, SddManager* manager) {
272
272
  manager->vtree_ops.search_time_limit = time_limit*CLOCKS_PER_SEC;
273
273
  }
274
- void sdd_manager_set_vtree_fragment_time_limit(float time_limit, SddManager* manager) {
274
+ void sdd_manager_set_vtree_fragment_time_limit(clock_t time_limit, SddManager* manager) {
275
275
  manager->vtree_ops.fragment_time_limit = time_limit*CLOCKS_PER_SEC;
276
276
  }
277
- void sdd_manager_set_vtree_operation_time_limit(float time_limit, SddManager* manager) {
277
+ void sdd_manager_set_vtree_operation_time_limit(clock_t time_limit, SddManager* manager) {
278
278
  manager->vtree_ops.op_time_limit = time_limit*CLOCKS_PER_SEC;
279
279
  }
280
- void sdd_manager_set_vtree_apply_time_limit(float time_limit, SddManager* manager) {
280
+ void sdd_manager_set_vtree_apply_time_limit(clock_t time_limit, SddManager* manager) {
281
281
  manager->vtree_ops.apply_time_limit = time_limit*CLOCKS_PER_SEC;
282
282
  }
283
283
  void sdd_manager_set_vtree_operation_memory_limit(float memory_limit, SddManager* manager) {
@@ -32,7 +32,7 @@ static void deref_nodes_of_terminal_shadows(SddShadows* shadows);
32
32
  //exists_map[var] : is 1 if var is to be existentially quantified, 0 otherwise
33
33
  //exists_map[0] : not used
34
34
 
35
- static long ref_count; //sanity check
35
+ static long long ref_count; //sanity check
36
36
 
37
37
  SddNode* sdd_exists_multiple(int* exists_map, SddNode* node, SddManager* manager) {
38
38
  CHECK_ERROR(GC_NODE(node),ERR_MSG_GC,"sdd_exists_multiple");
@@ -285,7 +285,7 @@ void print_sdd_node_file(FILE* file, SddNode* node) {
285
285
  else if(node->type==FALSE) fprintf(file,"F %"PRIsS"\n",node->index);
286
286
  else if(node->type==LITERAL) fprintf(file,"L %"PRIsS" %"PRIsS" %"PRIlitS"\n",node->index,vtree->position,LITERAL_OF(node));
287
287
  else {//decomposition
288
- fprintf(file,"D %"PRIsS" %"PRIsS" %"PRInsS"",node->index,vtree->position,node->size);
288
+ fprintf(file,"D %"PRIsS" %"PRIsS" %"PRIsS"",node->index,vtree->position,node->size);
289
289
  FOR_each_prime_sub_of_node(prime,sub,node,fprintf(file," %"PRIsS" %"PRIsS"",prime->index,sub->index));
290
290
  fprintf(file,"\n");
291
291
  }
@@ -186,7 +186,7 @@ char* read_file(const char* filename) {
186
186
  // lookup file size
187
187
  // AC: I don't think this is the best way to do this
188
188
  fseek(file,0,SEEK_END);
189
- unsigned int file_size = ftell(file);
189
+ size_t file_size = ftell(file);
190
190
  rewind(file);
191
191
 
192
192
  // allocate memory
@@ -194,7 +194,7 @@ char* read_file(const char* filename) {
194
194
  CALLOC(buffer,char,file_size+1,"read_file");
195
195
 
196
196
  // read the whole file
197
- unsigned int result = fread(buffer,sizeof(char),file_size,file);
197
+ size_t result = fread(buffer,sizeof(char),file_size,file);
198
198
  if (result != file_size) {
199
199
  printf("Could not read the file %s\n",filename);
200
200
  exit(1);
@@ -13,6 +13,14 @@ char cmp_vtrees(Vtree** lca, Vtree* vtree1, Vtree* vtree2);
13
13
  * basic tests
14
14
  ****************************************************************************************/
15
15
 
16
+ #if defined(WIN32) || defined(_WIN32)
17
+ #else
18
+ //tests whether vtree1 is a subtree of vtree2
19
+ inline
20
+ int sdd_vtree_is_sub(const Vtree* vtree1, const Vtree* vtree2) {
21
+ return vtree1->position >= vtree2->first->position && vtree1->position <= vtree2->last->position;
22
+ }
23
+ #endif
16
24
 
17
25
  /****************************************************************************************
18
26
  * lca is the lowest common ancestor
@@ -158,7 +158,7 @@ Vtree* new_random_vtree(SddLiteral var_count) {
158
158
  SddLiteral* labels = (SddLiteral*) calloc(var_count,sizeof(SddLiteral));
159
159
  for(SddLiteral i=0; i<var_count; i++) labels[i] = i+1; //assign labels
160
160
  SddLiteral unused_count = var_count;
161
- srand(time(NULL));
161
+ srand((unsigned int)time(NULL));
162
162
  Vtree* vtree = new_random_vtree_aux(var_count,labels,&unused_count);
163
163
  free(labels);
164
164
  return vtree;
@@ -23,11 +23,11 @@
23
23
 
24
24
  //sdd types
25
25
  typedef size_t SddSize; //number of nodes, sizes of hash tables, etc
26
- typedef unsigned int SddNodeSize; //size of decomposition for sdd nodes
27
- typedef unsigned int SddRefCount; //refcount
26
+ typedef size_t SddNodeSize; //size of decomposition for sdd nodes, changed to size_t for cross-platform compatibility
27
+ typedef size_t SddRefCount; //refcount, changed to size_t for cross-platform compatibility
28
28
  typedef unsigned long long SddModelCount; //model counts
29
29
  typedef double SddWmc; // weighted model count
30
- typedef long SddLiteral; //literals of clauses
30
+ typedef long long SddLiteral; //literals of clauses
31
31
  typedef char SddNodeType; //holds one of two values defined next
32
32
 
33
33
  //control strings
@@ -25,7 +25,7 @@ SddNode* degenerate_fnf_test(Fnf* fnf, SddManager* manager) {
25
25
 
26
26
  if(count==0) return ONE(manager,op);
27
27
 
28
- for(int i=0; i<count; i++) {
28
+ for(SddSize i=0; i<count; i++) {
29
29
  if (fnf->litsets[i].literal_count == 0)
30
30
  return ZERO(manager,op);
31
31
  }
@@ -43,7 +43,7 @@ SddNode* fnf_to_sdd_auto(Fnf* fnf, SddManager* manager) {
43
43
 
44
44
  if(verbose) { printf("\nclauses: %ld ",count); fflush(stdout); }
45
45
  SddNode* node = ONE(manager,op);
46
- for(int i=0; i<count; i++) {
46
+ for(SddSize i=0; i<count; i++) {
47
47
  sort_litsets_by_lca(litsets+i,count-i,manager);
48
48
  sdd_ref(node,manager);
49
49
  SddNode* l = apply_litset(litsets[i],manager);
@@ -67,7 +67,7 @@ SddNode* fnf_to_sdd_manual(Fnf* fnf, SddManager* manager) {
67
67
 
68
68
  if(verbose) { printf("\nclauses: %ld ",count); fflush(stdout); }
69
69
  SddNode* node = ONE(manager,op);
70
- for(int i=0; i<count; i++) {
70
+ for(SddSize i=0; i<count; i++) {
71
71
  if(period > 0 && i > 0 && i%period==0) {
72
72
  // after every period clauses
73
73
  sdd_ref(node,manager);
@@ -26,14 +26,14 @@ static char* read_file(const char* filename) {
26
26
 
27
27
  // lookup file size
28
28
  fseek(file,0,SEEK_END);
29
- unsigned int file_size = ftell(file);
29
+ size_t file_size = ftell(file);
30
30
  rewind(file);
31
31
 
32
32
  // allocate memory
33
33
  char* buffer = (char*)calloc(file_size+1,sizeof(char));
34
34
 
35
35
  // read the whole file
36
- unsigned int result = fread(buffer,sizeof(char),file_size,file);
36
+ size_t result = fread(buffer,sizeof(char),file_size,file);
37
37
  if (result != file_size) {
38
38
  printf("Could not read the file %s\n",filename);
39
39
  exit(1);
@@ -57,7 +57,8 @@ int litset_cmp_lca(const void* litset1_loc, const void* litset2_loc) {
57
57
  //last: by id to obtain unique order
58
58
  void sort_litsets_by_lca(LitSet** litsets, SddSize size, SddManager* manager) {
59
59
  //compute lcas of litsets
60
- for(SddLiteral i=0; i<size; i++) {
60
+ // i was SddLiteral but to be type compatible and since i is always positive, changed to SddSize
61
+ for(SddSize i=0; i<size; i++) {
61
62
  LitSet* litset = litsets[i];
62
63
  litset->vtree = sdd_manager_lca_of_literals(litset->literal_count,litset->literals,manager);
63
64
  }