mirror of
https://github.com/Z3Prover/z3
synced 2025-04-12 04:03:39 +00:00
use std::exception as base class to z3_exception
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
1957b4d991
commit
92065462b4
|
@ -36,7 +36,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("%s", ex.msg());
|
warning_msg("%s", ex.what());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +59,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("%s", ex.msg());
|
warning_msg("%s", ex.what());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,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("%s", ex.msg());
|
warning_msg("%s", ex.what());
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,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("%s", ex.msg());
|
warning_msg("%s", ex.what());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -306,7 +306,7 @@ namespace api {
|
||||||
set_error_code(Z3_MEMOUT_FAIL, nullptr);
|
set_error_code(Z3_MEMOUT_FAIL, nullptr);
|
||||||
break;
|
break;
|
||||||
case ERR_PARSER:
|
case ERR_PARSER:
|
||||||
set_error_code(Z3_PARSER_ERROR, ex.msg());
|
set_error_code(Z3_PARSER_ERROR, ex.what());
|
||||||
break;
|
break;
|
||||||
case ERR_INI_FILE:
|
case ERR_INI_FILE:
|
||||||
set_error_code(Z3_INVALID_ARG, nullptr);
|
set_error_code(Z3_INVALID_ARG, nullptr);
|
||||||
|
@ -320,7 +320,7 @@ namespace api {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
set_error_code(Z3_EXCEPTION, ex.msg());
|
set_error_code(Z3_EXCEPTION, ex.what());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -168,7 +168,7 @@ extern "C" {
|
||||||
}
|
}
|
||||||
r = l_undef;
|
r = l_undef;
|
||||||
if (!mk_c(c)->m().inc()) {
|
if (!mk_c(c)->m().inc()) {
|
||||||
to_optimize_ptr(o)->set_reason_unknown(ex.msg());
|
to_optimize_ptr(o)->set_reason_unknown(ex.what());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mk_c(c)->handle_exception(ex);
|
mk_c(c)->handle_exception(ex);
|
||||||
|
@ -364,7 +364,7 @@ extern "C" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (z3_exception& e) {
|
catch (z3_exception& e) {
|
||||||
errstrm << e.msg();
|
errstrm << e.what();
|
||||||
ctx = nullptr;
|
ctx = nullptr;
|
||||||
SET_ERROR_CODE(Z3_PARSER_ERROR, errstrm.str());
|
SET_ERROR_CODE(Z3_PARSER_ERROR, errstrm.str());
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -144,7 +144,7 @@ extern "C" {
|
||||||
catch (z3_exception& e) {
|
catch (z3_exception& e) {
|
||||||
if (owned)
|
if (owned)
|
||||||
ctx = nullptr;
|
ctx = nullptr;
|
||||||
errstrm << e.msg();
|
errstrm << e.what();
|
||||||
SET_ERROR_CODE(Z3_PARSER_ERROR, errstrm.str());
|
SET_ERROR_CODE(Z3_PARSER_ERROR, errstrm.str());
|
||||||
return of_ast_vector(v);
|
return of_ast_vector(v);
|
||||||
}
|
}
|
||||||
|
@ -257,7 +257,7 @@ extern "C" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (z3_exception& e) {
|
catch (z3_exception& e) {
|
||||||
if (ous.str().empty()) ous << e.msg();
|
if (ous.str().empty()) ous << e.what();
|
||||||
SET_ERROR_CODE(Z3_PARSER_ERROR, ous.str());
|
SET_ERROR_CODE(Z3_PARSER_ERROR, ous.str());
|
||||||
RETURN_Z3(mk_c(c)->mk_external_string(ous.str()));
|
RETURN_Z3(mk_c(c)->mk_external_string(ous.str()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -533,7 +533,7 @@ struct z3_replayer::imp {
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
catch (z3_exception & ex) {
|
catch (z3_exception & ex) {
|
||||||
std::cout << "[z3 exception]: " << ex.msg() << std::endl;
|
std::cout << "[z3 exception]: " << ex.what() << std::endl;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2080,7 +2080,7 @@ bool ast_manager::check_sorts(ast const * n) const {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch (ast_exception & ex) {
|
catch (ast_exception & ex) {
|
||||||
warning_msg("%s", ex.msg());
|
warning_msg("%s", ex.what());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@ namespace sat {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (z3_exception& ex) {
|
catch (z3_exception& ex) {
|
||||||
IF_VERBOSE(0, verbose_stream() << "Exception: " << ex.msg() << "\n");
|
IF_VERBOSE(0, verbose_stream() << "Exception: " << ex.what() << "\n");
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
m_plugin->finish_search();
|
m_plugin->finish_search();
|
||||||
|
|
|
@ -439,7 +439,7 @@ class set_option_cmd : public set_get_option_cmd {
|
||||||
ctx.global_params_updated();
|
ctx.global_params_updated();
|
||||||
}
|
}
|
||||||
catch (const gparams::exception & ex) {
|
catch (const gparams::exception & ex) {
|
||||||
throw cmd_exception(ex.msg());
|
throw cmd_exception(ex.what());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1605,7 +1605,7 @@ void cmd_context::push() {
|
||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
catch (z3_exception & ex) {
|
catch (z3_exception & ex) {
|
||||||
throw cmd_exception(ex.msg());
|
throw cmd_exception(ex.what());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1768,7 +1768,7 @@ void cmd_context::check_sat(unsigned num_assumptions, expr * const * assumptions
|
||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
catch (z3_exception & ex) {
|
catch (z3_exception & ex) {
|
||||||
throw cmd_exception(ex.msg());
|
throw cmd_exception(ex.what());
|
||||||
}
|
}
|
||||||
get_opt()->set_status(r);
|
get_opt()->set_status(r);
|
||||||
}
|
}
|
||||||
|
@ -1793,7 +1793,7 @@ void cmd_context::check_sat(unsigned num_assumptions, expr * const * assumptions
|
||||||
m_solver->set_reason_unknown(eh);
|
m_solver->set_reason_unknown(eh);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_solver->set_reason_unknown(ex.msg());
|
m_solver->set_reason_unknown(ex.what());
|
||||||
}
|
}
|
||||||
r = l_undef;
|
r = l_undef;
|
||||||
}
|
}
|
||||||
|
@ -1832,7 +1832,7 @@ void cmd_context::get_consequences(expr_ref_vector const& assumptions, expr_ref_
|
||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
catch (z3_exception & ex) {
|
catch (z3_exception & ex) {
|
||||||
m_solver->set_reason_unknown(ex.msg());
|
m_solver->set_reason_unknown(ex.what());
|
||||||
r = l_undef;
|
r = l_undef;
|
||||||
}
|
}
|
||||||
m_solver->set_status(r);
|
m_solver->set_status(r);
|
||||||
|
|
|
@ -86,7 +86,7 @@ public:
|
||||||
ev(m_target, r);
|
ev(m_target, r);
|
||||||
}
|
}
|
||||||
catch (model_evaluator_exception & ex) {
|
catch (model_evaluator_exception & ex) {
|
||||||
ctx.regular_stream() << "(error \"evaluator failed: " << ex.msg() << "\")" << std::endl;
|
ctx.regular_stream() << "(error \"evaluator failed: " << ex.what() << "\")" << std::endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,7 +89,7 @@ public:
|
||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
catch (z3_exception & ex) {
|
catch (z3_exception & ex) {
|
||||||
ctx.regular_stream() << "(error \"simplifier failed: " << ex.msg() << "\")" << std::endl;
|
ctx.regular_stream() << "(error \"simplifier failed: " << ex.what() << "\")" << std::endl;
|
||||||
failed = true;
|
failed = true;
|
||||||
r = m_target;
|
r = m_target;
|
||||||
}
|
}
|
||||||
|
|
|
@ -227,8 +227,8 @@ public:
|
||||||
}
|
}
|
||||||
catch (z3_exception & ex) {
|
catch (z3_exception & ex) {
|
||||||
result->set_status(l_undef);
|
result->set_status(l_undef);
|
||||||
result->m_unknown = ex.msg();
|
result->m_unknown = ex.what();
|
||||||
ctx.regular_stream() << "(error \"tactic failed: " << ex.msg() << "\")" << std::endl;
|
ctx.regular_stream() << "(error \"tactic failed: " << ex.what() << "\")" << std::endl;
|
||||||
}
|
}
|
||||||
ctx.validate_check_sat_result(r);
|
ctx.validate_check_sat_result(r);
|
||||||
}
|
}
|
||||||
|
@ -321,7 +321,7 @@ public:
|
||||||
exec(t, g, result_goals);
|
exec(t, g, result_goals);
|
||||||
}
|
}
|
||||||
catch (tactic_exception & ex) {
|
catch (tactic_exception & ex) {
|
||||||
ctx.regular_stream() << "(error \"tactic failed: " << ex.msg() << "\")" << std::endl;
|
ctx.regular_stream() << "(error \"tactic failed: " << ex.what() << "\")" << std::endl;
|
||||||
failed = true;
|
failed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -252,7 +252,7 @@ public:
|
||||||
}
|
}
|
||||||
catch (z3_exception & ex) {
|
catch (z3_exception & ex) {
|
||||||
// convert all Z3 exceptions into tactic exceptions
|
// convert all Z3 exceptions into tactic exceptions
|
||||||
throw tactic_exception(ex.msg());
|
throw tactic_exception(ex.what());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,7 @@ bool model::eval_expr(expr * e, expr_ref & result, bool model_completion) {
|
||||||
}
|
}
|
||||||
catch (model_evaluator_exception & ex) {
|
catch (model_evaluator_exception & ex) {
|
||||||
(void)ex;
|
(void)ex;
|
||||||
TRACE("model_evaluator", tout << ex.msg() << "\n";);
|
TRACE("model_evaluator", tout << ex.what() << "\n";);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -853,7 +853,7 @@ bool model_evaluator::eval(expr* t, expr_ref& r, bool model_completion) {
|
||||||
}
|
}
|
||||||
catch (model_evaluator_exception &ex) {
|
catch (model_evaluator_exception &ex) {
|
||||||
(void)ex;
|
(void)ex;
|
||||||
TRACE("model_evaluator", tout << ex.msg () << "\n";);
|
TRACE("model_evaluator", tout << ex.what () << "\n";);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -545,7 +545,7 @@ protected:
|
||||||
result = tok == TK_EOS && m_error == false;
|
result = tok == TK_EOS && m_error == false;
|
||||||
}
|
}
|
||||||
catch (z3_exception& ex) {
|
catch (z3_exception& ex) {
|
||||||
std::cerr << ex.msg() << std::endl;
|
std::cerr << ex.what() << std::endl;
|
||||||
result = false;
|
result = false;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
@ -1225,7 +1225,7 @@ public:
|
||||||
result = parse_directory_core(path);
|
result = parse_directory_core(path);
|
||||||
}
|
}
|
||||||
catch (z3_exception& ex) {
|
catch (z3_exception& ex) {
|
||||||
std::cerr << ex.msg() << std::endl;
|
std::cerr << ex.what() << std::endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -264,12 +264,12 @@ public:
|
||||||
status = dlctx.rel_query(1, &m_target);
|
status = dlctx.rel_query(1, &m_target);
|
||||||
}
|
}
|
||||||
catch (z3_error & ex) {
|
catch (z3_error & ex) {
|
||||||
ctx.regular_stream() << "(error \"query failed: " << ex.msg() << "\")" << std::endl;
|
ctx.regular_stream() << "(error \"query failed: " << ex.what() << "\")" << std::endl;
|
||||||
print_statistics(ctx);
|
print_statistics(ctx);
|
||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
catch (z3_exception& ex) {
|
catch (z3_exception& ex) {
|
||||||
ctx.regular_stream() << "(error \"query failed: " << ex.msg() << "\")" << std::endl;
|
ctx.regular_stream() << "(error \"query failed: " << ex.what() << "\")" << std::endl;
|
||||||
query_exn = true;
|
query_exn = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -255,7 +255,7 @@ class horn_tactic : public tactic {
|
||||||
is_reachable = m_ctx.query(q);
|
is_reachable = m_ctx.query(q);
|
||||||
}
|
}
|
||||||
catch (default_exception& ex) {
|
catch (default_exception& ex) {
|
||||||
IF_VERBOSE(1, verbose_stream() << ex.msg() << "\n";);
|
IF_VERBOSE(1, verbose_stream() << ex.what() << "\n";);
|
||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
g->inc_depth();
|
g->inc_depth();
|
||||||
|
|
|
@ -249,7 +249,7 @@ public:
|
||||||
}
|
}
|
||||||
catch (z3_exception & ex) {
|
catch (z3_exception & ex) {
|
||||||
// convert all Z3 exceptions into tactic exceptions.
|
// convert all Z3 exceptions into tactic exceptions.
|
||||||
throw tactic_exception(ex.msg());
|
throw tactic_exception(ex.what());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -214,7 +214,7 @@ namespace opt {
|
||||||
is_sat = (*m_msolver)();
|
is_sat = (*m_msolver)();
|
||||||
}
|
}
|
||||||
catch (z3_exception& ex) {
|
catch (z3_exception& ex) {
|
||||||
IF_VERBOSE(1, verbose_stream() << ex.msg() << "\n");
|
IF_VERBOSE(1, verbose_stream() << ex.what() << "\n");
|
||||||
is_sat = l_undef;
|
is_sat = l_undef;
|
||||||
}
|
}
|
||||||
if (is_sat != l_false) {
|
if (is_sat != l_false) {
|
||||||
|
|
|
@ -375,7 +375,7 @@ namespace smt2 {
|
||||||
}
|
}
|
||||||
catch (scanner_exception & ex) {
|
catch (scanner_exception & ex) {
|
||||||
if (ex.has_pos())
|
if (ex.has_pos())
|
||||||
error(ex.line(), ex.pos(), ex.msg());
|
error(ex.line(), ex.pos(), ex.what());
|
||||||
++num_errors;
|
++num_errors;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3146,7 +3146,7 @@ namespace smt2 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (z3_exception & ex) {
|
catch (z3_exception & ex) {
|
||||||
error(ex.msg());
|
error(ex.what());
|
||||||
}
|
}
|
||||||
return sexpr_ref(nullptr, sm());
|
return sexpr_ref(nullptr, sm());
|
||||||
}
|
}
|
||||||
|
@ -3162,7 +3162,7 @@ namespace smt2 {
|
||||||
return sort_ref(sort_stack().back(), m());
|
return sort_ref(sort_stack().back(), m());
|
||||||
}
|
}
|
||||||
catch (z3_exception & ex) {
|
catch (z3_exception & ex) {
|
||||||
error(ex.msg());
|
error(ex.what());
|
||||||
}
|
}
|
||||||
return sort_ref(nullptr, m());
|
return sort_ref(nullptr, m());
|
||||||
}
|
}
|
||||||
|
@ -3176,7 +3176,7 @@ namespace smt2 {
|
||||||
scan_core();
|
scan_core();
|
||||||
}
|
}
|
||||||
catch (scanner_exception & ex) {
|
catch (scanner_exception & ex) {
|
||||||
error(ex.msg());
|
error(ex.what());
|
||||||
if (!sync_after_error())
|
if (!sync_after_error())
|
||||||
return false;
|
return false;
|
||||||
found_errors++;
|
found_errors++;
|
||||||
|
@ -3202,7 +3202,7 @@ namespace smt2 {
|
||||||
// Can't invoke error(...) when out of memory.
|
// Can't invoke error(...) when out of memory.
|
||||||
// Reason: escaped() string builder needs memory
|
// Reason: escaped() string builder needs memory
|
||||||
m_ctx.regular_stream() << "(error \"line " << m_scanner.get_line() << " column " << m_scanner.get_pos()
|
m_ctx.regular_stream() << "(error \"line " << m_scanner.get_line() << " column " << m_scanner.get_pos()
|
||||||
<< ": " << ex.msg() << "\")" << std::endl;
|
<< ": " << ex.what() << "\")" << std::endl;
|
||||||
exit(ex.error_code());
|
exit(ex.error_code());
|
||||||
}
|
}
|
||||||
catch (const stop_parser_exception &) {
|
catch (const stop_parser_exception &) {
|
||||||
|
@ -3211,15 +3211,15 @@ namespace smt2 {
|
||||||
}
|
}
|
||||||
catch (parser_exception & ex) {
|
catch (parser_exception & ex) {
|
||||||
if (ex.has_pos())
|
if (ex.has_pos())
|
||||||
error(ex.line(), ex.pos(), ex.msg());
|
error(ex.line(), ex.pos(), ex.what());
|
||||||
else
|
else
|
||||||
error(ex.msg());
|
error(ex.what());
|
||||||
}
|
}
|
||||||
catch (ast_exception & ex) {
|
catch (ast_exception & ex) {
|
||||||
error(ex.msg());
|
error(ex.what());
|
||||||
}
|
}
|
||||||
catch (z3_exception & ex) {
|
catch (z3_exception & ex) {
|
||||||
error(ex.msg());
|
error(ex.what());
|
||||||
}
|
}
|
||||||
m_scanner.stop_caching();
|
m_scanner.stop_caching();
|
||||||
if (m_curr_cmd)
|
if (m_curr_cmd)
|
||||||
|
|
|
@ -1564,7 +1564,7 @@ namespace sat {
|
||||||
ex_kind = ERROR_EX;
|
ex_kind = ERROR_EX;
|
||||||
}
|
}
|
||||||
catch (z3_exception & ex) {
|
catch (z3_exception & ex) {
|
||||||
ex_msg = ex.msg();
|
ex_msg = ex.what();
|
||||||
ex_kind = DEFAULT_EX;
|
ex_kind = DEFAULT_EX;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -227,10 +227,10 @@ public:
|
||||||
r = m_solver.check(m_asms.size(), m_asms.data());
|
r = m_solver.check(m_asms.size(), m_asms.data());
|
||||||
}
|
}
|
||||||
catch (z3_exception& ex) {
|
catch (z3_exception& ex) {
|
||||||
IF_VERBOSE(1, verbose_stream() << "exception: " << ex.msg() << "\n";);
|
IF_VERBOSE(1, verbose_stream() << "exception: " << ex.what() << "\n";);
|
||||||
if (m.inc()) {
|
if (m.inc()) {
|
||||||
reason_set = true;
|
reason_set = true;
|
||||||
set_reason_unknown(std::string("(sat.giveup ") + ex.msg() + ')');
|
set_reason_unknown(std::string("(sat.giveup ") + ex.what() + ')');
|
||||||
}
|
}
|
||||||
r = l_undef;
|
r = l_undef;
|
||||||
}
|
}
|
||||||
|
@ -779,9 +779,9 @@ private:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (tactic_exception & ex) {
|
catch (tactic_exception & ex) {
|
||||||
IF_VERBOSE(1, verbose_stream() << "exception in tactic " << ex.msg() << "\n";);
|
IF_VERBOSE(1, verbose_stream() << "exception in tactic " << ex.what() << "\n";);
|
||||||
set_reason_unknown(ex.msg());
|
set_reason_unknown(ex.what());
|
||||||
TRACE("sat", tout << "exception: " << ex.msg() << "\n";);
|
TRACE("sat", tout << "exception: " << ex.what() << "\n";);
|
||||||
m_preprocess = nullptr;
|
m_preprocess = nullptr;
|
||||||
m_bb_rewriter = nullptr;
|
m_bb_rewriter = nullptr;
|
||||||
return l_undef;
|
return l_undef;
|
||||||
|
|
|
@ -183,9 +183,9 @@ public:
|
||||||
r = m_solver.check(m_dep.m_literals);
|
r = m_solver.check(m_dep.m_literals);
|
||||||
}
|
}
|
||||||
catch (z3_exception& ex) {
|
catch (z3_exception& ex) {
|
||||||
IF_VERBOSE(1, verbose_stream() << "exception: " << ex.msg() << "\n";);
|
IF_VERBOSE(1, verbose_stream() << "exception: " << ex.what() << "\n";);
|
||||||
if (m.inc()) {
|
if (m.inc()) {
|
||||||
set_reason_unknown(std::string("(sat.giveup ") + ex.msg() + ')');
|
set_reason_unknown(std::string("(sat.giveup ") + ex.what() + ')');
|
||||||
return l_undef;
|
return l_undef;
|
||||||
}
|
}
|
||||||
r = l_undef;
|
r = l_undef;
|
||||||
|
|
|
@ -243,12 +243,12 @@ public:
|
||||||
}
|
}
|
||||||
catch (sat::solver_exception & ex) {
|
catch (sat::solver_exception & ex) {
|
||||||
proc.m_solver->collect_statistics(m_stats);
|
proc.m_solver->collect_statistics(m_stats);
|
||||||
throw tactic_exception(ex.msg());
|
throw tactic_exception(ex.what());
|
||||||
}
|
}
|
||||||
catch (z3_exception& ex) {
|
catch (z3_exception& ex) {
|
||||||
(void)ex;
|
(void)ex;
|
||||||
proc.m_solver->collect_statistics(m_stats);
|
proc.m_solver->collect_statistics(m_stats);
|
||||||
TRACE("sat", tout << ex.msg() << "\n";);
|
TRACE("sat", tout << ex.what() << "\n";);
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
TRACE("sat_stats", m_stats.display_smt2(tout););
|
TRACE("sat_stats", m_stats.display_smt2(tout););
|
||||||
|
|
|
@ -416,7 +416,7 @@ int STD_CALL main(int argc, char ** argv) {
|
||||||
}
|
}
|
||||||
catch (z3_exception & ex) {
|
catch (z3_exception & ex) {
|
||||||
// unhandled exception
|
// unhandled exception
|
||||||
std::cerr << "ERROR: " << ex.msg() << "\n";
|
std::cerr << "ERROR: " << ex.what() << "\n";
|
||||||
if (ex.has_error_code())
|
if (ex.has_error_code())
|
||||||
return ex.error_code();
|
return ex.error_code();
|
||||||
else
|
else
|
||||||
|
|
|
@ -134,7 +134,7 @@ static unsigned parse_opt(std::istream& in, opt_format f) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (z3_exception & ex) {
|
catch (z3_exception & ex) {
|
||||||
std::cerr << ex.msg() << "\n";
|
std::cerr << ex.what() << "\n";
|
||||||
}
|
}
|
||||||
display_statistics();
|
display_statistics();
|
||||||
display_model();
|
display_model();
|
||||||
|
|
|
@ -31,7 +31,7 @@ static void solve(char const * stream_name, std::istream & in) {
|
||||||
r.parse();
|
r.parse();
|
||||||
}
|
}
|
||||||
catch (z3_exception & ex) {
|
catch (z3_exception & ex) {
|
||||||
std::cerr << "Error at line " << r.get_line() << ": " << ex.msg() << std::endl;
|
std::cerr << "Error at line " << r.get_line() << ": " << ex.what() << std::endl;
|
||||||
}
|
}
|
||||||
clock_t end_time = clock();
|
clock_t end_time = clock();
|
||||||
memory::display_max_usage(std::cout);
|
memory::display_max_usage(std::cout);
|
||||||
|
|
|
@ -96,7 +96,7 @@ bool proto_model::eval(expr * e, expr_ref & result, bool model_completion) {
|
||||||
}
|
}
|
||||||
catch (model_evaluator_exception & ex) {
|
catch (model_evaluator_exception & ex) {
|
||||||
(void)ex;
|
(void)ex;
|
||||||
TRACE("model_evaluator", tout << ex.msg() << "\n";);
|
TRACE("model_evaluator", tout << ex.what() << "\n";);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -198,7 +198,7 @@ namespace smt {
|
||||||
}
|
}
|
||||||
catch (z3_exception & ex) {
|
catch (z3_exception & ex) {
|
||||||
if (finished_id == UINT_MAX) {
|
if (finished_id == UINT_MAX) {
|
||||||
ex_msg = ex.msg();
|
ex_msg = ex.what();
|
||||||
ex_kind = DEFAULT_EX;
|
ex_kind = DEFAULT_EX;
|
||||||
done = true;
|
done = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -310,7 +310,7 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (rewriter_exception & ex) {
|
catch (rewriter_exception & ex) {
|
||||||
throw tactic_exception(ex.msg());
|
throw tactic_exception(ex.what());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -959,7 +959,7 @@ namespace smt {
|
||||||
return internalize_term_core(term);
|
return internalize_term_core(term);
|
||||||
}
|
}
|
||||||
catch (z3_exception& ex) {
|
catch (z3_exception& ex) {
|
||||||
IF_VERBOSE(1, verbose_stream() << "internalize_term: " << ex.msg() << "\n";);
|
IF_VERBOSE(1, verbose_stream() << "internalize_term: " << ex.what() << "\n";);
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -202,7 +202,7 @@ public:
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
set_reason_unknown(ex.msg());
|
set_reason_unknown(ex.what());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return l_undef;
|
return l_undef;
|
||||||
|
|
|
@ -710,7 +710,7 @@ private:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (z3_exception& ex) {
|
catch (z3_exception& ex) {
|
||||||
IF_VERBOSE(1, verbose_stream() << ex.msg() << "\n";);
|
IF_VERBOSE(1, verbose_stream() << ex.what() << "\n";);
|
||||||
if (m_queue.in_shutdown()) return;
|
if (m_queue.in_shutdown()) return;
|
||||||
m_queue.shutdown();
|
m_queue.shutdown();
|
||||||
std::lock_guard<std::mutex> lock(m_mutex);
|
std::lock_guard<std::mutex> lock(m_mutex);
|
||||||
|
@ -718,7 +718,7 @@ private:
|
||||||
m_exn_code = ex.error_code();
|
m_exn_code = ex.error_code();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_exn_msg = ex.msg();
|
m_exn_msg = ex.what();
|
||||||
m_exn_code = -1;
|
m_exn_code = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,7 +95,7 @@ lbool solver::get_consequences(expr_ref_vector const& asms, expr_ref_vector cons
|
||||||
return l_undef;
|
return l_undef;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
set_reason_unknown(ex.msg());
|
set_reason_unknown(ex.what());
|
||||||
}
|
}
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/*++
|
/*++ Copyright (c) 2012 Microsoft Corporation
|
||||||
Copyright (c) 2012 Microsoft Corporation
|
|
||||||
|
|
||||||
Module Name:
|
Module Name:
|
||||||
|
|
||||||
|
@ -270,14 +269,14 @@ lbool tactic2solver::check_sat_core2(unsigned num_assumptions, expr * const * as
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (z3_error & ex) {
|
catch (z3_error & ex) {
|
||||||
TRACE("tactic2solver", tout << "exception: " << ex.msg() << "\n";);
|
TRACE("tactic2solver", tout << "exception: " << ex.what() << "\n";);
|
||||||
m_result->m_proof = pr;
|
m_result->m_proof = pr;
|
||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
catch (z3_exception & ex) {
|
catch (z3_exception & ex) {
|
||||||
TRACE("tactic2solver", tout << "exception: " << ex.msg() << "\n";);
|
TRACE("tactic2solver", tout << "exception: " << ex.what() << "\n";);
|
||||||
m_result->set_status(l_undef);
|
m_result->set_status(l_undef);
|
||||||
m_result->m_unknown = ex.msg();
|
m_result->m_unknown = ex.what();
|
||||||
m_result->m_proof = pr;
|
m_result->m_proof = pr;
|
||||||
}
|
}
|
||||||
m_tactic->collect_statistics(m_result->m_stats);
|
m_tactic->collect_statistics(m_result->m_stats);
|
||||||
|
|
|
@ -316,7 +316,7 @@ public:
|
||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
catch (z3_exception & ex) {
|
catch (z3_exception & ex) {
|
||||||
throw tactic_exception(ex.msg());
|
throw tactic_exception(ex.what());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -317,7 +317,7 @@ public:
|
||||||
(*m_imp)(in, result);
|
(*m_imp)(in, result);
|
||||||
}
|
}
|
||||||
catch (rewriter_exception & ex) {
|
catch (rewriter_exception & ex) {
|
||||||
throw tactic_exception(ex.msg());
|
throw tactic_exception(ex.what());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -325,7 +325,7 @@ public:
|
||||||
(*m_imp)(in, result);
|
(*m_imp)(in, result);
|
||||||
}
|
}
|
||||||
catch (rewriter_exception & ex) {
|
catch (rewriter_exception & ex) {
|
||||||
throw tactic_exception(ex.msg());
|
throw tactic_exception(ex.what());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -169,7 +169,7 @@ public:
|
||||||
(*m_imp)(in, result);
|
(*m_imp)(in, result);
|
||||||
}
|
}
|
||||||
catch (rewriter_exception & ex) {
|
catch (rewriter_exception & ex) {
|
||||||
throw tactic_exception(ex.msg());
|
throw tactic_exception(ex.what());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -937,7 +937,7 @@ public:
|
||||||
result.push_back(g.get());
|
result.push_back(g.get());
|
||||||
}
|
}
|
||||||
catch (rewriter_exception & ex) {
|
catch (rewriter_exception & ex) {
|
||||||
throw tactic_exception(ex.msg());
|
throw tactic_exception(ex.what());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -416,7 +416,7 @@ public:
|
||||||
(*m_imp)(g, result);
|
(*m_imp)(g, result);
|
||||||
}
|
}
|
||||||
catch (rewriter_exception & ex) {
|
catch (rewriter_exception & ex) {
|
||||||
throw tactic_exception(ex.msg());
|
throw tactic_exception(ex.what());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -141,7 +141,7 @@ public:
|
||||||
(*m_imp)(g, result);
|
(*m_imp)(g, result);
|
||||||
}
|
}
|
||||||
catch (rewriter_exception & ex) {
|
catch (rewriter_exception & ex) {
|
||||||
throw tactic_exception(ex.msg());
|
throw tactic_exception(ex.what());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -238,7 +238,7 @@ public:
|
||||||
run(in, result);
|
run(in, result);
|
||||||
}
|
}
|
||||||
catch (rewriter_exception & ex) {
|
catch (rewriter_exception & ex) {
|
||||||
throw tactic_exception(ex.msg());
|
throw tactic_exception(ex.what());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,7 @@ void simplify_tactic::operator()(goal_ref const & in,
|
||||||
m_clean = false;
|
m_clean = false;
|
||||||
}
|
}
|
||||||
catch (rewriter_exception & ex) {
|
catch (rewriter_exception & ex) {
|
||||||
throw tactic_exception(ex.msg());
|
throw tactic_exception(ex.what());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -129,7 +129,7 @@ public:
|
||||||
m_simp->reduce();
|
m_simp->reduce();
|
||||||
}
|
}
|
||||||
catch (rewriter_exception& ex) {
|
catch (rewriter_exception& ex) {
|
||||||
throw tactic_exception(ex.msg());
|
throw tactic_exception(ex.what());
|
||||||
}
|
}
|
||||||
m_goal->elim_true();
|
m_goal->elim_true();
|
||||||
m_goal->elim_redundancies();
|
m_goal->elim_redundancies();
|
||||||
|
|
|
@ -136,7 +136,7 @@ public:
|
||||||
(*m_imp)(in, result);
|
(*m_imp)(in, result);
|
||||||
}
|
}
|
||||||
catch (rewriter_exception & ex) {
|
catch (rewriter_exception & ex) {
|
||||||
throw tactic_exception(ex.msg());
|
throw tactic_exception(ex.what());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -196,7 +196,7 @@ void exec(tactic & t, goal_ref const & in, goal_ref_buffer & result) {
|
||||||
t.cleanup();
|
t.cleanup();
|
||||||
}
|
}
|
||||||
catch (tactic_exception & ex) {
|
catch (tactic_exception & ex) {
|
||||||
IF_VERBOSE(TACTIC_VERBOSITY_LVL, verbose_stream() << "(tactic-exception \"" << escaped(ex.msg()) << "\")\n");
|
IF_VERBOSE(TACTIC_VERBOSITY_LVL, verbose_stream() << "(tactic-exception \"" << escaped(ex.what()) << "\")\n");
|
||||||
t.cleanup();
|
t.cleanup();
|
||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
|
@ -215,7 +215,7 @@ lbool check_sat(tactic & t, goal_ref & g, model_ref & md, labels_vec & labels, p
|
||||||
exec(t, g, r);
|
exec(t, g, r);
|
||||||
}
|
}
|
||||||
catch (z3_exception & ex) {
|
catch (z3_exception & ex) {
|
||||||
reason_unknown = ex.msg();
|
reason_unknown = ex.what();
|
||||||
if (r.size() > 0) pr = r[0]->pr(0);
|
if (r.size() > 0) pr = r[0]->pr(0);
|
||||||
return l_undef;
|
return l_undef;
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ protected:
|
||||||
std::string m_msg;
|
std::string m_msg;
|
||||||
public:
|
public:
|
||||||
tactic_exception(std::string && msg) : m_msg(std::move(msg)) {}
|
tactic_exception(std::string && msg) : m_msg(std::move(msg)) {}
|
||||||
char const * msg() const override { return m_msg.c_str(); }
|
char const * what() const override { return m_msg.c_str(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
#define TACTIC_CANCELED_MSG Z3_CANCELED_MSG
|
#define TACTIC_CANCELED_MSG Z3_CANCELED_MSG
|
||||||
|
|
|
@ -362,7 +362,7 @@ public:
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
catch (z3_exception& ex) {
|
catch (z3_exception& ex) {
|
||||||
IF_VERBOSE(10, verbose_stream() << ex.msg() << " in or-else\n");
|
IF_VERBOSE(10, verbose_stream() << ex.what() << " in or-else\n");
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
catch (const std::exception &ex) {
|
catch (const std::exception &ex) {
|
||||||
|
@ -546,7 +546,7 @@ public:
|
||||||
catch (tactic_exception & ex) {
|
catch (tactic_exception & ex) {
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
ex_kind = TACTIC_EX;
|
ex_kind = TACTIC_EX;
|
||||||
ex_msg = ex.msg();
|
ex_msg = ex.what();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (z3_error & err) {
|
catch (z3_error & err) {
|
||||||
|
@ -558,7 +558,7 @@ public:
|
||||||
catch (z3_exception & z3_ex) {
|
catch (z3_exception & z3_ex) {
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
ex_kind = DEFAULT_EX;
|
ex_kind = DEFAULT_EX;
|
||||||
ex_msg = z3_ex.msg();
|
ex_msg = z3_ex.what();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -703,7 +703,7 @@ public:
|
||||||
curr_failed = true;
|
curr_failed = true;
|
||||||
failed = true;
|
failed = true;
|
||||||
ex_kind = TACTIC_EX;
|
ex_kind = TACTIC_EX;
|
||||||
ex_msg = ex.msg();
|
ex_msg = ex.what();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -725,7 +725,7 @@ public:
|
||||||
curr_failed = true;
|
curr_failed = true;
|
||||||
failed = true;
|
failed = true;
|
||||||
ex_kind = DEFAULT_EX;
|
ex_kind = DEFAULT_EX;
|
||||||
ex_msg = z3_ex.msg();
|
ex_msg = z3_ex.what();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,24 +19,23 @@ Revision History:
|
||||||
#include<iostream>
|
#include<iostream>
|
||||||
#include "util/z3_exception.h"
|
#include "util/z3_exception.h"
|
||||||
|
|
||||||
class ex {
|
class ex : public std::exception {
|
||||||
public:
|
public:
|
||||||
virtual ~ex() = default;
|
virtual ~ex() = default;
|
||||||
virtual char const * msg() const = 0;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class ex1 : public ex {
|
class ex1 : public ex {
|
||||||
char const * m_msg;
|
char const * m_msg;
|
||||||
public:
|
public:
|
||||||
ex1(char const * m):m_msg(m) {}
|
ex1(char const * m):m_msg(m) {}
|
||||||
char const * msg() const override { return m_msg; }
|
char const * what() const override { return m_msg; }
|
||||||
};
|
};
|
||||||
|
|
||||||
class ex2 : public ex {
|
class ex2 : public ex {
|
||||||
std::string m_msg;
|
std::string m_msg;
|
||||||
public:
|
public:
|
||||||
ex2(char const * m):m_msg(m) {}
|
ex2(char const * m):m_msg(m) {}
|
||||||
char const * msg() const override { return m_msg.c_str(); }
|
char const * what() const override { return m_msg.c_str(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
static void th() {
|
static void th() {
|
||||||
|
@ -48,7 +47,7 @@ static void tst1() {
|
||||||
th();
|
th();
|
||||||
}
|
}
|
||||||
catch (ex & e) {
|
catch (ex & e) {
|
||||||
std::cerr << e.msg() << "\n";
|
std::cerr << e.what() << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,7 +56,7 @@ static void tst2() {
|
||||||
throw default_exception(default_exception::fmt(), "Format %d %s", 12, "twelve");
|
throw default_exception(default_exception::fmt(), "Format %d %s", 12, "twelve");
|
||||||
}
|
}
|
||||||
catch (z3_exception& ex) {
|
catch (z3_exception& ex) {
|
||||||
std::cerr << ex.msg() << "\n";
|
std::cerr << ex.what() << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -134,7 +134,7 @@ void parse_cmd_line_args(int argc, char ** argv, bool& do_display_usage, bool& t
|
||||||
gparams::set(key, value);
|
gparams::set(key, value);
|
||||||
}
|
}
|
||||||
catch (z3_exception& ex) {
|
catch (z3_exception& ex) {
|
||||||
std::cerr << ex.msg() << "\n";
|
std::cerr << ex.what() << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
|
|
|
@ -38,7 +38,7 @@ static void tst1() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (const z3_exception & ex) {
|
catch (const z3_exception & ex) {
|
||||||
std::cout << ex.msg() << "\n";
|
std::cout << ex.what() << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -926,6 +926,6 @@ void tst_udoc_relation() {
|
||||||
tester.test1();
|
tester.test1();
|
||||||
}
|
}
|
||||||
catch (z3_exception& ex) {
|
catch (z3_exception& ex) {
|
||||||
std::cout << ex.msg() << "\n";
|
std::cout << ex.what() << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ static void tst1() {
|
||||||
v1.resize(i);
|
v1.resize(i);
|
||||||
}
|
}
|
||||||
catch (z3_exception& e) {
|
catch (z3_exception& e) {
|
||||||
std::cout << e.msg() << "\n";
|
std::cout << e.what() << "\n";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
i *= 2;
|
i *= 2;
|
||||||
|
|
|
@ -29,7 +29,7 @@ Revision History:
|
||||||
|
|
||||||
|
|
||||||
class overflow_exception : public z3_exception {
|
class overflow_exception : public z3_exception {
|
||||||
char const* msg() const override { return "checked_int64 overflow/underflow"; }
|
char const* what() const override { return "checked_int64 overflow/underflow"; }
|
||||||
};
|
};
|
||||||
|
|
||||||
template<bool CHECK>
|
template<bool CHECK>
|
||||||
|
@ -364,4 +364,4 @@ inline checked_int64<CHECK> gcd(checked_int64<CHECK> const& a, checked_int64<CHE
|
||||||
lasty = temp;
|
lasty = temp;
|
||||||
}
|
}
|
||||||
return _a;
|
return _a;
|
||||||
}
|
}
|
||||||
|
|
|
@ -182,15 +182,15 @@ public:
|
||||||
static bool field() { return true; }
|
static bool field() { return true; }
|
||||||
|
|
||||||
class exception : public z3_exception {
|
class exception : public z3_exception {
|
||||||
char const * msg() const override { return "multi-precision floating point (mpff) exception"; }
|
char const * what() const override { return "multi-precision floating point (mpff) exception"; }
|
||||||
};
|
};
|
||||||
|
|
||||||
class overflow_exception : public exception {
|
class overflow_exception : public exception {
|
||||||
char const * msg() const override { return "multi-precision floating point (mpff) overflow"; }
|
char const * what() const override { return "multi-precision floating point (mpff) overflow"; }
|
||||||
};
|
};
|
||||||
|
|
||||||
class div0_exception : public exception {
|
class div0_exception : public exception {
|
||||||
char const * msg() const override { return "multi-precision floating point (mpff) division by zero"; }
|
char const * what() const override { return "multi-precision floating point (mpff) division by zero"; }
|
||||||
};
|
};
|
||||||
|
|
||||||
mpff_manager(unsigned prec = 2, unsigned initial_capacity = 1024);
|
mpff_manager(unsigned prec = 2, unsigned initial_capacity = 1024);
|
||||||
|
|
|
@ -129,15 +129,15 @@ public:
|
||||||
static bool field() { return true; }
|
static bool field() { return true; }
|
||||||
|
|
||||||
class exception : public z3_exception {
|
class exception : public z3_exception {
|
||||||
char const * msg() const override { return "multi-precision fixed point (mpfx) exception"; }
|
char const * what() const override { return "multi-precision fixed point (mpfx) exception"; }
|
||||||
};
|
};
|
||||||
|
|
||||||
class overflow_exception : public exception {
|
class overflow_exception : public exception {
|
||||||
char const * msg() const override { return "multi-precision fixed point (mpfx) overflow"; }
|
char const * what() const override { return "multi-precision fixed point (mpfx) overflow"; }
|
||||||
};
|
};
|
||||||
|
|
||||||
class div0_exception : public exception {
|
class div0_exception : public exception {
|
||||||
char const * msg() const override { return "multi-precision fixed point (mpfx) division by zero"; }
|
char const * what() const override { return "multi-precision fixed point (mpfx) division by zero"; }
|
||||||
};
|
};
|
||||||
|
|
||||||
mpfx_manager(unsigned int_sz = 2, unsigned frac_sz = 1, unsigned initial_capacity = 1024);
|
mpfx_manager(unsigned int_sz = 2, unsigned frac_sz = 1, unsigned initial_capacity = 1024);
|
||||||
|
|
|
@ -35,7 +35,7 @@ z3_error::z3_error(unsigned error_code):m_error_code(error_code) {
|
||||||
SASSERT(error_code != 0);
|
SASSERT(error_code != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
char const * z3_error::msg() const {
|
char const * z3_error::what() const {
|
||||||
switch (m_error_code) {
|
switch (m_error_code) {
|
||||||
case ERR_MEMOUT: return "out of memory";
|
case ERR_MEMOUT: return "out of memory";
|
||||||
case ERR_TIMEOUT: return "timeout";
|
case ERR_TIMEOUT: return "timeout";
|
||||||
|
@ -67,6 +67,6 @@ default_exception::default_exception(fmt, char const* msg, ...) {
|
||||||
m_msg = out.str();
|
m_msg = out.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
char const * default_exception::msg() const {
|
char const * default_exception::what() const {
|
||||||
return m_msg.c_str();
|
return m_msg.c_str();
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,11 +19,11 @@ Notes:
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include<string>
|
#include<string>
|
||||||
|
#include<exception>
|
||||||
|
|
||||||
class z3_exception {
|
class z3_exception : public std::exception {
|
||||||
public:
|
public:
|
||||||
virtual ~z3_exception() = default;
|
virtual ~z3_exception() = default;
|
||||||
virtual char const * msg() const = 0;
|
|
||||||
virtual unsigned error_code() const;
|
virtual unsigned error_code() const;
|
||||||
bool has_error_code() const;
|
bool has_error_code() const;
|
||||||
};
|
};
|
||||||
|
@ -32,7 +32,7 @@ class z3_error : public z3_exception {
|
||||||
unsigned m_error_code;
|
unsigned m_error_code;
|
||||||
public:
|
public:
|
||||||
z3_error(unsigned error_code);
|
z3_error(unsigned error_code);
|
||||||
char const * msg() const override;
|
char const * what() const override;
|
||||||
unsigned error_code() const override;
|
unsigned error_code() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -42,6 +42,6 @@ public:
|
||||||
struct fmt {};
|
struct fmt {};
|
||||||
default_exception(std::string && msg) : m_msg(std::move(msg)) {}
|
default_exception(std::string && msg) : m_msg(std::move(msg)) {}
|
||||||
default_exception(fmt, char const* msg, ...);
|
default_exception(fmt, char const* msg, ...);
|
||||||
char const * msg() const override;
|
char const * what() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue