@@ -109,6 +109,8 @@ namespace smt {
109
109
bool context::ts_visit_children (expr * n, bool gate_ctx, svector<expr_bool_pair> & todo) {
110
110
if (is_quantifier (n))
111
111
return true ;
112
+ if (!should_internalize_rec (n))
113
+ return true ;
112
114
SASSERT (is_app (n));
113
115
if (m.is_bool (n)) {
114
116
if (b_internalized (n))
@@ -181,8 +183,15 @@ namespace smt {
181
183
182
184
#define DEEP_EXPR_THRESHOLD 1024
183
185
186
+ bool context::should_internalize_rec (expr* e) const {
187
+ return !is_app (e) ||
188
+ !m.is_bool (e) ||
189
+ to_app (e)->get_family_id () == null_family_id ||
190
+ to_app (e)->get_family_id () == m.get_basic_family_id ();
191
+ }
192
+
184
193
void context::internalize_deep (expr* n) {
185
- if (!e_internalized (n) && ::get_depth (n) > DEEP_EXPR_THRESHOLD) {
194
+ if (!e_internalized (n) && ::get_depth (n) > DEEP_EXPR_THRESHOLD && should_internalize_rec (n) ) {
186
195
// if the expression is deep, then execute topological sort to avoid
187
196
// stack overflow.
188
197
// a caveat is that theory internalizers do rely on recursive descent so
@@ -193,10 +202,7 @@ namespace smt {
193
202
TRACE (" deep_internalize" , for (auto & kv : sorted_exprs) tout << " #" << kv.first ->get_id () << " " << kv.second << " \n " ; );
194
203
for (auto & kv : sorted_exprs) {
195
204
expr* e = kv.first ;
196
- if (!is_app (e) ||
197
- !m.is_bool (e) ||
198
- to_app (e)->get_family_id () == null_family_id ||
199
- to_app (e)->get_family_id () == m.get_basic_family_id ())
205
+ if (should_internalize_rec (e))
200
206
internalize_rec (e, kv.second );
201
207
}
202
208
}
0 commit comments