mirror of
https://github.com/Z3Prover/z3
synced 2025-04-15 13:28:47 +00:00
Merge branch 'unstable' of https://git01.codeplex.com/z3 into unstable
This commit is contained in:
commit
0906fd9d9c
|
@ -55,6 +55,8 @@ Version 4.3.2
|
||||||
|
|
||||||
- Fixed bug reported at http://stackoverflow.com/questions/14307692/unknown-when-using-defs
|
- Fixed bug reported at http://stackoverflow.com/questions/14307692/unknown-when-using-defs
|
||||||
|
|
||||||
|
- Relax check_logic procedure. Now, it accepts coercions (to_real) automatically introduced by Z3. (Thanks to Paul Jackson). This is a fix for http://z3.codeplex.com/workitem/19.
|
||||||
|
|
||||||
Version 4.3.1
|
Version 4.3.1
|
||||||
=============
|
=============
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,8 @@ Revision History:
|
||||||
#include"scoped_timer.h"
|
#include"scoped_timer.h"
|
||||||
#include"pp_params.hpp"
|
#include"pp_params.hpp"
|
||||||
|
|
||||||
|
extern bool is_numeral_sort(Z3_context c, Z3_sort ty);
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
Z3_symbol Z3_API Z3_mk_int_symbol(Z3_context c, int i) {
|
Z3_symbol Z3_API Z3_mk_int_symbol(Z3_context c, int i) {
|
||||||
|
@ -313,8 +315,6 @@ extern "C" {
|
||||||
Z3_CATCH_RETURN("");
|
Z3_CATCH_RETURN("");
|
||||||
}
|
}
|
||||||
|
|
||||||
extern bool is_numeral_sort(Z3_context c, Z3_sort ty);
|
|
||||||
|
|
||||||
Z3_ast_kind Z3_API Z3_get_ast_kind(Z3_context c, Z3_ast a) {
|
Z3_ast_kind Z3_API Z3_get_ast_kind(Z3_context c, Z3_ast a) {
|
||||||
Z3_TRY;
|
Z3_TRY;
|
||||||
LOG_Z3_get_ast_kind(c, a);
|
LOG_Z3_get_ast_kind(c, a);
|
||||||
|
|
|
@ -43,7 +43,7 @@ extern "C" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Z3_API Z3_global_param_reset_all() {
|
void Z3_API Z3_global_param_reset_all(void) {
|
||||||
memory::initialize(UINT_MAX);
|
memory::initialize(UINT_MAX);
|
||||||
LOG_Z3_global_param_reset_all();
|
LOG_Z3_global_param_reset_all();
|
||||||
gparams::reset();
|
gparams::reset();
|
||||||
|
@ -71,7 +71,7 @@ extern "C" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Z3_config Z3_API Z3_mk_config() {
|
Z3_config Z3_API Z3_mk_config(void) {
|
||||||
memory::initialize(UINT_MAX);
|
memory::initialize(UINT_MAX);
|
||||||
LOG_Z3_mk_config();
|
LOG_Z3_mk_config();
|
||||||
Z3_config r = reinterpret_cast<Z3_config>(alloc(context_params));
|
Z3_config r = reinterpret_cast<Z3_config>(alloc(context_params));
|
||||||
|
|
|
@ -44,7 +44,7 @@ extern "C" {
|
||||||
_Z3_append_log(static_cast<char const *>(str));
|
_Z3_append_log(static_cast<char const *>(str));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Z3_API Z3_close_log() {
|
void Z3_API Z3_close_log(void) {
|
||||||
if (g_z3_log != 0) {
|
if (g_z3_log != 0) {
|
||||||
dealloc(g_z3_log);
|
dealloc(g_z3_log);
|
||||||
g_z3_log_enabled = false;
|
g_z3_log_enabled = false;
|
||||||
|
|
|
@ -24,27 +24,27 @@ Revision History:
|
||||||
#include"bv_decl_plugin.h"
|
#include"bv_decl_plugin.h"
|
||||||
#include"algebraic_numbers.h"
|
#include"algebraic_numbers.h"
|
||||||
|
|
||||||
|
bool is_numeral_sort(Z3_context c, Z3_sort ty) {
|
||||||
|
sort * _ty = to_sort(ty);
|
||||||
|
family_id fid = _ty->get_family_id();
|
||||||
|
if (fid != mk_c(c)->get_arith_fid() &&
|
||||||
|
fid != mk_c(c)->get_bv_fid() &&
|
||||||
|
fid != mk_c(c)->get_datalog_fid()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool check_numeral_sort(Z3_context c, Z3_sort ty) {
|
||||||
|
bool is_num = is_numeral_sort(c, ty);
|
||||||
|
if (!is_num) {
|
||||||
|
SET_ERROR_CODE(Z3_INVALID_ARG);
|
||||||
|
}
|
||||||
|
return is_num;
|
||||||
|
}
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
bool is_numeral_sort(Z3_context c, Z3_sort ty) {
|
|
||||||
sort * _ty = to_sort(ty);
|
|
||||||
family_id fid = _ty->get_family_id();
|
|
||||||
if (fid != mk_c(c)->get_arith_fid() &&
|
|
||||||
fid != mk_c(c)->get_bv_fid() &&
|
|
||||||
fid != mk_c(c)->get_datalog_fid()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool check_numeral_sort(Z3_context c, Z3_sort ty) {
|
|
||||||
bool is_num = is_numeral_sort(c, ty);
|
|
||||||
if (!is_num) {
|
|
||||||
SET_ERROR_CODE(Z3_INVALID_ARG);
|
|
||||||
}
|
|
||||||
return is_num;
|
|
||||||
}
|
|
||||||
|
|
||||||
Z3_ast Z3_API Z3_mk_numeral(Z3_context c, const char* n, Z3_sort ty) {
|
Z3_ast Z3_API Z3_mk_numeral(Z3_context c, const char* n, Z3_sort ty) {
|
||||||
Z3_TRY;
|
Z3_TRY;
|
||||||
LOG_Z3_mk_numeral(c, n, ty);
|
LOG_Z3_mk_numeral(c, n, ty);
|
||||||
|
|
|
@ -1644,11 +1644,6 @@ namespace z3 {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template class z3::ast_vector_tpl<z3::ast>;
|
|
||||||
template class z3::ast_vector_tpl<z3::expr>;
|
|
||||||
template class z3::ast_vector_tpl<z3::sort>;
|
|
||||||
template class z3::ast_vector_tpl<z3::func_decl>;
|
|
||||||
|
|
||||||
/*@}*/
|
/*@}*/
|
||||||
/*@}*/
|
/*@}*/
|
||||||
|
|
||||||
|
|
|
@ -1274,7 +1274,7 @@ extern "C" {
|
||||||
|
|
||||||
def_API('Z3_global_param_reset_all', VOID, ())
|
def_API('Z3_global_param_reset_all', VOID, ())
|
||||||
*/
|
*/
|
||||||
void Z3_API Z3_global_param_reset_all();
|
void Z3_API Z3_global_param_reset_all(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Get a global (or module) parameter.
|
\brief Get a global (or module) parameter.
|
||||||
|
@ -1335,7 +1335,7 @@ extern "C" {
|
||||||
|
|
||||||
def_API('Z3_mk_config', CONFIG, ())
|
def_API('Z3_mk_config', CONFIG, ())
|
||||||
*/
|
*/
|
||||||
Z3_config Z3_API Z3_mk_config();
|
Z3_config Z3_API Z3_mk_config(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Delete the given configuration object.
|
\brief Delete the given configuration object.
|
||||||
|
@ -4765,7 +4765,7 @@ END_MLAPI_EXCLUDE
|
||||||
|
|
||||||
extra_API('Z3_close_log', VOID, ())
|
extra_API('Z3_close_log', VOID, ())
|
||||||
*/
|
*/
|
||||||
void Z3_API Z3_close_log();
|
void Z3_API Z3_close_log(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Enable/disable printing warning messages to the console.
|
\brief Enable/disable printing warning messages to the console.
|
||||||
|
|
|
@ -228,6 +228,9 @@ struct check_logic::imp {
|
||||||
bool is_int(expr * t) {
|
bool is_int(expr * t) {
|
||||||
if (m_a_util.is_uminus(t))
|
if (m_a_util.is_uminus(t))
|
||||||
t = to_app(t)->get_arg(0);
|
t = to_app(t)->get_arg(0);
|
||||||
|
// Take care of coercions automatically added by Z3
|
||||||
|
if (m_a_util.is_to_real(t))
|
||||||
|
t = to_app(t)->get_arg(0);
|
||||||
return m_a_util.is_numeral(t);
|
return m_a_util.is_numeral(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue