Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

common module not found for python interface (when importing z3util) #67

Closed
g2graman opened this issue May 4, 2015 · 2 comments
Closed

Comments

@g2graman
Copy link

g2graman commented May 4, 2015

After cloning the repository and a successful build, I moved a script named get_proof.py into the build directory and invoked it. Note that my only imports from get_proof.py are

from z3 import *
from z3util import *

but even after a successful build, importing z3util fails. The following is the traceback from invoking get_proof.py:

$ python get_proof.py
Traceback (most recent call last):
  File "get_proof.py", line 2, in <module>
    from z3util import *
  File ".../z3/build/z3util.py", line 6, in <module>
    import common as CM
ImportError: No module named common
@g2graman
Copy link
Author

g2graman commented May 4, 2015

Update:

$ find . -name '*common*'
./z3/build-dist/util/common_msgs.o
./z3/build-dist/util/common_msgs.h.node
./z3/build/util/common_msgs.o
./z3/build/util/common_msgs.h.node
./z3/src/util/common_msgs.cpp
./z3/src/util/common_msgs.h

Conclusion: the repository is missing the module. After searching for a bit I think I've found it, since the author's name, as cited by @leodemoura in this StackOverflow answer, matches that of this google code repository. So, I believe the common module is really the same as this file from the last link, before it was renamed to vu_common.py

In case anybody is reading this in hopes of a quick fix, here is my build script:

#!/bin/bash

Z3_BUILD_DIR='z3'
if [[ -z "${Z3_BUILD_DIR-}" ]] || [ ! -d "$Z3_BUILD_DIR" ]; then
    git clone https://github.com/Z3Prover/z3.git
    cd z3

    CXX=clang++ CC=clang python scripts/mk_make.py --prefix=`readlink -f ~`
    cd build
    make

    Z3_BUILD_DIR=$(pwd)
    export Z3_BUILD_DIR=$Z3_BUILD_DIR

    curl -o common.py https://raw.githubusercontent.com/g2graman/common-python-vu/master/vu_common.py
    cd ../..
fi

Note the use of curl near the bottom. Its purpose is to download the necessary module from my mirror of the google code repository and save it to common.py

wintersteiger pushed a commit that referenced this issue May 4, 2015
@wintersteiger
Copy link
Contributor

Thanks for figuring out all the details of this problem! I removed the external import by adding the vset function and it now works fine for me. The fix is currently only available in the contrib branch, but it will be import into master soon.

NikolajBjorner added a commit to NikolajBjorner/z3 that referenced this issue May 31, 2018
* log quantifiers only if present

Signed-off-by: Nikolaj Bjorner <[email protected]>

* merge and fix some warnings

Signed-off-by: Nikolaj Bjorner <[email protected]>

* set new arith as default for LIA

Signed-off-by: Nikolaj Bjorner <[email protected]>
NikolajBjorner pushed a commit to NikolajBjorner/z3 that referenced this issue Jun 29, 2018
Signed-off-by: Lev Nachmanson <[email protected]>

exit earlier on a large matrix in hnf_cutter

Signed-off-by: Lev Nachmanson <[email protected]>

call hnf only for the boundary points

Signed-off-by: Lev Nachmanson <[email protected]>

fix a bug in hnf_cutter initialization

Signed-off-by: Lev Nachmanson <[email protected]>

initialize has_bounds in lar_solver::get_equality_for_term_on_corrent_x

Signed-off-by: Lev Nachmanson <[email protected]>

initialize has_bounds in lar_solver::get_equality_for_term_on_corrent_x

Signed-off-by: Lev Nachmanson <[email protected]>

initialize has_bounds in lar_solver::get_equality_for_term_on_corrent_x

Signed-off-by: Lev Nachmanson <[email protected]>

initialize has_bounds in lar_solver::get_equality_for_term_on_corrent_x

Signed-off-by: Lev Nachmanson <[email protected]>

fixes in determinant_of_rectangular_matrix calculations

Signed-off-by: Lev Nachmanson <[email protected]>

changes in debug code

Signed-off-by: Lev Nachmanson <[email protected]>

init m_hnf_cut_period from globals settings

Signed-off-by: Lev Nachmanson <[email protected]>

fix some warnings

Signed-off-by: Lev Nachmanson <[email protected]>

Lev2 (Z3Prover#66)

* log quantifiers only if present

Signed-off-by: Nikolaj Bjorner <[email protected]>

* merge and fix some warnings

Signed-off-by: Nikolaj Bjorner <[email protected]>

remove a comment

Signed-off-by: Lev Nachmanson <[email protected]>

simplify gomory cut return's logic

Signed-off-by: Lev Nachmanson <[email protected]>

simplify uniformly int_solver::check()

Signed-off-by: Lev Nachmanson <[email protected]>

making new arith solver default for LIA (Z3Prover#67)

* log quantifiers only if present

Signed-off-by: Nikolaj Bjorner <[email protected]>

* merge and fix some warnings

Signed-off-by: Nikolaj Bjorner <[email protected]>

* set new arith as default for LIA

Signed-off-by: Nikolaj Bjorner <[email protected]>

remove chase_cut_solver

Signed-off-by: Lev Nachmanson <[email protected]>

remove integer_domain

Signed-off-by: Lev Nachmanson <[email protected]>

restore call for find_cube()

Signed-off-by: Lev Nachmanson <[email protected]>

remove a method

Signed-off-by: Lev Nachmanson <[email protected]>

remove some debug code

Signed-off-by: Lev Nachmanson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants