@@ -34,7 +34,7 @@ namespace smt {
34
34
}
35
35
36
36
std::ostream& operator <<(std::ostream& out, model_value_dependency const & src) {
37
- if (src.is_fresh_value ()) return out << " fresh!" << src.get_value ()->get_idx ();
37
+ if (src.is_fresh_value ()) return out << " fresh!" << src.get_value ()->get_idx () << " # " << src. get_value ()-> get_src ()-> get_id () ;
38
38
else return out << " #" << src.get_enode ()->get_owner_id ();
39
39
}
40
40
@@ -115,8 +115,11 @@ namespace smt {
115
115
SASSERT (proc);
116
116
}
117
117
else {
118
- TRACE (" model" , tout << " creating fresh value for #" << mk_pp (r->get_expr (), m) << " \n " ;);
119
- proc = alloc (fresh_value_proc, mk_extra_fresh_value (r->get_sort ()));
118
+ TRACE (" model" , tout << " creating fresh value for #"
119
+ << r->get_expr_id () << " "
120
+ << mk_bounded_pp (r->get_expr (), m) << " "
121
+ << mk_pp (r->get_sort (), m) << " \n " ;);
122
+ proc = alloc (fresh_value_proc, mk_extra_fresh_value (r->get_expr (), r->get_sort ()));
120
123
}
121
124
}
122
125
else {
@@ -181,6 +184,11 @@ namespace smt {
181
184
if (already_traversed.contains (s))
182
185
return true ;
183
186
bool visited = true ;
187
+ TRACE (" mg_top_sort" , tout << " fresh value of sort " << mk_pp (s, m) << " \n " ;
188
+ for (enode* r : roots)
189
+ if (r->get_sort () == s)
190
+ tout << mk_pp (r->get_expr (), m) << " \n " ;
191
+ );
184
192
for (enode * r : roots) {
185
193
if (r->get_sort () != s)
186
194
continue ;
@@ -305,14 +313,21 @@ namespace smt {
305
313
}
306
314
else {
307
315
enode * n = curr.get_enode ();
316
+ sort* s = n->get_sort ();
308
317
SASSERT (n->get_root () == n);
309
- tout << mk_pp (n->get_expr (), m) << " \n " ;
310
- sort * s = n->get_sort ();
311
318
tout << curr << " " << mk_pp (s, m);
312
- tout << " is_fresh: " << root2proc[n]->is_fresh () << " \n " ;
319
+ tout << mk_bounded_pp (n->get_expr (), m) << " " ;
320
+ tout << " is_fresh: " << root2proc[n]->is_fresh () << " - deps: " ;
321
+ dependencies.reset ();
322
+ model_value_proc* proc = root2proc[n];
323
+ SASSERT (proc);
324
+ proc->get_dependencies (dependencies);
325
+ for (auto const & d : dependencies)
326
+ tout << d << " " ;
327
+ tout << " \n " ;
313
328
}
314
329
}
315
- m_context->display (tout);
330
+ // m_context->display(tout);
316
331
);
317
332
318
333
@@ -340,10 +355,16 @@ namespace smt {
340
355
proc->get_dependencies (dependencies);
341
356
for (model_value_dependency const & d : dependencies) {
342
357
if (d.is_fresh_value ()) {
343
- CTRACE (" mg_top_sort" , !d.get_value ()->get_value (),
344
- tout << " #" << n->get_owner_id () << " " << mk_pp (n->get_expr (), m) << " -> " << d << " \n " ;);
345
- SASSERT (d.get_value ()->get_value ());
346
- dependency_values.push_back (d.get_value ()->get_value ());
358
+ expr* val = d.get_value ()->get_value ();
359
+ CTRACE (" mg_top_sort" , !val,
360
+ tout << " #" << n->get_owner_id () << " " <<
361
+ mk_pp (n->get_expr (), m) << " -> " << d << " \n " ;);
362
+ // there is a cyclic dependency for default(A), where A
363
+ // is an array of a datatype with the datatype using A.
364
+ if (!val)
365
+ val = m_model->get_some_value (d.get_value ()->get_sort ());
366
+ SASSERT (val);
367
+ dependency_values.push_back (val);
347
368
}
348
369
else {
349
370
enode * child = d.get_enode ();
@@ -446,8 +467,8 @@ namespace smt {
446
467
}
447
468
}
448
469
449
- extra_fresh_value * model_generator::mk_extra_fresh_value (sort * s) {
450
- extra_fresh_value * r = alloc (extra_fresh_value, s, m_fresh_idx);
470
+ extra_fresh_value * model_generator::mk_extra_fresh_value (expr * src, sort * s) {
471
+ extra_fresh_value * r = alloc (extra_fresh_value, src, s, m_fresh_idx);
451
472
m_fresh_idx++;
452
473
m_extra_fresh_values.push_back (r);
453
474
return r;
0 commit comments