diff --git a/src/cmd_context/cmd_context.cpp b/src/cmd_context/cmd_context.cpp index 968dcacd83f..89efc439f67 100644 --- a/src/cmd_context/cmd_context.cpp +++ b/src/cmd_context/cmd_context.cpp @@ -1815,6 +1815,9 @@ void cmd_context::display_model(model_ref& mdl) { } void cmd_context::add_declared_functions(model& mdl) { + model_params p; + if (!p.user_functions()) + return; for (auto const& kv : m_func_decls) { func_decl* f = kv.m_value.first(); if (f->get_family_id() == null_family_id && !mdl.has_interpretation(f)) { diff --git a/src/model/model_params.pyg b/src/model/model_params.pyg index 7e370cb3a5a..59899644e95 100644 --- a/src/model/model_params.pyg +++ b/src/model/model_params.pyg @@ -5,6 +5,7 @@ def_module_params('model', ('v2', BOOL, False, 'use Z3 version 2.x (x <= 16) pretty printer'), ('compact', BOOL, True, 'try to compact function graph (i.e., function interpretations that are lookup tables)'), ('inline_def', BOOL, False, 'inline local function definitions ignoring possible expansion'), + ('user_functions', BOOL, True, 'include user defined functions in model'), ('completion', BOOL, False, 'enable/disable model completion'), )) diff --git a/src/smt/smt_context.cpp b/src/smt/smt_context.cpp index 2eba2c2a292..a7946a67608 100644 --- a/src/smt/smt_context.cpp +++ b/src/smt/smt_context.cpp @@ -29,6 +29,7 @@ Revision History: #include "ast/proofs/proof_checker.h" #include "ast/ast_util.h" #include "ast/well_sorted.h" +#include "model/model_params.hpp" #include "model/model.h" #include "model/model_pp.h" #include "smt/smt_context.h" @@ -4638,7 +4639,8 @@ namespace smt { } void context::add_rec_funs_to_model() { - if (m_model) + model_params p; + if (m_model && p.user_functions()) m_model->add_rec_funs(); }