| 1388 | } |
| 1389 | |
| 1390 | static expr get_bool(const expr &e) { |
| 1391 | expr cond, then, els; |
| 1392 | if (e.isIf(cond, then, els)) { |
| 1393 | if (then.isOne() && els.isZero()) |
| 1394 | return cond; |
| 1395 | if (then.isZero() && els.isOne()) |
| 1396 | return !cond; |
| 1397 | } |
| 1398 | return {}; |
| 1399 | } |
| 1400 | |
| 1401 | expr expr::operator&(const expr &rhs) const { |
| 1402 | if (eq(rhs) || isZero() || rhs.isAllOnes()) |