Skip to content

Commit

Permalink
Rename some outdated trait implementations and related code.
Browse files Browse the repository at this point in the history
  • Loading branch information
lgarron committed Feb 2, 2025
1 parent 833c34b commit d87a43e
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ impl<TPuzzle: SemiGroupActionPuzzle, TSemanticCoordinate: SemanticCoordinate<TPu
}

// TODO: simplify the default for below.
pub struct PhaseCoordinatePuzzleSearchOptimizations<
pub struct PhaseCoordinatePuzzleAdaptations<
TPuzzle: SemiGroupActionPuzzle,
TSemanticCoordinate: SemanticCoordinate<TPuzzle>,
> {
Expand All @@ -388,7 +388,7 @@ pub struct PhaseCoordinatePuzzleSearchOptimizations<

impl<TPuzzle: SemiGroupActionPuzzle, TSemanticCoordinate: SemanticCoordinate<TPuzzle>>
SearchAdaptations<PhaseCoordinatePuzzle<TPuzzle, TSemanticCoordinate>>
for PhaseCoordinatePuzzleSearchOptimizations<TPuzzle, TSemanticCoordinate>
for PhaseCoordinatePuzzleAdaptations<TPuzzle, TSemanticCoordinate>
{
type PruneTable = PhaseCoordinatePruneTable<TPuzzle, TSemanticCoordinate>;
type PatternTraversalFilter = PatternTraversalFilterNoOp; // TODO: reconcile this with fallible transformation application.
Expand All @@ -399,5 +399,5 @@ impl<TPuzzle: SemiGroupActionPuzzle, TSemanticCoordinate: SemanticCoordinate<TPu
DefaultSearchAdaptations<PhaseCoordinatePuzzle<TPuzzle, TSemanticCoordinate>>
for PhaseCoordinatePuzzle<TPuzzle, TSemanticCoordinate>
{
type Adaptations = PhaseCoordinatePuzzleSearchOptimizations<TPuzzle, TSemanticCoordinate>;
type Adaptations = PhaseCoordinatePuzzleAdaptations<TPuzzle, TSemanticCoordinate>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ impl<
}
}

pub struct TriplePhaseCoordinateSearchOptimizations<
pub struct TriplePhaseCoordinateSearchAdaptations<
TPuzzle: SemiGroupActionPuzzle,
TSemanticCoordinate1: SemanticCoordinate<TPuzzle>,
TSemanticCoordinate2: SemanticCoordinate<TPuzzle>,
Expand Down Expand Up @@ -453,7 +453,7 @@ impl<
TSemanticCoordinate3,
>,
>
for TriplePhaseCoordinateSearchOptimizations<
for TriplePhaseCoordinateSearchAdaptations<
TPuzzle,
TSemanticCoordinate1,
TSemanticCoordinate2,
Expand Down Expand Up @@ -491,7 +491,7 @@ impl<
TSemanticCoordinate3,
>
{
type Adaptations = TriplePhaseCoordinateSearchOptimizations<
type Adaptations = TriplePhaseCoordinateSearchAdaptations<
TPuzzle,
TSemanticCoordinate1,
TSemanticCoordinate2,
Expand Down
4 changes: 2 additions & 2 deletions src/rs/_internal/search/hash_prune_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pub struct HashPruneTable<
// We would store a `tpuzzle` here, but the one stored in `.mutable` is sufficient.
immutable: HashPruneTableImmutableData<TPuzzle>,
mutable: HashPruneTableMutableData<TPuzzle>,
phantom_validity_checker: PhantomData<TPatternTraversalFilter>,
phantom_data: PhantomData<TPatternTraversalFilter>,
}

impl<
Expand Down Expand Up @@ -176,7 +176,7 @@ impl<
),
search_logger,
},
phantom_validity_checker: PhantomData,
phantom_data: PhantomData,
};
prune_table.extend_for_search_depth(Depth(0), 1);
prune_table
Expand Down
10 changes: 5 additions & 5 deletions src/rs/_internal/search/idf_search/idf_search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ impl Default for IDFSearchConstructionOptions {

impl<
TPuzzle: SemiGroupActionPuzzle + DefaultSearchAdaptations<TPuzzle>,
Optimizations: SearchAdaptations<TPuzzle>,
> IDFSearch<TPuzzle, Optimizations>
Adaptations: SearchAdaptations<TPuzzle>,
> IDFSearch<TPuzzle, Adaptations>
{
pub fn try_new(
tpuzzle: TPuzzle,
Expand All @@ -222,7 +222,7 @@ impl<
search_logger: options.search_logger.clone(),
});

let prune_table = Optimizations::PruneTable::new(
let prune_table = Adaptations::PruneTable::new(
tpuzzle,
api_data.clone(),
options.search_logger,
Expand Down Expand Up @@ -325,7 +325,7 @@ impl<
) -> SearchRecursionResult {
let current_pattern = pattern_stack.current_pattern();
// TODO: apply invalid checks only to intermediate state (i.e. exclude remaining_depth == 0)?
if !Optimizations::PatternTraversalFilter::is_valid(current_pattern) {
if !Adaptations::PatternTraversalFilter::is_valid(current_pattern) {
return SearchRecursionResult::ContinueSearchingDefault();
}

Expand Down Expand Up @@ -360,7 +360,7 @@ impl<
};

for move_transformation_info in move_transformation_multiples {
if !Optimizations::TransformationTraversalFilter::keep_move(
if !Adaptations::TransformationTraversalFilter::keep_move(
move_transformation_info,
remaining_depth,
) {
Expand Down
12 changes: 6 additions & 6 deletions src/rs/scramble/scramble_search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@ pub fn move_list_from_vec(move_str_list: Vec<&str>) -> Vec<Move> {

pub struct FilteredSearch<
TPuzzle: SemiGroupActionPuzzle + DefaultSearchAdaptations<TPuzzle> = KPuzzle,
Optimizations: SearchAdaptations<TPuzzle> = <TPuzzle as DefaultSearchAdaptations<
Adaptations: SearchAdaptations<TPuzzle> = <TPuzzle as DefaultSearchAdaptations<
TPuzzle,
>>::Adaptations,
> {
pub(crate) idfs: IDFSearch<TPuzzle, Optimizations>,
pub(crate) idfs: IDFSearch<TPuzzle, Adaptations>,

phantom_data: PhantomData<(TPuzzle, Optimizations)>,
phantom_data: PhantomData<(TPuzzle, Adaptations)>,
}

impl<
TPuzzle: SemiGroupActionPuzzle + DefaultSearchAdaptations<TPuzzle>,
Optimizations: SearchAdaptations<TPuzzle>,
> FilteredSearch<TPuzzle, Optimizations>
Adaptations: SearchAdaptations<TPuzzle>,
> FilteredSearch<TPuzzle, Adaptations>
{
pub fn new(idfs: IDFSearch<TPuzzle, Optimizations>) -> Self {
pub fn new(idfs: IDFSearch<TPuzzle, Adaptations>) -> Self {
Self {
idfs,
phantom_data: PhantomData,
Expand Down

0 comments on commit d87a43e

Please sign in to comment.