mirror of
https://github.com/Z3Prover/z3
synced 2025-08-22 19:17:53 +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
|
@ -246,17 +246,17 @@ protected:
|
|||
// check maximum number of scopes
|
||||
void check_max_scopes() const {
|
||||
if (m_cfg.max_scopes_exceeded(this->m_scopes.size()))
|
||||
throw rewriter_exception(TACTIC_MAX_SCOPES_MSG);
|
||||
throw rewriter_exception(Z3_MAX_SCOPES_MSG);
|
||||
}
|
||||
// check maximum size of the frame stack
|
||||
void check_max_frames() const {
|
||||
if (m_cfg.max_frames_exceeded(frame_stack().size()))
|
||||
throw rewriter_exception(TACTIC_MAX_FRAMES_MSG);
|
||||
throw rewriter_exception(Z3_MAX_FRAMES_MSG);
|
||||
}
|
||||
// check maximum number of rewriting steps
|
||||
void check_max_steps() const {
|
||||
if (m_cfg.max_steps_exceeded(m_num_steps))
|
||||
throw rewriter_exception(TACTIC_MAX_STEPS_MSG);
|
||||
throw rewriter_exception(Z3_MAX_STEPS_MSG);
|
||||
}
|
||||
|
||||
// If pre_visit returns false, then t children are not visited/rewritten.
|
||||
|
|
|
@ -577,7 +577,7 @@ void rewriter_tpl<Config>::resume_core(expr_ref & result, proof_ref & result_pr)
|
|||
SASSERT(!frame_stack().empty());
|
||||
while (!frame_stack().empty()) {
|
||||
if (m_cancel)
|
||||
throw rewriter_exception(TACTIC_CANCELED_MSG);
|
||||
throw rewriter_exception(Z3_CANCELED_MSG);
|
||||
SASSERT(!ProofGen || result_stack().size() == result_pr_stack().size());
|
||||
frame & fr = frame_stack().back();
|
||||
expr * t = fr.m_curr;
|
||||
|
|
|
@ -19,7 +19,8 @@ Notes:
|
|||
#ifndef _REWRITER_TYPES_H_
|
||||
#define _REWRITER_TYPES_H_
|
||||
|
||||
#include"tactic_exception.h"
|
||||
#include"z3_exception.h"
|
||||
#include"common_msgs.h"
|
||||
|
||||
/**
|
||||
\brief Builtin rewrite result status
|
||||
|
@ -43,9 +44,9 @@ inline br_status unsigned2br_status(unsigned u) {
|
|||
return r;
|
||||
}
|
||||
|
||||
class rewriter_exception : public tactic_exception {
|
||||
class rewriter_exception : public default_exception {
|
||||
public:
|
||||
rewriter_exception(char const * msg):tactic_exception(msg) {}
|
||||
rewriter_exception(char const * msg):default_exception(msg) {}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -96,7 +96,7 @@ struct th_rewriter_cfg : public default_rewriter_cfg {
|
|||
bool max_steps_exceeded(unsigned num_steps) const {
|
||||
cooperate("simplifier");
|
||||
if (memory::get_allocation_size() > m_max_memory)
|
||||
throw rewriter_exception(TACTIC_MAX_MEMORY_MSG);
|
||||
throw rewriter_exception(Z3_MAX_MEMORY_MSG);
|
||||
return num_steps > m_max_steps;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue