mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 09:35:32 +00:00
reorganizing the code
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
9c057b87d1
commit
f57d4b1b19
34 changed files with 602 additions and 181 deletions
|
@ -329,7 +329,12 @@ public:
|
|||
model_converter_ref & mc,
|
||||
proof_converter_ref & pc,
|
||||
expr_dependency_ref & core) {
|
||||
(*m_imp)(in, result, mc, pc, core);
|
||||
try {
|
||||
(*m_imp)(in, result, mc, pc, core);
|
||||
}
|
||||
catch (rewriter_exception & ex) {
|
||||
throw tactic_exception(ex.msg());
|
||||
}
|
||||
}
|
||||
|
||||
virtual void cleanup() {
|
||||
|
|
|
@ -335,7 +335,12 @@ public:
|
|||
model_converter_ref & mc,
|
||||
proof_converter_ref & pc,
|
||||
expr_dependency_ref & core) {
|
||||
(*m_imp)(in, result, mc, pc, core);
|
||||
try {
|
||||
(*m_imp)(in, result, mc, pc, core);
|
||||
}
|
||||
catch (rewriter_exception & ex) {
|
||||
throw tactic_exception(ex.msg());
|
||||
}
|
||||
}
|
||||
|
||||
virtual void cleanup() {
|
||||
|
|
|
@ -181,7 +181,12 @@ public:
|
|||
model_converter_ref & mc,
|
||||
proof_converter_ref & pc,
|
||||
expr_dependency_ref & core) {
|
||||
(*m_imp)(in, result, mc, pc, core);
|
||||
try {
|
||||
(*m_imp)(in, result, mc, pc, core);
|
||||
}
|
||||
catch (rewriter_exception & ex) {
|
||||
throw tactic_exception(ex.msg());
|
||||
}
|
||||
}
|
||||
|
||||
virtual void cleanup() {
|
||||
|
|
|
@ -870,22 +870,27 @@ public:
|
|||
model_converter_ref & mc,
|
||||
proof_converter_ref & pc,
|
||||
expr_dependency_ref & core) {
|
||||
SASSERT(g->is_well_sorted());
|
||||
mc = 0; pc = 0; core = 0;
|
||||
tactic_report report("purify-arith", *g);
|
||||
bool produce_proofs = g->proofs_enabled();
|
||||
bool produce_models = g->models_enabled();
|
||||
bool elim_root_objs = m_params.get_bool(":elim-root-objects", true);
|
||||
bool elim_inverses = m_params.get_bool(":elim-inverses", true);
|
||||
bool complete = m_params.get_bool(":complete", true);
|
||||
purify_arith_proc proc(m_util, m_aux_decls, produce_proofs, elim_root_objs, elim_inverses, complete);
|
||||
|
||||
proc(*(g.get()), mc, produce_models);
|
||||
|
||||
g->inc_depth();
|
||||
result.push_back(g.get());
|
||||
TRACE("purify_arith", g->display(tout););
|
||||
SASSERT(g->is_well_sorted());
|
||||
try {
|
||||
SASSERT(g->is_well_sorted());
|
||||
mc = 0; pc = 0; core = 0;
|
||||
tactic_report report("purify-arith", *g);
|
||||
bool produce_proofs = g->proofs_enabled();
|
||||
bool produce_models = g->models_enabled();
|
||||
bool elim_root_objs = m_params.get_bool(":elim-root-objects", true);
|
||||
bool elim_inverses = m_params.get_bool(":elim-inverses", true);
|
||||
bool complete = m_params.get_bool(":complete", true);
|
||||
purify_arith_proc proc(m_util, m_aux_decls, produce_proofs, elim_root_objs, elim_inverses, complete);
|
||||
|
||||
proc(*(g.get()), mc, produce_models);
|
||||
|
||||
g->inc_depth();
|
||||
result.push_back(g.get());
|
||||
TRACE("purify_arith", g->display(tout););
|
||||
SASSERT(g->is_well_sorted());
|
||||
}
|
||||
catch (rewriter_exception & ex) {
|
||||
throw tactic_exception(ex.msg());
|
||||
}
|
||||
}
|
||||
|
||||
virtual void cleanup() {
|
||||
|
|
|
@ -416,7 +416,12 @@ public:
|
|||
model_converter_ref & mc,
|
||||
proof_converter_ref & pc,
|
||||
expr_dependency_ref & core) {
|
||||
(*m_imp)(g, result, mc, pc, core);
|
||||
try {
|
||||
(*m_imp)(g, result, mc, pc, core);
|
||||
}
|
||||
catch (rewriter_exception & ex) {
|
||||
throw tactic_exception(ex.msg());
|
||||
}
|
||||
}
|
||||
|
||||
virtual void cleanup() {
|
||||
|
|
|
@ -244,7 +244,12 @@ public:
|
|||
model_converter_ref & mc,
|
||||
proof_converter_ref & pc,
|
||||
expr_dependency_ref & core) {
|
||||
(*m_imp)(in, result, mc, pc, core);
|
||||
try {
|
||||
(*m_imp)(in, result, mc, pc, core);
|
||||
}
|
||||
catch (rewriter_exception & ex) {
|
||||
throw tactic_exception(ex.msg());
|
||||
}
|
||||
}
|
||||
|
||||
virtual void cleanup() {
|
||||
|
|
|
@ -97,10 +97,15 @@ void simplify_tactic::operator()(goal_ref const & in,
|
|||
model_converter_ref & mc,
|
||||
proof_converter_ref & pc,
|
||||
expr_dependency_ref & core) {
|
||||
(*m_imp)(*(in.get()));
|
||||
in->inc_depth();
|
||||
result.push_back(in.get());
|
||||
mc = 0; pc = 0; core = 0;
|
||||
try {
|
||||
(*m_imp)(*(in.get()));
|
||||
in->inc_depth();
|
||||
result.push_back(in.get());
|
||||
mc = 0; pc = 0; core = 0;
|
||||
}
|
||||
catch (rewriter_exception & ex) {
|
||||
throw tactic_exception(ex.msg());
|
||||
}
|
||||
}
|
||||
|
||||
void simplify_tactic::set_cancel(bool f) {
|
||||
|
|
|
@ -232,6 +232,7 @@ public:
|
|||
throw ex;
|
||||
}
|
||||
catch (z3_exception & ex) {
|
||||
// convert all Z3 exceptions into tactic exceptions.
|
||||
throw tactic_exception(ex.msg());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -249,13 +249,19 @@ public:
|
|||
model_converter_ref & mc,
|
||||
proof_converter_ref & pc,
|
||||
expr_dependency_ref & core) {
|
||||
m_imp->process(*in);
|
||||
m_imp->collect_statistics(m_stats);
|
||||
result.reset();
|
||||
result.push_back(in.get());
|
||||
mc = 0;
|
||||
pc = 0;
|
||||
core = 0;
|
||||
try {
|
||||
m_imp->process(*in);
|
||||
m_imp->collect_statistics(m_stats);
|
||||
result.reset();
|
||||
result.push_back(in.get());
|
||||
mc = 0;
|
||||
pc = 0;
|
||||
core = 0;
|
||||
}
|
||||
catch (z3_exception & ex) {
|
||||
// convert all Z3 exceptions into tactic exceptions
|
||||
throw tactic_exception(ex.msg());
|
||||
}
|
||||
}
|
||||
|
||||
virtual void cleanup() {
|
||||
|
|
41
src/tactic/tactic_exception.h
Normal file
41
src/tactic/tactic_exception.h
Normal file
|
@ -0,0 +1,41 @@
|
|||
/*++
|
||||
Copyright (c) 2012 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
tactic_exception.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Tactic expection object.
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo (leonardo) 2012-08-15
|
||||
|
||||
Notes:
|
||||
|
||||
--*/
|
||||
#ifndef _TACTIC_EXCEPTION_H_
|
||||
#define _TACTIC_EXCEPTION_H_
|
||||
|
||||
#include"z3_exception.h"
|
||||
#include"common_msgs.h"
|
||||
|
||||
class tactic_exception : public z3_exception {
|
||||
protected:
|
||||
std::string m_msg;
|
||||
public:
|
||||
tactic_exception(char const * msg):m_msg(msg) {}
|
||||
virtual ~tactic_exception() {}
|
||||
virtual char const * msg() const { return m_msg.c_str(); }
|
||||
};
|
||||
|
||||
#define TACTIC_CANCELED_MSG Z3_CANCELED_MSG
|
||||
#define TACTIC_MAX_MEMORY_MSG Z3_MAX_MEMORY_MSG
|
||||
#define TACTIC_MAX_SCOPES_MSG Z3_MAX_SCOPES_MSG
|
||||
#define TACTIC_MAX_STEPS_MSG Z3_MAX_STEPS_MSG
|
||||
#define TACTIC_MAX_FRAMES_MSG Z3_MAX_FRAMES_MSG
|
||||
#define TACTIC_NO_PROOF_GEN_MSG Z3_NO_PROOF_GEN_MSG
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue