File tree 2 files changed +18
-7
lines changed
2 files changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -101,16 +101,24 @@ namespace bv {
101
101
102
102
std::function<bool (expr*, unsigned )> eval = [&](expr* e, unsigned i) {
103
103
unsigned id = e->get_id ();
104
- bool keep = (m_rand () % 100 <= 50 ) || !m_to_repair.contains (id);
105
- if (m.is_bool (e) && (m_eval.is_fixed0 (e) || keep))
106
- return m_eval.bval0 (e);
104
+ bool keep = !m_to_repair.contains (id);
105
+ if (m.is_bool (e)) {
106
+ if (m_eval.is_fixed0 (e) || keep)
107
+ return m_eval.bval0 (e);
108
+ if (m_engine_init) {
109
+ auto const & z = m_engine.get_value (e);
110
+ return rational (z).get_bit (0 );
111
+ }
112
+ }
107
113
else if (bv.is_bv (e)) {
108
114
auto & w = m_eval.wval (e);
109
115
if (w.fixed .get (i) || keep)
110
116
return w.get_bit (i);
111
- // auto const& z = m_engine.get_value(e);
112
- // return rational(z).get_bit(i);
113
- }
117
+ if (m_engine_init) {
118
+ auto const & z = m_engine.get_value (e);
119
+ return rational (z).get_bit (i);
120
+ }
121
+ }
114
122
115
123
return m_rand () % 2 == 0 ;
116
124
};
@@ -177,7 +185,8 @@ namespace bv {
177
185
else if (m_stats.m_restarts % 1000 == 0 )
178
186
res = m_engine.search_loop ();
179
187
if (res != l_undef)
180
- m_engine_model = true ;
188
+ m_engine_model = true ;
189
+ m_engine_init = true ;
181
190
return res;
182
191
}
183
192
@@ -187,6 +196,7 @@ namespace bv {
187
196
m_stats.reset ();
188
197
m_stats.m_restarts = 0 ;
189
198
m_engine_model = false ;
199
+ m_engine_init = false ;
190
200
191
201
do {
192
202
res = search1 ();
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ namespace bv {
52
52
config m_config;
53
53
sls_engine m_engine;
54
54
bool m_engine_model = false ;
55
+ bool m_engine_init = false ;
55
56
56
57
std::pair<bool , app*> next_to_repair ();
57
58
You can’t perform that action at this time.
0 commit comments