Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add model.user_functions (default true) to control whether user functions are added to the model.
  • Loading branch information
NikolajBjorner committed Mar 23, 2022
1 parent a24a922 commit d790523
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/cmd_context/cmd_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
1 change: 1 addition & 0 deletions src/model/model_params.pyg
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
))

4 changes: 3 additions & 1 deletion src/smt/smt_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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();
}

Expand Down

0 comments on commit d790523

Please sign in to comment.