(acc: &mut NormLevel)
| 547 | yi += 1; |
| 548 | } |
| 549 | if yi >= ys.len() || ys[yi] != x { |
| 550 | return false; |
| 551 | } |
| 552 | yi += 1; |
| 553 | } |
| 554 | true |
| 555 | } |
| 556 | |
| 557 | fn subsumption(acc: &mut NormLevel) { |
| 558 | let snapshot: Vec<_> = |
| 559 | acc.iter().map(|(k, v)| (k.clone(), v.clone())).collect(); |
| 560 | |
| 561 | for (p1, n1) in acc.iter_mut() { |
| 562 | for (p2, n2) in &snapshot { |
| 563 | if !is_subset(p2, p1) { |
| 564 | continue; |
| 565 | } |
| 566 | let same = p1.len() == p2.len(); |
| 567 | |
| 568 | if n1.constant != 0 { |
| 569 | let max_var_offset = n1.var.iter().map(|v| v.offset).max().unwrap_or(0); |
| 570 | let keep_const = (same || n1.constant > n2.constant) |
| 571 | && (n2.var.is_empty() || n1.constant > max_var_offset + 1); |
| 572 | if !keep_const { |
| 573 | n1.constant = 0; |
| 574 | } |
| 575 | } |
| 576 | |
| 577 | if !same && !n2.var.is_empty() { |
no test coverage detected