diff --git a/Makefile.in b/Makefile.in index 89d272e2d..f3dcf7b70 100644 --- a/Makefile.in +++ b/Makefile.in @@ -19,6 +19,7 @@ LIBS=@LIBS@ ## -lrt is for timer_create and timer_settime LDFLAGS=@LDFLAGS@ -lpthread -fopenmp LDFLAGS_EXTRA= +PREFIX=@prefix@ ######################### Z3=z3 @@ -435,3 +436,31 @@ checkgmake: @ ./gmaketest --make=$(MAKE) || \ (echo "Z3 needs GNU-Make to be built"; exit 1) +################################ +# +# installation/uninstallation +# +################################ + +install: $(BIN_DIR)/$(Z3) $(BIN_DIR)/lib$(Z3).so $(BIN_DIR)/lib$(Z3).a + @mkdir -p $(PREFIX)/bin + @mkdir -p $(PREFIX)/lib + @mkdir -p $(PREFIX)/include + @cp $(BIN_DIR)/$(Z3) $(PREFIX)/bin + @cp $(BIN_DIR)/lib$(Z3).so $(PREFIX)/lib + @cp $(BIN_DIR)/lib$(Z3).a $(PREFIX)/lib + @cp lib/z3_api.h $(PREFIX)/include + @cp lib/z3.h $(PREFIX)/include + @cp lib/z3_v1.h $(PREFIX)/include + @cp lib/z3_macros.h $(PREFIX)/include + @cp c++/z3++.h $(PREFIX)/include + +uninstall: + @rm -f $(PREFIX)/bin/$(Z3) + @rm -f $(PREFIX)/lib/lib$(Z3).so + @rm -f $(PREFIX)/lib/lib$(Z3).a + @rm -f $(PREFIX)/include/z3_api.h + @rm -f $(PREFIX)/include/z3.h + @rm -f $(PREFIX)/include/z3_v1.h + @rm -f $(PREFIX)/include/z3_macros.h + @rm -f $(PREFIX)/include/z3++.h diff --git a/README b/README index 14cf735c5..696f8e0e8 100644 --- a/README +++ b/README @@ -19,33 +19,26 @@ Z3 can be built using Visual Studio Command Prompt, Visual Studio and make/gcc. msbuild z3-prover.sln All components will be located at /debug -1) Building Z3 using g++/make +2) Building Z3 using g++/make Your machine must also have the following commands to be able to build Z3: autoconf, sed, awk, dos2unix commands - -- Open a shell -- For building the z3 executable, execute - autoconf ./configure make + sudo make install -The z3 executable will be located at bin/external/ +It will install z3 executable at /usr/local/bin, libraries at /usr/local/lib, and include files at /usr/local/include. +Use the following commands to install in a different prefix (e.g., /usr). -- If you want a static library for Z3 + autoconf + ./configure --prefix=/usr + make + sudo make install - make a +To uninstall z3, use -- If you also want the z3 shared library, execute - - make so - - for libz3.so (on Linux) - - make dylib - - for libz3.dylib (on OSX) + sudo make uninstall Remark: the Z3 makefile imports the source file list from Visual Studio project files. To add new source files to the Z3 core, you must include them at: lib/lib.vcxproj diff --git a/lib/goal.cpp b/lib/goal.cpp index 0146ac252..a84b34dd5 100644 --- a/lib/goal.cpp +++ b/lib/goal.cpp @@ -284,6 +284,30 @@ void goal::display_with_dependencies(cmd_context & ctx, std::ostream & out) cons out << "\n :precision " << prec() << " :depth " << depth() << ")" << std::endl; } +void goal::display_with_dependencies(std::ostream & out) const { + ptr_vector deps; + out << "(goal"; + unsigned sz = size(); + for (unsigned i = 0; i < sz; i++) { + out << "\n |-"; + deps.reset(); + m().linearize(dep(i), deps); + ptr_vector::iterator it = deps.begin(); + ptr_vector::iterator end = deps.end(); + for (; it != end; ++it) { + expr * d = *it; + if (is_uninterp_const(d)) { + out << " " << mk_ismt2_pp(d, m()); + } + else { + out << " #" << d->get_id(); + } + } + out << "\n " << mk_ismt2_pp(form(i), m(), 2); + } + out << "\n :precision " << prec() << " :depth " << depth() << ")" << std::endl; +} + void goal::display(cmd_context & ctx) const { display(ctx, ctx.regular_stream()); } @@ -473,7 +497,7 @@ void goal::elim_redundancies() { proof * prs[2] = { pr(get_idx(atom)), pr(i) }; p = m().mk_unit_resolution(2, prs); } - expr_dependency * d = 0; + expr_dependency_ref d(m()); if (unsat_core_enabled()) d = m().mk_join(dep(get_idx(atom)), dep(i)); push_back(m().mk_false(), p, d); @@ -490,7 +514,7 @@ void goal::elim_redundancies() { proof * prs[2] = { pr(get_not_idx(f)), pr(i) }; p = m().mk_unit_resolution(2, prs); } - expr_dependency * d = 0; + expr_dependency_ref d(m()); if (unsat_core_enabled()) d = m().mk_join(dep(get_not_idx(f)), dep(i)); push_back(m().mk_false(), p, d); diff --git a/lib/goal.h b/lib/goal.h index 9beb9421e..61c7e2081 100644 --- a/lib/goal.h +++ b/lib/goal.h @@ -180,6 +180,7 @@ public: void display_dimacs(std::ostream & out) const; void display_with_dependencies(cmd_context & ctx, std::ostream & out) const; void display_with_dependencies(cmd_context & ctx) const; + void display_with_dependencies(std::ostream & out) const; bool sat_preserved() const { return prec() == PRECISE || prec() == UNDER; diff --git a/lib/simplify_tactic.cpp b/lib/simplify_tactic.cpp index 2a912822b..a7ce0b39f 100644 --- a/lib/simplify_tactic.cpp +++ b/lib/simplify_tactic.cpp @@ -67,6 +67,7 @@ struct simplify_tactic::imp { TRACE("after_simplifier_bug", g.display(tout);); g.elim_redundancies(); TRACE("after_simplifier", g.display(tout);); + TRACE("after_simplifier_detail", g.display_with_dependencies(tout);); SASSERT(g.is_well_sorted()); }