Skip to content

Commit 893265c

Browse files
fix #4166
1 parent e9119a6 commit 893265c

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

src/smt/smt_setup.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ namespace smt {
877877

878878
void setup::setup_datatypes() {
879879
TRACE("datatype", tout << "registering theory datatype...\n";);
880-
m_context.register_plugin(alloc(theory_datatype, m_manager, m_params));
880+
m_context.register_plugin(alloc(theory_datatype, m_manager));
881881
}
882882

883883
void setup::setup_recfuns() {

src/smt/theory_datatype.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ namespace smt {
7575

7676

7777
theory* theory_datatype::mk_fresh(context* new_ctx) {
78-
return alloc(theory_datatype, new_ctx->get_manager(), m_params);
78+
return alloc(theory_datatype, new_ctx->get_manager());
7979
}
8080

8181
/**
@@ -286,7 +286,7 @@ namespace smt {
286286
assert_is_constructor_axiom(n, c, null_literal);
287287
}
288288
else {
289-
if (m_params.m_dt_lazy_splits == 0 || (m_params.m_dt_lazy_splits == 1 && !s->is_infinite()))
289+
if (params().m_dt_lazy_splits == 0 || (params().m_dt_lazy_splits == 1 && !s->is_infinite()))
290290
mk_split(r);
291291
}
292292
}
@@ -487,7 +487,7 @@ namespace smt {
487487
// return...
488488
return FC_CONTINUE;
489489
}
490-
if (m_params.m_dt_lazy_splits > 0) {
490+
if (params().m_dt_lazy_splits > 0) {
491491
// using lazy case splits...
492492
var_data * d = m_var_data[v];
493493
if (d->m_constructor == nullptr) {
@@ -694,9 +694,12 @@ namespace smt {
694694
return false;
695695
}
696696

697-
theory_datatype::theory_datatype(ast_manager & m, theory_datatype_params & p):
697+
theory_datatype_params const& theory_datatype::params() const {
698+
return get_context().get_fparams();
699+
}
700+
701+
theory_datatype::theory_datatype(ast_manager & m):
698702
theory(m.mk_family_id("datatype")),
699-
m_params(p),
700703
m_util(m),
701704
m_autil(m),
702705
m_find(*this),
@@ -932,7 +935,7 @@ namespace smt {
932935
else {
933936
// there are more than 2 unassigned recognizers...
934937
// if eager splits are enabled... create new case split
935-
if (m_params.m_dt_lazy_splits == 0 || (!dt->is_infinite() && m_params.m_dt_lazy_splits == 1))
938+
if (params().m_dt_lazy_splits == 0 || (!dt->is_infinite() && params().m_dt_lazy_splits == 1))
936939
mk_split(v);
937940
}
938941
}

src/smt/theory_datatype.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ namespace smt {
4545
void reset() { memset(this, 0, sizeof(stats)); }
4646
stats() { reset(); }
4747
};
48-
4948

50-
theory_datatype_params & m_params;
5149
datatype_util m_util;
5250
array_util m_autil;
5351
ptr_vector<var_data> m_var_data;
@@ -130,8 +128,9 @@ namespace smt {
130128
void reset_eh() override;
131129
void restart_eh() override { m_util.reset(); }
132130
bool is_shared(theory_var v) const override;
131+
theory_datatype_params const& params() const;
133132
public:
134-
theory_datatype(ast_manager & m, theory_datatype_params & p);
133+
theory_datatype(ast_manager & m);
135134
~theory_datatype() override;
136135
theory * mk_fresh(context * new_ctx) override;
137136
void display(std::ostream & out) const override;

0 commit comments

Comments
 (0)