fn build_rule(v: &[u8], positions: &[usize]) -> String