Skip to content

Implement a way to convert an FSM constraint suffix into an FSM state allowlist #160

@lgarron

Description

@lgarron

We convert the prefix constraint into a state, which can be used immediately at the top-level search node:

let initial_state = self
.apply_optional_fsm_moves(
CANONICAL_FSM_START_STATE,
&individual_search_data
.individual_search_options
.canonical_fsm_pre_moves,
)

For the suffix, we actually try applying the moves:

if self
.apply_optional_fsm_moves(
current_state,
&individual_search_data
.individual_search_options
.canonical_fsm_post_moves,
)
.is_none()

We could instead take every possible state and see which ones allow the suffix to be applied. Those can then either be pre-calculated or can be cached for lookup when calculated during the search.

This work will hopefully also give us a way to replace the pre-move and post-move vectors with something (either data or a dynamic helper) that allows FSM constraints to be easily propagated across phases without manual code. (See this TODO.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions