base_types package¶
Submodules¶
base_types.alphabet module¶
-
class
base_types.alphabet.Alphabet(symbols: frozenset, name: Optional[str] = None)¶ Bases:
objectSet of Symbols.
base_types.sequence module¶
base_types.state module¶
-
class
base_types.state.State(name: str, is_final: bool = False)¶ Bases:
objectRepresentation of NFA or DFA states.
-
name¶ State name.
- Type
str
-
is_final¶ Determines if the state is final.
- Type
bool
-
transitions¶ For any given symbol represents the next state (or set of states in the case of NFA).
- Type
dict[Symbol, set[‘State’]]
-
hole¶ Hole state, state containing all transitions directed to itself. It is used as default when a symbol is not present as transition key.
-
add_hole_transition(hole: base_types.state.State) → None¶
-
add_multiple_transitions(symbol: base_types.symbol.Symbol, next_states: list) → None¶
-
add_transition(symbol: base_types.symbol.Symbol, next_state: base_types.state.State) → None¶
-
hole: base_types.state.State¶
-
property
is_deterministic¶
-
next_state_for(symbol: base_types.symbol.Symbol) → base_types.state.State¶
-
next_states_for(symbol: base_types.symbol.Symbol) → set¶
-