wannesm / pysdd Goto Github PK
View Code? Open in Web Editor NEWPython package for Sentential Decision Diagrams (SDD)
License: Other
Python package for Sentential Decision Diagrams (SDD)
License: Other
Using Ubuntu and Python 3.8 (installed Cython and PySDD via pip) when im trying to import (from pysdd.sdd import SddManager, Vtree, WmcManager) it returns the error "No module named pysdd"
Trying to install PySDD on Ubuntu 20.04 using Python 3.8 continually fails for me when running pip install pysdd
.
I've installed libpython3-dev & python3-dev. Additionally, I've tried to use other recommended commands from previous issue threads, such as pip install -vvv --upgrade --force-reinstall --no-deps pysdd
. However, the installation fails every time.
Below, I've provided the output when running pip install pysdd
. In this case, the error seems to stem from the use of the -march=native flag.
× Running setup.py install for pysdd did not run successfully.
│ exit code: 1
╰─> [156 lines of output]
running install
running build
running build_py
creating build
creating build/lib.linux-ppc64le-3.8
creating build/lib.linux-ppc64le-3.8/pysdd
copying pysdd/util.py -> build/lib.linux-ppc64le-3.8/pysdd
copying pysdd/__main__.py -> build/lib.linux-ppc64le-3.8/pysdd
copying pysdd/iterator.py -> build/lib.linux-ppc64le-3.8/pysdd
copying pysdd/__init__.py -> build/lib.linux-ppc64le-3.8/pysdd
copying pysdd/cli.py -> build/lib.linux-ppc64le-3.8/pysdd
copying pysdd/wmcstochastic.py -> build/lib.linux-ppc64le-3.8/pysdd
running egg_info
writing PySDD.egg-info/PKG-INFO
writing dependency_links to PySDD.egg-info/dependency_links.txt
writing entry points to PySDD.egg-info/entry_points.txt
writing requirements to PySDD.egg-info/requires.txt
writing top-level names to PySDD.egg-info/top_level.txt
reading manifest file 'PySDD.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'PySDD.egg-info/SOURCES.txt'
copying pysdd/compiler_c.pxd -> build/lib.linux-ppc64le-3.8/pysdd
copying pysdd/fnf_c.pxd -> build/lib.linux-ppc64le-3.8/pysdd
copying pysdd/io_c.pxd -> build/lib.linux-ppc64le-3.8/pysdd
copying pysdd/sdd.c -> build/lib.linux-ppc64le-3.8/pysdd
copying pysdd/sdd.pyx -> build/lib.linux-ppc64le-3.8/pysdd
copying pysdd/sddapi_c.pxd -> build/lib.linux-ppc64le-3.8/pysdd
creating build/lib.linux-ppc64le-3.8/pysdd/lib
creating build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0
copying pysdd/lib/libsdd-2.0/sddapi.h -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0
creating build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/build
copying pysdd/lib/libsdd-2.0/build/libsdd.a -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/build
creating build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/debug
copying pysdd/lib/libsdd-2.0/debug/libsdd.a -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/debug
creating build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/include
copying pysdd/lib/libsdd-2.0/include/iterators.h -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/include
copying pysdd/lib/libsdd-2.0/include/macros.h -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/include
copying pysdd/lib/libsdd-2.0/include/parameters.h -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/include
copying pysdd/lib/libsdd-2.0/include/sdd.h -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/include
copying pysdd/lib/libsdd-2.0/include/stacks.h -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/include
creating build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src
copying pysdd/lib/libsdd-2.0/src/util.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src
copying pysdd/lib/libsdd-2.0/src/verify.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src
copying pysdd/lib/libsdd-2.0/src/version.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src
creating build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/basic
copying pysdd/lib/libsdd-2.0/src/basic/computed.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/basic
copying pysdd/lib/libsdd-2.0/src/basic/count_and_size.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/basic
copying pysdd/lib/libsdd-2.0/src/basic/gc.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/basic
copying pysdd/lib/libsdd-2.0/src/basic/hash.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/basic
copying pysdd/lib/libsdd-2.0/src/basic/memory.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/basic
copying pysdd/lib/libsdd-2.0/src/basic/multiply.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/basic
copying pysdd/lib/libsdd-2.0/src/basic/nodes.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/basic
copying pysdd/lib/libsdd-2.0/src/basic/partitions.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/basic
copying pysdd/lib/libsdd-2.0/src/basic/references.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/basic
copying pysdd/lib/libsdd-2.0/src/basic/replace.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/basic
copying pysdd/lib/libsdd-2.0/src/basic/shadows.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/basic
copying pysdd/lib/libsdd-2.0/src/basic/sort.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/basic
creating build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/fnf
copying pysdd/lib/libsdd-2.0/src/fnf/io.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/fnf
creating build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/manager
copying pysdd/lib/libsdd-2.0/src/manager/copy.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/manager
copying pysdd/lib/libsdd-2.0/src/manager/interface.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/manager
copying pysdd/lib/libsdd-2.0/src/manager/manager.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/manager
copying pysdd/lib/libsdd-2.0/src/manager/stats.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/manager
copying pysdd/lib/libsdd-2.0/src/manager/variables.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/manager
creating build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/sdds
copying pysdd/lib/libsdd-2.0/src/sdds/apply.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/sdds
copying pysdd/lib/libsdd-2.0/src/sdds/bits.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/sdds
copying pysdd/lib/libsdd-2.0/src/sdds/cardinality.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/sdds
copying pysdd/lib/libsdd-2.0/src/sdds/condition.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/sdds
copying pysdd/lib/libsdd-2.0/src/sdds/copy.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/sdds
copying pysdd/lib/libsdd-2.0/src/sdds/count.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/sdds
copying pysdd/lib/libsdd-2.0/src/sdds/essential_vars.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/sdds
copying pysdd/lib/libsdd-2.0/src/sdds/exists.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/sdds
copying pysdd/lib/libsdd-2.0/src/sdds/exists_multiple.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/sdds
copying pysdd/lib/libsdd-2.0/src/sdds/exists_multiple_static.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/sdds
copying pysdd/lib/libsdd-2.0/src/sdds/forall.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/sdds
copying pysdd/lib/libsdd-2.0/src/sdds/io.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/sdds
copying pysdd/lib/libsdd-2.0/src/sdds/model_count.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/sdds
copying pysdd/lib/libsdd-2.0/src/sdds/rename_vars.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/sdds
copying pysdd/lib/libsdd-2.0/src/sdds/size.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/sdds
copying pysdd/lib/libsdd-2.0/src/sdds/wmc.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/sdds
creating build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/vtree_fragments
copying pysdd/lib/libsdd-2.0/src/vtree_fragments/construction.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/vtree_fragments
copying pysdd/lib/libsdd-2.0/src/vtree_fragments/moves.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/vtree_fragments
copying pysdd/lib/libsdd-2.0/src/vtree_fragments/operations.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/vtree_fragments
creating build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/vtree_operations
copying pysdd/lib/libsdd-2.0/src/vtree_operations/cartesian_product.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/vtree_operations
copying pysdd/lib/libsdd-2.0/src/vtree_operations/dissect.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/vtree_operations
copying pysdd/lib/libsdd-2.0/src/vtree_operations/limits.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/vtree_operations
copying pysdd/lib/libsdd-2.0/src/vtree_operations/op_left_rotate.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/vtree_operations
copying pysdd/lib/libsdd-2.0/src/vtree_operations/op_right_rotate.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/vtree_operations
copying pysdd/lib/libsdd-2.0/src/vtree_operations/op_swap.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/vtree_operations
copying pysdd/lib/libsdd-2.0/src/vtree_operations/rollback.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/vtree_operations
copying pysdd/lib/libsdd-2.0/src/vtree_operations/split.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/vtree_operations
copying pysdd/lib/libsdd-2.0/src/vtree_operations/vtree_ops.h -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/vtree_operations
creating build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/vtree_search
copying pysdd/lib/libsdd-2.0/src/vtree_search/auto.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/vtree_search
copying pysdd/lib/libsdd-2.0/src/vtree_search/search.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/vtree_search
copying pysdd/lib/libsdd-2.0/src/vtree_search/state.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/vtree_search
creating build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/vtrees
copying pysdd/lib/libsdd-2.0/src/vtrees/compare.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/vtrees
copying pysdd/lib/libsdd-2.0/src/vtrees/edit.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/vtrees
copying pysdd/lib/libsdd-2.0/src/vtrees/io.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/vtrees
copying pysdd/lib/libsdd-2.0/src/vtrees/maps.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/vtrees
copying pysdd/lib/libsdd-2.0/src/vtrees/moves.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/vtrees
copying pysdd/lib/libsdd-2.0/src/vtrees/static.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/vtrees
copying pysdd/lib/libsdd-2.0/src/vtrees/vtree.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/libsdd-2.0/src/vtrees
creating build/lib.linux-ppc64le-3.8/pysdd/lib/sdd-2.0
creating build/lib.linux-ppc64le-3.8/pysdd/lib/sdd-2.0/examples
creating build/lib.linux-ppc64le-3.8/pysdd/lib/sdd-2.0/examples/src
copying pysdd/lib/sdd-2.0/examples/src/circuit-gc.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/sdd-2.0/examples/src
copying pysdd/lib/sdd-2.0/examples/src/circuit.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/sdd-2.0/examples/src
copying pysdd/lib/sdd-2.0/examples/src/test-1.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/sdd-2.0/examples/src
copying pysdd/lib/sdd-2.0/examples/src/test-2.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/sdd-2.0/examples/src
copying pysdd/lib/sdd-2.0/examples/src/test-3.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/sdd-2.0/examples/src
copying pysdd/lib/sdd-2.0/examples/src/test-4.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/sdd-2.0/examples/src
copying pysdd/lib/sdd-2.0/examples/src/test-5.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/sdd-2.0/examples/src
creating build/lib.linux-ppc64le-3.8/pysdd/lib/sdd-2.0/include
copying pysdd/lib/sdd-2.0/include/compiler.h -> build/lib.linux-ppc64le-3.8/pysdd/lib/sdd-2.0/include
copying pysdd/lib/sdd-2.0/include/fnf.h -> build/lib.linux-ppc64le-3.8/pysdd/lib/sdd-2.0/include
copying pysdd/lib/sdd-2.0/include/io.h -> build/lib.linux-ppc64le-3.8/pysdd/lib/sdd-2.0/include
copying pysdd/lib/sdd-2.0/include/sddapi.h -> build/lib.linux-ppc64le-3.8/pysdd/lib/sdd-2.0/include
creating build/lib.linux-ppc64le-3.8/pysdd/lib/sdd-2.0/lib
creating build/lib.linux-ppc64le-3.8/pysdd/lib/sdd-2.0/lib/Darwin
copying pysdd/lib/sdd-2.0/lib/Darwin/libsdd.a -> build/lib.linux-ppc64le-3.8/pysdd/lib/sdd-2.0/lib/Darwin
creating build/lib.linux-ppc64le-3.8/pysdd/lib/sdd-2.0/lib/Darwin/debug
copying pysdd/lib/sdd-2.0/lib/Darwin/debug/libsdd.a -> build/lib.linux-ppc64le-3.8/pysdd/lib/sdd-2.0/lib/Darwin/debug
creating build/lib.linux-ppc64le-3.8/pysdd/lib/sdd-2.0/lib/Linux
copying pysdd/lib/sdd-2.0/lib/Linux/libsdd.a -> build/lib.linux-ppc64le-3.8/pysdd/lib/sdd-2.0/lib/Linux
copying pysdd/lib/sdd-2.0/lib/Linux/libsdd.so -> build/lib.linux-ppc64le-3.8/pysdd/lib/sdd-2.0/lib/Linux
creating build/lib.linux-ppc64le-3.8/pysdd/lib/sdd-2.0/lib/Windows
copying pysdd/lib/sdd-2.0/lib/Windows/libsdd.a -> build/lib.linux-ppc64le-3.8/pysdd/lib/sdd-2.0/lib/Windows
creating build/lib.linux-ppc64le-3.8/pysdd/lib/sdd-2.0/src
copying pysdd/lib/sdd-2.0/src/getopt.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/sdd-2.0/src
copying pysdd/lib/sdd-2.0/src/main.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/sdd-2.0/src
creating build/lib.linux-ppc64le-3.8/pysdd/lib/sdd-2.0/src/fnf
copying pysdd/lib/sdd-2.0/src/fnf/compiler.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/sdd-2.0/src/fnf
copying pysdd/lib/sdd-2.0/src/fnf/fnf.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/sdd-2.0/src/fnf
copying pysdd/lib/sdd-2.0/src/fnf/io.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/sdd-2.0/src/fnf
copying pysdd/lib/sdd-2.0/src/fnf/utils.c -> build/lib.linux-ppc64le-3.8/pysdd/lib/sdd-2.0/src/fnf
running build_ext
Compiler type: unix
Compiler name: powerpc64le-linux-gnu-gcc
--debug: 0
--usecysignals: 0
building 'pysdd.sdd' extension
creating build/temp.linux-ppc64le-3.8
creating build/temp.linux-ppc64le-3.8/pysdd
creating build/temp.linux-ppc64le-3.8/pysdd/lib
creating build/temp.linux-ppc64le-3.8/pysdd/lib/sdd-2.0
creating build/temp.linux-ppc64le-3.8/pysdd/lib/sdd-2.0/src
creating build/temp.linux-ppc64le-3.8/pysdd/lib/sdd-2.0/src/fnf
powerpc64le-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fexceptions -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -fexceptions -Ipysdd/lib/sdd-2.0/include -Ipysdd/src -Ipysdd/lib/sdd-2.0/src -Ipysdd/lib/sdd-2.0/src/fnf -fPIC -I/home/username/.local/lib/python3.8/site-packages/cysignals -I/usr/include/python3.8 -c pysdd/sdd.c -o build/temp.linux-ppc64le-3.8/pysdd/sdd.o -O3 -march=native -std=c99
powerpc64le-linux-gnu-gcc: error: unrecognized command line option ‘-march=native’; did you mean ‘-mcpu=native’?
error: command 'powerpc64le-linux-gnu-gcc' failed with exit status 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
I tried installation using: pip install pysdd
, and according to pip the installation is successful. However, I'm not able to import pysdd.sdd
, similar to this issue :
>>> from pysdd.sdd import SddManager, Vtree, WmcManager
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pysdd.sdd'
Again, importing only pysdd works :
>>> import pysdd
>>>
I tried installing libpython3-dev
and python3-dev
as mentioned here, but that didn't fix anything.
Currently the installation instruction is to pip install from GitHub, pip install pysdd
does not currently seem to work correctly for me. Can this be fixed or is there a reason behind this decision?
On Linux I get:
Could not find a version that satisfies the requirement pysdd (from versions: )
No matching distribution found for pysdd
I'm getting this error when I try to import pysdd.sdd using Python 3.7.
>>> import pysdd
>>> import pysdd.sdd
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pysdd.sdd'
>>>
But it works fine with Python3.8. Anyone know why?
When installing PySDD with pip install pysdd
I receive the following error.
clang: error: the clang compiler does not support '-march=native'
Here the full log obtained running pip install -vvv --upgrade --force-reinstall --no-deps --no-binary :all: pysdd
.
After some investigation I've discovered that it can be solved with export ARCHFLAGS="-arch x86_64"
before the installation. I don't know if this is just a workaround or if it can be considered an effective solution though.
uname -p
: i386uname -v
: Darwin Kernel Version 20.5.0: Sat May 8 05:10:33 PDT 2021; root:xnu-7195.121.3~9/RELEASE_X86_64After installing the SDD and replacing the pysdd/lib/sdd-2.0 and pysdd/lib/libsdd-2.0 , I try to build the pysdd but receive the error:
pysdd/sdd.c:639:10: fatal error: 'io.h' file not found
#include "io.h"
^~~~~~
1 error generated.
error: command 'clang' failed with exit status 1
What might be the possible cause?
Following the example you offered, i have done several trials. Below is one example.
####################
vtree = Vtree.from_file(bytes("test_sdd/test/2.vtree".encode()))
sdd = SddManager.from_vtree(vtree)
file_name = Path('./test_sdd/test/2.cnf')
root = sdd.read_cnf_file(bytes(file_name))
############################
The problem is that even the SDD file is created, its corresponding vtree structure is not the same as i provide.
So, any ideas how to fix the vtree structure and then generate the SDD file.
The terminal returns expr: syntax error
in the repository no matter what the command is.
Hi (again),
I am not sure this is a compilation problem, but I have been working with a toy problem represented by the following ex1_dimacs.txt file :
c This file was generated with the constraints_to_cnf module in this project.
c Starting from file 'ex1.sympy'.
c There are 5 variables present in the constraints, and 5 total variables, given by the shape [5].
c
p cnf 5 6
1 -2 0
1 -3 0
2 -4 0
2 -5 0
-2 -3 0
-4 -5 0
I have compiled this file using the standard command line prompt :
pysdd -c ex1_dimacs.txt -W ex1.vtree -R ex1.sdd
I have obtained the following ex1.vtree file :
c vtree number-of-nodes-in-vtree
c L id-of-leaf-vtree-node id-of-variable
c I id-of-internal-vtree-node id-of-left-child id-of-right-child
c
vtree 9
L 0 2
L 2 3
L 4 1
L 6 4
L 8 5
I 7 6 1516123455496
I 5 4 1516123455495
I 3 2 1516123455493
I 1 0 1516123455491
I am not sure this is a problem, but the "id-of-right-child" in the last four lines seem strange to me, it this normal that they are this high ?
(I have had problem processing this Vtree later that's why I believe it might be erronous)
Best regards,
The following code (adapted from the README) produces a SIGSEGV error:
from pysdd.sdd import SddManager, Vtree
vtree = Vtree(var_count=2, var_order=[1,1])
a,b = SddManager.from_vtree(vtree).vars
wmc = (a|b).wmc()
The cause is apparently the nonsencial var_order=[1,1]
. Raising a ValueError
or something would be better than crashing the entire thing.
Hi,
I have encountered some issue when trying to compile a test.txt file in dimacs format into a constraint.vtree and a constraint.sdd files using the following command line :
pysdd -c test.txt -W constraint.vtree -R constraint.sdd
I do not get any error but only the following prompt :
reading cnf...
Read CNF: vars=1860 clauses=5455
creating initial vtree balanced
creating manager...
compiling...
and then nothing else... no trace of the constraint.vtree and constraint.sdd files.
I don't think it is an installation error since I can make this command work fine on an other file dimacs.txt encoding hot one encoding for 3 variables. In this case I get :
reading cnf...
Read CNF: vars=3 clauses=23
creating initial vtree balanced
creating manager...
compiling...
compilation time : 0.000 sec
sdd size : 6
sdd node count : 3
sdd model count : 3 0.000 sec
saving compiled sdd ...done
saving vtree ...done
done
Could it be that the number of variables in test.txt is too high to be processed ? Is there any thing else about the test.txt file that could explain this bug ?
Here are both input files :
dimacs.txt
test.txt
Best regards,
Arthur
After installing with pip install pysdd
as instructed in the README, I couldn't run the example code:
>>> from pysdd.sdd import SddManager, Vtree, WmcManager
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pysdd.sdd'
However only importing pysdd worked.
I did get it to work by compiling from source and installing, but having to do this seems not ideal.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.