Skip to content

Commit

Permalink
[idf_search.rs] Tighten an assertion (max depth is exclusive).
Browse files Browse the repository at this point in the history
  • Loading branch information
lgarron committed Sep 14, 2024
1 parent 6df1501 commit 4800edc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/rs/_internal/search/idf_search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ impl Iterator for SearchSolutions {
#[serde(rename_all = "camelCase")]
pub struct IndividualSearchOptions {
pub min_num_solutions: Option<usize>,
pub min_depth: Option<usize>,
pub max_depth: Option<usize>,
pub min_depth: Option<usize>, // inclusive
pub max_depth: Option<usize>, // exclusive
pub disallowed_initial_quanta: Option<Vec<QuantumMove>>, // TODO: Change this to `fsm_pre_moves` so we can compute disallowed initial FSM states.
pub disallowed_final_quanta: Option<Vec<QuantumMove>>, // TODO: Find a way to represent this using disallowed final FSM states?
}
Expand Down Expand Up @@ -203,7 +203,9 @@ impl IDFSearch {
}
}

assert!(individual_search_options.get_max_depth() >= individual_search_options.get_min_depth());
assert!(
individual_search_options.get_max_depth() > individual_search_options.get_min_depth()
);

let (solution_sender, search_solutions) = SearchSolutions::construct();
let mut individual_search_data = IndividualSearchData {
Expand Down

0 comments on commit 4800edc

Please sign in to comment.