mirror of
https://github.com/Z3Prover/z3
synced 2025-04-29 20:05:51 +00:00
remove dependency on ast from params
This commit is contained in:
parent
f00db08221
commit
4b3fecc35e
13 changed files with 49 additions and 48 deletions
|
@ -280,6 +280,20 @@ void macro_decls::erase_last(ast_manager& m) {
|
|||
m_decls->pop_back();
|
||||
}
|
||||
|
||||
ast_manager * ast_context::mk_ast_manager() {
|
||||
if (m_manager)
|
||||
return m_manager;
|
||||
ast_manager * r = alloc(ast_manager,
|
||||
m_proof ? PGM_ENABLED : PGM_DISABLED,
|
||||
m_trace ? m_trace_file_name.c_str() : nullptr);
|
||||
if (m_smtlib2_compliant)
|
||||
r->enable_int_real_coercions(false);
|
||||
if (m_debug_ref_count)
|
||||
r->debug_ref_count();
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
bool cmd_context::contains_func_decl(symbol const& s, unsigned n, sort* const* domain, sort* range) const {
|
||||
func_decls fs;
|
||||
return m_func_decls.find(s, fs) && fs.contains(n, domain, range);
|
||||
|
@ -1889,6 +1903,8 @@ void cmd_context::validate_model() {
|
|||
if (m().is_true(r))
|
||||
continue;
|
||||
|
||||
TRACE("model_validate", tout << *md << "\n";);
|
||||
|
||||
// The evaluator for array expressions is not complete
|
||||
// If r contains as_array/store/map/const expressions, then we do not generate the error.
|
||||
// TODO: improve evaluator for model expressions.
|
||||
|
@ -1897,7 +1913,8 @@ void cmd_context::validate_model() {
|
|||
continue;
|
||||
}
|
||||
try {
|
||||
for_each_expr(contains_underspecified, a);
|
||||
if (!m().is_false(r))
|
||||
for_each_expr(contains_underspecified, a);
|
||||
for_each_expr(contains_underspecified, r);
|
||||
}
|
||||
catch (const contains_underspecified_op_proc::found &) {
|
||||
|
|
|
@ -160,6 +160,18 @@ public:
|
|||
virtual void updt_params(params_ref const& p) = 0;
|
||||
};
|
||||
|
||||
class ast_context : public context_params {
|
||||
ast_manager* m_manager { nullptr };
|
||||
public:
|
||||
/**
|
||||
\brief Create an AST manager using this configuration.
|
||||
*/
|
||||
ast_manager * mk_ast_manager();
|
||||
|
||||
void set_foreign_manager(ast_manager* m) { m_manager = m; }
|
||||
bool owns_manager() const { return m_manager != nullptr; }
|
||||
};
|
||||
|
||||
class cmd_context : public progress_callback, public tactic_manager, public ast_printer_context {
|
||||
public:
|
||||
enum status {
|
||||
|
@ -179,8 +191,10 @@ public:
|
|||
~scoped_watch() { m_ctx.m_watch.stop(); }
|
||||
};
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
context_params m_params;
|
||||
ast_context m_params;
|
||||
bool m_main_ctx;
|
||||
symbol m_logic;
|
||||
bool m_interactive_mode;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue