| 508 | type Output = Self; |
| 509 | |
| 510 | fn shr(self, rhs: Self) -> Self::Output { |
| 511 | if self.is_bottom() || rhs.is_bottom() { |
| 512 | Self::bottom() |
| 513 | } else if self.is_top() || rhs.is_top() { |
| 514 | Self::top() |
| 515 | } else if let (Ok(lval), Ok(rval)) = (Integer::try_from(self), Integer::try_from(rhs)) { |
| 516 | if let Some(u32val) = rval.to_u32() { |
| 517 | let val = lval >> u32val; |
| 518 | Self::new(Bound::from(val.clone()), Bound::from(val)) |
| 519 | } else { |
| 520 | Self::top() |
| 521 | } |
| 522 | } else { |
| 523 | Self::top() |
| 524 | } |
| 525 | } |
| 526 | } |
| 527 | |
| 528 | #[cfg(test)] |