mirror of
https://github.com/Z3Prover/z3
synced 2025-06-06 14:13:23 +00:00
Merge branch 'master' of https://github.com/Z3Prover/z3
This commit is contained in:
commit
fa6f9b4a37
14 changed files with 45 additions and 33 deletions
|
@ -3,6 +3,7 @@ z3_add_component(core_tactics
|
||||||
blast_term_ite_tactic.cpp
|
blast_term_ite_tactic.cpp
|
||||||
cofactor_elim_term_ite.cpp
|
cofactor_elim_term_ite.cpp
|
||||||
cofactor_term_ite_tactic.cpp
|
cofactor_term_ite_tactic.cpp
|
||||||
|
collect_statistics_tactic.cpp
|
||||||
ctx_simplify_tactic.cpp
|
ctx_simplify_tactic.cpp
|
||||||
der_tactic.cpp
|
der_tactic.cpp
|
||||||
distribute_forall_tactic.cpp
|
distribute_forall_tactic.cpp
|
||||||
|
|
|
@ -37,7 +37,7 @@ extern "C" {
|
||||||
catch (z3_exception & ex) {
|
catch (z3_exception & ex) {
|
||||||
// The error handler is only available for contexts
|
// The error handler is only available for contexts
|
||||||
// Just throw a warning.
|
// Just throw a warning.
|
||||||
warning_msg(ex.msg());
|
warning_msg("%s", ex.msg());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ extern "C" {
|
||||||
catch (z3_exception & ex) {
|
catch (z3_exception & ex) {
|
||||||
// The error handler is only available for contexts
|
// The error handler is only available for contexts
|
||||||
// Just throw a warning.
|
// Just throw a warning.
|
||||||
warning_msg(ex.msg());
|
warning_msg("%s", ex.msg());
|
||||||
return Z3_FALSE;
|
return Z3_FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@ extern "C" {
|
||||||
catch (z3_exception & ex) {
|
catch (z3_exception & ex) {
|
||||||
// The error handler is only available for contexts
|
// The error handler is only available for contexts
|
||||||
// Just throw a warning.
|
// Just throw a warning.
|
||||||
warning_msg(ex.msg());
|
warning_msg("%s", ex.msg());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1965,7 +1965,7 @@ bool ast_manager::check_sorts(ast const * n) const {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch (ast_exception & ex) {
|
catch (ast_exception & ex) {
|
||||||
warning_msg(ex.msg());
|
warning_msg("%s", ex.msg());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,10 +67,8 @@ struct bv_trailing::imp {
|
||||||
}
|
}
|
||||||
expr_ref out1(m);
|
expr_ref out1(m);
|
||||||
expr_ref out2(m);
|
expr_ref out2(m);
|
||||||
DEBUG_CODE(
|
VERIFY(min == remove_trailing(e1, min, out1, TRAILING_DEPTH));
|
||||||
const unsigned rm1 = remove_trailing(e1, min, out1, TRAILING_DEPTH);
|
VERIFY(min == remove_trailing(e2, min, out2, TRAILING_DEPTH));
|
||||||
const unsigned rm2 = remove_trailing(e2, min, out2, TRAILING_DEPTH);
|
|
||||||
SASSERT(rm1 == min && rm2 == min););
|
|
||||||
const bool are_eq = m.are_equal(out1, out2);
|
const bool are_eq = m.are_equal(out1, out2);
|
||||||
result = are_eq ? m.mk_true() : m.mk_eq(out1, out2);
|
result = are_eq ? m.mk_true() : m.mk_eq(out1, out2);
|
||||||
return are_eq ? BR_DONE : BR_REWRITE2;
|
return are_eq ? BR_DONE : BR_REWRITE2;
|
||||||
|
|
|
@ -66,7 +66,7 @@ struct well_sorted_proc {
|
||||||
strm << "Expected sort: " << mk_pp(expected_sort, m_manager) << "\n";
|
strm << "Expected sort: " << mk_pp(expected_sort, m_manager) << "\n";
|
||||||
strm << "Actual sort: " << mk_pp(actual_sort, m_manager) << "\n";
|
strm << "Actual sort: " << mk_pp(actual_sort, m_manager) << "\n";
|
||||||
strm << "Function sort: " << mk_pp(decl, m_manager) << ".";
|
strm << "Function sort: " << mk_pp(decl, m_manager) << ".";
|
||||||
warning_msg(strm.str().c_str());
|
warning_msg("%s", strm.str().c_str());
|
||||||
m_error = true;
|
m_error = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,7 +109,12 @@ namespace pdr {
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (found) m_stats.m_hits++; m_stats.m_miss++;
|
if (found) {
|
||||||
|
m_stats.m_hits++;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
m_stats.m_miss++;
|
||||||
|
}
|
||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -391,7 +391,7 @@ namespace datalog {
|
||||||
std::ostringstream buffer;
|
std::ostringstream buffer;
|
||||||
buffer << "creating large table of size " << upper_bound;
|
buffer << "creating large table of size " << upper_bound;
|
||||||
if (p) buffer << " for relation " << p->get_name();
|
if (p) buffer << " for relation " << p->get_name();
|
||||||
warning_msg(buffer.str().c_str());
|
warning_msg("%s", buffer.str().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
for(table_element i = 0; i < upper_bound; i++) {
|
for(table_element i = 0; i < upper_bound; i++) {
|
||||||
|
|
|
@ -1034,7 +1034,7 @@ namespace smt2 {
|
||||||
else {
|
else {
|
||||||
std::ostringstream str;
|
std::ostringstream str;
|
||||||
str << "unknown attribute " << id;
|
str << "unknown attribute " << id;
|
||||||
warning_msg(str.str().c_str());
|
warning_msg("%s", str.str().c_str());
|
||||||
next();
|
next();
|
||||||
// just consume the
|
// just consume the
|
||||||
consume_sexpr();
|
consume_sexpr();
|
||||||
|
|
|
@ -24,9 +24,11 @@ namespace smt2 {
|
||||||
void scanner::next() {
|
void scanner::next() {
|
||||||
if (m_cache_input)
|
if (m_cache_input)
|
||||||
m_cache.push_back(m_curr);
|
m_cache.push_back(m_curr);
|
||||||
SASSERT(m_curr != EOF);
|
SASSERT(!m_at_eof);
|
||||||
if (m_interactive) {
|
if (m_interactive) {
|
||||||
m_curr = m_stream.get();
|
m_curr = m_stream.get();
|
||||||
|
if (m_stream.eof())
|
||||||
|
m_at_eof = true;
|
||||||
}
|
}
|
||||||
else if (m_bpos < m_bend) {
|
else if (m_bpos < m_bend) {
|
||||||
m_curr = m_buffer[m_bpos];
|
m_curr = m_buffer[m_bpos];
|
||||||
|
@ -37,7 +39,7 @@ namespace smt2 {
|
||||||
m_bend = static_cast<unsigned>(m_stream.gcount());
|
m_bend = static_cast<unsigned>(m_stream.gcount());
|
||||||
m_bpos = 0;
|
m_bpos = 0;
|
||||||
if (m_bpos == m_bend) {
|
if (m_bpos == m_bend) {
|
||||||
m_curr = EOF;
|
m_at_eof = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_curr = m_buffer[m_bpos];
|
m_curr = m_buffer[m_bpos];
|
||||||
|
@ -52,7 +54,7 @@ namespace smt2 {
|
||||||
next();
|
next();
|
||||||
while (true) {
|
while (true) {
|
||||||
char c = curr();
|
char c = curr();
|
||||||
if (c == EOF)
|
if (m_at_eof)
|
||||||
return;
|
return;
|
||||||
if (c == '\n') {
|
if (c == '\n') {
|
||||||
new_line();
|
new_line();
|
||||||
|
@ -70,7 +72,7 @@ namespace smt2 {
|
||||||
next();
|
next();
|
||||||
while (true) {
|
while (true) {
|
||||||
char c = curr();
|
char c = curr();
|
||||||
if (c == EOF) {
|
if (m_at_eof) {
|
||||||
throw scanner_exception("unexpected end of quoted symbol", m_line, m_spos);
|
throw scanner_exception("unexpected end of quoted symbol", m_line, m_spos);
|
||||||
}
|
}
|
||||||
else if (c == '\n') {
|
else if (c == '\n') {
|
||||||
|
@ -167,7 +169,7 @@ namespace smt2 {
|
||||||
m_string.reset();
|
m_string.reset();
|
||||||
while (true) {
|
while (true) {
|
||||||
char c = curr();
|
char c = curr();
|
||||||
if (c == EOF)
|
if (m_at_eof)
|
||||||
throw scanner_exception("unexpected end of string", m_line, m_spos);
|
throw scanner_exception("unexpected end of string", m_line, m_spos);
|
||||||
if (c == '\n') {
|
if (c == '\n') {
|
||||||
new_line();
|
new_line();
|
||||||
|
@ -241,6 +243,7 @@ namespace smt2 {
|
||||||
m_interactive(interactive),
|
m_interactive(interactive),
|
||||||
m_spos(0),
|
m_spos(0),
|
||||||
m_curr(0), // avoid Valgrind warning
|
m_curr(0), // avoid Valgrind warning
|
||||||
|
m_at_eof(false),
|
||||||
m_line(1),
|
m_line(1),
|
||||||
m_pos(0),
|
m_pos(0),
|
||||||
m_bv_size(UINT_MAX),
|
m_bv_size(UINT_MAX),
|
||||||
|
@ -292,6 +295,10 @@ namespace smt2 {
|
||||||
while (true) {
|
while (true) {
|
||||||
signed char c = curr();
|
signed char c = curr();
|
||||||
m_pos = m_spos;
|
m_pos = m_spos;
|
||||||
|
|
||||||
|
if (m_at_eof)
|
||||||
|
return EOF_TOKEN;
|
||||||
|
|
||||||
switch (m_normalized[(unsigned char) c]) {
|
switch (m_normalized[(unsigned char) c]) {
|
||||||
case ' ':
|
case ' ':
|
||||||
next();
|
next();
|
||||||
|
@ -327,8 +334,6 @@ namespace smt2 {
|
||||||
return read_symbol();
|
return read_symbol();
|
||||||
else
|
else
|
||||||
return read_signed_number();
|
return read_signed_number();
|
||||||
case -1:
|
|
||||||
return EOF_TOKEN;
|
|
||||||
default: {
|
default: {
|
||||||
scanner_exception ex("unexpected character", m_line, m_spos);
|
scanner_exception ex("unexpected character", m_line, m_spos);
|
||||||
next();
|
next();
|
||||||
|
|
|
@ -34,6 +34,7 @@ namespace smt2 {
|
||||||
bool m_interactive;
|
bool m_interactive;
|
||||||
int m_spos; // position in the current line of the stream
|
int m_spos; // position in the current line of the stream
|
||||||
char m_curr; // current char;
|
char m_curr; // current char;
|
||||||
|
bool m_at_eof;
|
||||||
|
|
||||||
int m_line; // line
|
int m_line; // line
|
||||||
int m_pos; // start position of the token
|
int m_pos; // start position of the token
|
||||||
|
|
|
@ -691,7 +691,10 @@ namespace smt {
|
||||||
m_rw.reset();
|
m_rw.reset();
|
||||||
m_th_rw.reset();
|
m_th_rw.reset();
|
||||||
m_trail_stack.pop_scope(m_trail_stack.get_num_scopes());
|
m_trail_stack.pop_scope(m_trail_stack.get_num_scopes());
|
||||||
if (m_factory) dealloc(m_factory); m_factory = 0;
|
if (m_factory) {
|
||||||
|
dealloc(m_factory);
|
||||||
|
m_factory = 0;
|
||||||
|
}
|
||||||
ast_manager & m = get_manager();
|
ast_manager & m = get_manager();
|
||||||
dec_ref_map_key_values(m, m_conversions);
|
dec_ref_map_key_values(m, m_conversions);
|
||||||
dec_ref_collection_values(m, m_is_added_to_model);
|
dec_ref_collection_values(m, m_is_added_to_model);
|
||||||
|
|
|
@ -250,7 +250,7 @@ namespace smt {
|
||||||
std::stringstream msg;
|
std::stringstream msg;
|
||||||
msg << "found non utvpi logic expression:\n" << mk_pp(n, get_manager()) << "\n";
|
msg << "found non utvpi logic expression:\n" << mk_pp(n, get_manager()) << "\n";
|
||||||
TRACE("utvpi", tout << msg.str(););
|
TRACE("utvpi", tout << msg.str(););
|
||||||
warning_msg(msg.str().c_str());
|
warning_msg("%s", msg.str().c_str());
|
||||||
get_context().push_trail(value_trail<context, bool>(m_non_utvpi_exprs));
|
get_context().push_trail(value_trail<context, bool>(m_non_utvpi_exprs));
|
||||||
m_non_utvpi_exprs = true;
|
m_non_utvpi_exprs = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,4 +167,3 @@ void warning_msg(const char * msg, ...) {
|
||||||
va_end(args);
|
va_end(args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue