(constraints: Vec<Constraint>)
| 395 | } |
| 396 | |
| 397 | fn select_max_array_constraint(constraints: Vec<Constraint>) -> Vec<Constraint> { |
| 398 | let mut counter: HashMap<usize, usize> = HashMap::new(); |
| 399 | for constraint in &constraints { |
| 400 | let integer_arg = constraint.get_integer_arg(); |
| 401 | *counter.entry(integer_arg).or_default() += 1; |
| 402 | } |
| 403 | let max_arg = counter |
| 404 | .iter() |
| 405 | .max_by_key(|x| x.1) |
| 406 | .expect("should not be empty"); |
| 407 | let max_integer_arg = *max_arg.0; |
| 408 | let mut retained = Vec::new(); |
| 409 | for constraint in constraints { |
| 410 | let integer_arg = constraint.get_integer_arg(); |
| 411 | if integer_arg == max_integer_arg { |
| 412 | retained.push(constraint); |
| 413 | } |
| 414 | } |
| 415 | retained |
| 416 | } |
| 417 | |
| 418 | /// LLM is possible to assign a string argument with "input_file" name, so check whether this constraint is well inferred |
| 419 | fn refine_file_name_constraint(func: &str, constraints: Vec<Constraint>) -> Vec<Constraint> { |
no test coverage detected