@@ -92,7 +92,6 @@ namespace euf {
92
92
if (!bv.is_bv_add (x))
93
93
return ;
94
94
expr_ref term (m);
95
- unsigned i = 0 ;
96
95
auto mk_term = [&](unsigned i) {
97
96
term = y;
98
97
unsigned j = 0 ;
@@ -102,17 +101,40 @@ namespace euf {
102
101
++j;
103
102
}
104
103
};
104
+ expr* u = nullptr , *z = nullptr ;
105
+ rational r;
106
+ unsigned i = 0 ;
105
107
for (expr* arg : *to_app (x)) {
106
108
if (is_uninterp_const (arg)) {
107
109
mk_term (i);
108
110
eqs.push_back (dependent_eq (orig, to_app (arg), term, d));
109
111
}
112
+ else if (bv.is_bv_mul (arg, u, z) && bv.is_numeral (u, r) && is_uninterp_const (z) && r.is_odd ()) {
113
+ mk_term (i);
114
+ unsigned sz = bv.get_bv_size (z);
115
+ rational inv_r;
116
+ VERIFY (r.mult_inverse (sz, inv_r));
117
+ term = bv.mk_bv_mul (bv.mk_numeral (inv_r, sz), term);
118
+ eqs.push_back (dependent_eq (orig, to_app (z), term, d));
119
+ }
110
120
++i;
111
121
}
112
122
}
113
123
124
+ void solve_mul (expr* orig, expr* x, expr* y, expr_dependency* d, dep_eq_vector& eqs) {
125
+ expr* u = nullptr , *z = nullptr ;
126
+ rational r, inv_r;
127
+ if (bv.is_bv_mul (x, u, z) && bv.is_numeral (u, r) && is_uninterp_const (z) && r.is_odd ()) {
128
+ unsigned sz = bv.get_bv_size (z);
129
+ VERIFY (r.mult_inverse (sz, inv_r));
130
+ auto term = expr_ref (bv.mk_bv_mul (bv.mk_numeral (inv_r, sz), y), m);
131
+ eqs.push_back (dependent_eq (orig, to_app (z), term, d));
132
+ }
133
+ }
134
+
114
135
void solve_eq (expr* orig, expr* x, expr* y, expr_dependency* d, dep_eq_vector& eqs) {
115
136
solve_add (orig, x, y, d, eqs);
137
+ solve_mul (orig, x, y, d, eqs);
116
138
}
117
139
118
140
@@ -132,12 +154,9 @@ namespace euf {
132
154
}
133
155
134
156
void pre_process (dependent_expr_state& fmls) override {
135
- if (!m_enabled)
136
- return ;
137
157
}
138
158
139
159
void updt_params (params_ref const & p) override {
140
-
141
160
}
142
161
143
162
};
0 commit comments