Skip to content

Commit ccca063

Browse files
Merge branch 'master' of https://github.com/Z3Prover/z3 into csp
2 parents 6e41b85 + 695a9a6 commit ccca063

File tree

254 files changed

+1194
-1753
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

254 files changed

+1194
-1753
lines changed

CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ endif()
3434
################################################################################
3535
set(Z3_VERSION_MAJOR 4)
3636
set(Z3_VERSION_MINOR 8)
37-
set(Z3_VERSION_PATCH 0)
37+
set(Z3_VERSION_PATCH 2)
3838
set(Z3_VERSION_TWEAK 0)
3939
set(Z3_VERSION "${Z3_VERSION_MAJOR}.${Z3_VERSION_MINOR}.${Z3_VERSION_PATCH}.${Z3_VERSION_TWEAK}")
4040
set(Z3_FULL_VERSION_STR "${Z3_VERSION}") # Note this might be modified
@@ -99,7 +99,7 @@ set(GIT_DIR "${CMAKE_SOURCE_DIR}/.git")
9999
if (EXISTS "${GIT_DIR}")
100100
# Try to make CMake configure depend on the current git HEAD so that
101101
# a re-configure is triggered when the HEAD changes.
102-
add_git_dir_dependency("${GIT_DIR}" ADD_GIT_DEP_SUCCESS)
102+
add_git_dir_dependency("${CMAKE_SOURCE_DIR}" ADD_GIT_DEP_SUCCESS)
103103
if (ADD_GIT_DEP_SUCCESS)
104104
if (INCLUDE_GIT_HASH)
105105
get_git_head_hash("${GIT_DIR}" Z3GITHASH)

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ under the [MIT license](LICENSE.txt).
55

66
If you are not familiar with Z3, you can start [here](https://github.com/Z3Prover/z3/wiki#background).
77

8+
Pre-built binaries for releases are available from [here](https://github.com/Z3Prover/z3/releases),
9+
and nightly builds from [here](https://github.com/Z3Prover/bin/tree/master/nightly).
10+
811
Z3 can be built using [Visual Studio][1], a [Makefile][2] or using [CMake][3]. It provides
9-
[bindings for several programming languages][4].
12+
[bindings for several programming languages][4].
1013

1114
See the [release notes](RELEASE_NOTES) for notes on various stable releases of Z3.
1215

cmake/msvc_legacy_quirks.cmake

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
# FIXME: All the commented out defines should be removed once
99
# we are confident it is correct to not set them.
1010
set(Z3_MSVC_LEGACY_DEFINES
11-
# Don't set `_DEBUG`. The old build sytem sets this but this
11+
# Don't set `_DEBUG`. The old build system sets this but this
1212
# is wrong. MSVC will set this depending on which runtime is being used.
1313
# See https://msdn.microsoft.com/en-us/library/b0084kay.aspx
1414
# _DEBUG
1515

1616
# The old build system only set `UNICODE` and `_UNICODE` for x86_64 release.
17-
# That seems completly wrong so set it for all configurations.
17+
# That seems completely wrong so set it for all configurations.
1818
# According to https://blogs.msdn.microsoft.com/oldnewthing/20040212-00/?p=40643/
1919
# `UNICODE` affects Windows headers and `_UNICODE` affects C runtime header files.
2020
# There is some discussion of this define at https://msdn.microsoft.com/en-us/library/dybsewaf.aspx
@@ -116,7 +116,7 @@ z3_add_cxx_flag("/analyze-" REQUIRED)
116116
################################################################################
117117

118118
# By default CMake enables incremental linking for Debug and RelWithDebInfo
119-
# builds. The old build sytem disables it for all builds so try to do the same
119+
# builds. The old build system disables it for all builds so try to do the same
120120
# by changing all configurations if necessary
121121
string(TOUPPER "${available_build_types}" _build_types_as_upper)
122122
foreach (_build_type ${_build_types_as_upper})

cmake/z3_add_component.cmake

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function(z3_expand_dependencies output_var)
77
if (ARGC LESS 2)
88
message(FATAL_ERROR "Invalid number of arguments")
99
endif()
10-
# Remaing args should be component names
10+
# Remaining args should be component names
1111
set(_expanded_deps ${ARGN})
1212
set(_old_number_of_deps 0)
1313
list(LENGTH _expanded_deps _number_of_deps)
@@ -33,7 +33,7 @@ function(z3_add_component_dependencies_to_target target_name)
3333
if (NOT (TARGET ${target_name}))
3434
message(FATAL_ERROR "Target \"${target_name}\" does not exist")
3535
endif()
36-
# Remaing args should be component names
36+
# Remaining args should be component names
3737
set(_expanded_deps ${ARGN})
3838
foreach (dependency ${_expanded_deps})
3939
# Ensure this component's dependencies are built before this component.
@@ -219,7 +219,7 @@ macro(z3_add_component component_name)
219219
# Record this component's dependencies
220220
foreach (dependency ${Z3_MOD_COMPONENT_DEPENDENCIES})
221221
if (NOT (TARGET ${dependency}))
222-
message(FATAL_ERROR "Component \"${component_name}\" depends on a non existant component \"${dependency}\"")
222+
message(FATAL_ERROR "Component \"${component_name}\" depends on a non existent component \"${dependency}\"")
223223
endif()
224224
set_property(GLOBAL APPEND PROPERTY Z3_${component_name}_DEPS "${dependency}")
225225
endforeach()

contrib/ci/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Continous integration scripts
1+
# Continuous integration scripts
22

33
## TravisCI
44

@@ -45,7 +45,7 @@ the future.
4545
* `Z3_VERBOSE_BUILD_OUTPUT` - Show compile commands in CMake builds (`0` or `1`)
4646
* `Z3_STATIC_BUILD` - Build Z3 binaries and libraries statically (`0` or `1`)
4747
* `Z3_SYSTEM_TEST_GIT_REVISION` - Git revision of [z3test](https://github.com/Z3Prover/z3test). If empty lastest revision will be used.
48-
* `Z3_WARNINGS_AS_ERRORS` - Set the `WARNINGS_AS_ERRORS` CMake option pased to Z3 (`OFF`, `ON`, or `SERIOUS_ONLY`)
48+
* `Z3_WARNINGS_AS_ERRORS` - Set the `WARNINGS_AS_ERRORS` CMake option passed to Z3 (`OFF`, `ON`, or `SERIOUS_ONLY`)
4949

5050
### Linux
5151

doc/z3api.cfg.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ HTML_STYLESHEET =
944944
# user-defined cascading style sheet that is included after the standard
945945
# style sheets created by doxygen. Using this option one can overrule
946946
# certain style aspects. This is preferred over using HTML_STYLESHEET
947-
# since it does not replace the standard style sheet and is therefor more
947+
# since it does not replace the standard style sheet and is therefore more
948948
# robust against future updates. Doxygen will copy the style sheet file to
949949
# the output directory.
950950

@@ -1711,7 +1711,7 @@ UML_LOOK = NO
17111711
# the class node. If there are many fields or methods and many nodes the
17121712
# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS
17131713
# threshold limits the number of items for each type to make the size more
1714-
# managable. Set this to 0 for no limit. Note that the threshold may be
1714+
# manageable. Set this to 0 for no limit. Note that the threshold may be
17151715
# exceeded by 50% before the limit is enforced.
17161716

17171717
UML_LIMIT_NUM_FIELDS = 10

examples/c++/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ find_package(Z3
77
REQUIRED
88
CONFIG
99
# `NO_DEFAULT_PATH` is set so that -DZ3_DIR has to be passed to find Z3.
10-
# This should prevent us from accidently picking up an installed
11-
# copy of Z3. This is here to benefit Z3's build sytem when building
10+
# This should prevent us from accidentally picking up an installed
11+
# copy of Z3. This is here to benefit Z3's build system when building
1212
# this project. When making your own project you probably shouldn't
1313
# use this option.
1414
NO_DEFAULT_PATH

examples/c++/example.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,17 @@ void tst_visit() {
835835
visit(f);
836836
}
837837

838+
void tst_numeral() {
839+
context c;
840+
expr x = c.real_val("1/3");
841+
double d = 0;
842+
if (!x.is_numeral(d)) {
843+
std::cout << x << " is not recognized as a numeral\n";
844+
return;
845+
}
846+
std::cout << x << " is " << d << "\n";
847+
}
848+
838849
void incremental_example1() {
839850
std::cout << "incremental example1\n";
840851
context c;
@@ -1212,6 +1223,7 @@ int main() {
12121223
tactic_example9(); std::cout << "\n";
12131224
tactic_qe(); std::cout << "\n";
12141225
tst_visit(); std::cout << "\n";
1226+
tst_numeral(); std::cout << "\n";
12151227
incremental_example1(); std::cout << "\n";
12161228
incremental_example2(); std::cout << "\n";
12171229
incremental_example3(); std::cout << "\n";

examples/c/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ find_package(Z3
2424
REQUIRED
2525
CONFIG
2626
# `NO_DEFAULT_PATH` is set so that -DZ3_DIR has to be passed to find Z3.
27-
# This should prevent us from accidently picking up an installed
28-
# copy of Z3. This is here to benefit Z3's build sytem when building
27+
# This should prevent us from accidentally picking up an installed
28+
# copy of Z3. This is here to benefit Z3's build system when building
2929
# this project. When making your own project you probably shouldn't
3030
# use this option.
3131
NO_DEFAULT_PATH

examples/dotnet/Program.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -363,10 +363,10 @@ static void ArrayExample1(Context ctx)
363363

364364
Console.WriteLine("Model = " + s.Model);
365365

366-
Console.WriteLine("Interpretation of MyArray:\n" + s.Model.FuncInterp(aex.FuncDecl));
366+
//Console.WriteLine("Interpretation of MyArray:\n" + s.Model.ConstInterp(aex.FuncDecl));
367367
Console.WriteLine("Interpretation of x:\n" + s.Model.ConstInterp(xc));
368368
Console.WriteLine("Interpretation of f:\n" + s.Model.FuncInterp(fd));
369-
Console.WriteLine("Interpretation of MyArray as Term:\n" + s.Model.FuncInterp(aex.FuncDecl));
369+
//Console.WriteLine("Interpretation of MyArray as Term:\n" + s.Model.ConstInterp(aex.FuncDecl));
370370
}
371371

372372
/// <summary>

examples/maxsat/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ find_package(Z3
1111
REQUIRED
1212
CONFIG
1313
# `NO_DEFAULT_PATH` is set so that -DZ3_DIR has to be passed to find Z3.
14-
# This should prevent us from accidently picking up an installed
15-
# copy of Z3. This is here to benefit Z3's build sytem when building
14+
# This should prevent us from accidentally picking up an installed
15+
# copy of Z3. This is here to benefit Z3's build system when building
1616
# this project. When making your own project you probably shouldn't
1717
# use this option.
1818
NO_DEFAULT_PATH

examples/maxsat/maxsat.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ void assert_hard_constraints(Z3_context ctx, Z3_solver s, unsigned num_cnstrs, Z
138138

139139
/**
140140
\brief Assert soft constraints stored in the given array.
141-
This funtion will assert each soft-constraint C_i as (C_i or k_i) where k_i is a fresh boolean variable.
141+
This function will assert each soft-constraint C_i as (C_i or k_i) where k_i is a fresh boolean variable.
142142
It will also return an array containing these fresh variables.
143143
*/
144144
Z3_ast * assert_soft_constraints(Z3_context ctx, Z3_solver s, unsigned num_cnstrs, Z3_ast * cnstrs)
@@ -565,7 +565,7 @@ int fu_malik_maxsat(Z3_context ctx, Z3_solver s, unsigned num_hard_cnstrs, Z3_as
565565

566566
/**
567567
\brief Finds the maximal number of assumptions that can be satisfied.
568-
An assumption is any formula preceeded with the :assumption keyword.
568+
An assumption is any formula preceded with the :assumption keyword.
569569
"Hard" constraints can be supported by using the :formula keyword.
570570
571571
Input: file in SMT-LIB format, and MaxSAT algorithm to be used: 0 - Naive, 1 - Fu&Malik's algo.

examples/msf/SolverFoundation.Plugin.Z3/Z3BaseSolver.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ internal void AssertArith(int vid, ArithExpr variable)
226226
}
227227

228228
/// <summary>
229-
/// Adds a MSF variable with the coresponding assertion to the Z3 variables.
229+
/// Adds a MSF variable with the corresponding assertion to the Z3 variables.
230230
/// </summary>
231231
/// <param name="vid">The MSF id of the variable</param>
232232
internal void AddVariable(int vid)

examples/tptp/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ find_package(Z3
77
REQUIRED
88
CONFIG
99
# `NO_DEFAULT_PATH` is set so that -DZ3_DIR has to be passed to find Z3.
10-
# This should prevent us from accidently picking up an installed
11-
# copy of Z3. This is here to benefit Z3's build sytem when building
10+
# This should prevent us from accidentally picking up an installed
11+
# copy of Z3. This is here to benefit Z3's build system when building
1212
# this project. When making your own project you probably shouldn't
1313
# use this option.
1414
NO_DEFAULT_PATH

examples/tptp/tptp5.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ class env {
233233

234234
void check_arity(unsigned num_args, unsigned arity) {
235235
if (num_args != arity) {
236-
throw failure_ex("arity missmatch");
236+
throw failure_ex("arity mismatch");
237237
}
238238
}
239239

noarch/repodata.json

Whitespace-only changes.

noarch/repodata.json.bz2

14 Bytes
Binary file not shown.

scripts/mk_project.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
# Z3 Project definition
1111
def init_project_def():
12-
set_version(4, 8, 0, 0)
12+
set_version(4, 8, 2, 0)
1313
add_lib('util', [], includes2install = ['z3_version.h'])
1414
add_lib('polynomial', ['util'], 'math/polynomial')
1515
add_lib('sat', ['util'])

scripts/mk_util.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3276,7 +3276,7 @@ class MakeRuleCmd(object):
32763276
needed commands used in Makefile rules
32773277
Note that several of the method are meant for use during ``make
32783278
install`` and ``make uninstall``. These methods correctly use
3279-
``$(PREFIX)`` and ``$(DESTDIR)`` and therefore are preferrable
3279+
``$(PREFIX)`` and ``$(DESTDIR)`` and therefore are preferable
32803280
to writing commands manually which can be error prone.
32813281
"""
32823282
@classmethod

src/ackermannization/lackr.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ lbool lackr::lazy() {
220220
lackr_model_constructor mc(m_m, m_info);
221221
push_abstraction();
222222
unsigned ackr_head = 0;
223-
while (1) {
223+
while (true) {
224224
m_st.m_it++;
225225
checkpoint();
226226
TRACE("lackr", tout << "lazy check: " << m_st.m_it << "\n";);

src/ackermannization/lackr_model_constructor.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ struct lackr_model_constructor::imp {
276276
SASSERT(a->get_num_args() == 0);
277277
func_decl * const fd = a->get_decl();
278278
expr * val = m_abstr_model->get_const_interp(fd);
279-
if (val == nullptr) { // TODO: avoid model completetion?
279+
if (val == nullptr) { // TODO: avoid model completion?
280280
sort * s = fd->get_range();
281281
val = m_abstr_model->get_some_value(s);
282282
}

src/api/api_context.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ namespace api {
219219
if (m_user_ref_count) {
220220
// Corner case bug: n may be in m_last_result, and this is the only reference to n.
221221
// When, we execute reset() it is deleted
222-
// To avoid this bug, I bump the reference counter before reseting m_last_result
222+
// To avoid this bug, I bump the reference counter before resetting m_last_result
223223
ast_ref node(n, m());
224224
m_last_result.reset();
225225
m_last_result.push_back(std::move(node));

src/api/api_datalog.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ extern "C" {
210210
if (!out) {
211211
return Z3_FALSE;
212212
}
213-
// must start loggging here, since function uses Z3_get_sort_kind above
213+
// must start logging here, since function uses Z3_get_sort_kind above
214214
LOG_Z3_get_finite_domain_sort_size(c, s, out);
215215
RESET_ERROR_CODE();
216216
VERIFY(mk_c(c)->datalog_util().try_get_size(to_sort(s), *out));

0 commit comments

Comments
 (0)