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.
- {PySDD-0.2.11 → pysdd-0.2.12}/PKG-INFO +8 -3
- {PySDD-0.2.11 → pysdd-0.2.12}/PySDD.egg-info/PKG-INFO +8 -3
- {PySDD-0.2.11 → pysdd-0.2.12}/PySDD.egg-info/SOURCES.txt +7 -6
- {PySDD-0.2.11 → pysdd-0.2.12}/PySDD.egg-info/requires.txt +2 -2
- pysdd-0.2.12/pysdd/__init__.py +1 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/compiler_c.pxd +2 -2
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/fnf_c.pxd +2 -2
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/io_c.pxd +2 -2
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/include/sdd.h +12 -4
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/sddapi.h +3 -3
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/basic/hash.c +13 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/basic/memory.c +2 -2
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/manager/interface.c +4 -4
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/sdds/exists_multiple.c +1 -1
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/sdds/io.c +1 -1
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/util.c +2 -2
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtrees/compare.c +8 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtrees/static.c +1 -1
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/sdd-2.0/include/sddapi.h +3 -3
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/sdd-2.0/lib/Darwin-arm/libsdd.a +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/sdd-2.0/src/fnf/compiler.c +3 -3
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/sdd-2.0/src/fnf/io.c +2 -2
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/sdd-2.0/src/fnf/utils.c +2 -1
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/sdd.c +66722 -44383
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/sdd.pyx +25 -131
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/sddapi_c.pxd +3 -3
- {PySDD-0.2.11 → pysdd-0.2.12}/setup.py +22 -11
- pysdd-0.2.12/tests/test_iterator.py +156 -0
- pysdd-0.2.12/tests/test_minimize.py +85 -0
- pysdd-0.2.12/tests/test_nnf.py +94 -0
- pysdd-0.2.12/tests/test_psdd.py +28 -0
- pysdd-0.2.12/tests/test_util.py +48 -0
- pysdd-0.2.12/tests/test_vtree.py +31 -0
- pysdd-0.2.12/tests/test_wmcstochastic.py +75 -0
- PySDD-0.2.11/pysdd/__init__.py +0 -1
- PySDD-0.2.11/pysdd/lib/weight_optimization/include/arithmetic_ansi.h +0 -133
- PySDD-0.2.11/pysdd/lib/weight_optimization/include/lbfgs.h +0 -736
- PySDD-0.2.11/pysdd/lib/weight_optimization/include/weight_optimizer.h +0 -114
- PySDD-0.2.11/pysdd/lib/weight_optimization/src/lbfgs.c +0 -1360
- PySDD-0.2.11/pysdd/lib/weight_optimization/src/weight_optimizer.c +0 -257
- PySDD-0.2.11/pysdd/weight_optimization_c.pxd +0 -18
- {PySDD-0.2.11 → pysdd-0.2.12}/LICENSE +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/MANIFEST.in +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/PySDD.egg-info/dependency_links.txt +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/PySDD.egg-info/entry_points.txt +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/PySDD.egg-info/not-zip-safe +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/PySDD.egg-info/top_level.txt +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/README.rst +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pyproject.toml +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/__main__.py +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/cli.py +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/iterator.py +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/include/iterators.h +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/include/macros.h +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/include/parameters.h +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/include/stacks.h +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/basic/computed.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/basic/count_and_size.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/basic/gc.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/basic/multiply.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/basic/nodes.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/basic/partitions.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/basic/references.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/basic/replace.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/basic/shadows.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/basic/sort.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/fnf/io.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/manager/copy.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/manager/manager.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/manager/stats.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/manager/variables.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/sdds/apply.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/sdds/bits.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/sdds/cardinality.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/sdds/condition.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/sdds/copy.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/sdds/count.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/sdds/essential_vars.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/sdds/exists.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/sdds/exists_multiple_static.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/sdds/forall.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/sdds/model_count.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/sdds/rename_vars.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/sdds/size.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/sdds/wmc.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/verify.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/version.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtree_fragments/construction.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtree_fragments/moves.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtree_fragments/operations.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtree_operations/cartesian_product.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtree_operations/dissect.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtree_operations/limits.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtree_operations/op_left_rotate.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtree_operations/op_right_rotate.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtree_operations/op_swap.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtree_operations/rollback.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtree_operations/split.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtree_operations/vtree_ops.h +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtree_search/auto.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtree_search/search.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtree_search/state.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtrees/edit.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtrees/io.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtrees/maps.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtrees/moves.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/libsdd-2.0/src/vtrees/vtree.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/sdd-2.0/include/compiler.h +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/sdd-2.0/include/fnf.h +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/sdd-2.0/include/io.h +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/sdd-2.0/lib/Darwin/libsdd.a +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/sdd-2.0/lib/Linux/libsdd.a +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/sdd-2.0/lib/Linux/libsdd.so +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/sdd-2.0/lib/Windows/sdd.dll +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/sdd-2.0/lib/Windows/sdd.lib +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/sdd-2.0/src/fnf/fnf.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/sdd-2.0/src/getopt.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/sdd-2.0/src/main.c +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/lib/sdd_extra/include/sddapi_extra.h +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/sdd.dll +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/util.py +0 -0
- {PySDD-0.2.11 → pysdd-0.2.12}/pysdd/wmcstochastic.py +0 -0
- {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.
|
|
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,
|
|
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
|
-
|
|
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.
|
|
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,
|
|
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
|
-
|
|
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
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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
|
|
@@ -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
|
|
30
|
-
typedef
|
|
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
|
-
|
|
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
|
|
27
|
-
typedef
|
|
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
|
-
|
|
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
|
-
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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" %"
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
27
|
-
typedef
|
|
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
|
|
Binary file
|
|
@@ -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(
|
|
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(
|
|
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(
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
}
|