| 420 | type Output = Self; |
| 421 | |
| 422 | fn bitand(self, rhs: Self) -> Self::Output { |
| 423 | if self.is_bottom() || rhs.is_bottom() { |
| 424 | Self::bottom() |
| 425 | } else if self.is_top() || rhs.is_top() { |
| 426 | Self::top() |
| 427 | } else if self.is_zero() || rhs.is_zero() { |
| 428 | Self::new(Bound::from(0u128), Bound::from(0u128)) |
| 429 | } else if self.all_ones() { |
| 430 | rhs |
| 431 | } else if rhs.all_ones() { |
| 432 | self |
| 433 | } else if let (Ok(lval), Ok(rval)) = (Integer::try_from(self), Integer::try_from(rhs)) { |
| 434 | let and_val = lval & rval; |
| 435 | Self::new(Bound::from(and_val.clone()), Bound::from(and_val)) |
| 436 | } else { |
| 437 | Self::top() |
| 438 | } |
| 439 | } |
| 440 | } |
| 441 | |
| 442 | impl BitOr for Interval { |