base_types package

Submodules

base_types.alphabet module

class base_types.alphabet.Alphabet(symbols: frozenset, name: Optional[str] = None)

Bases: object

Set of Symbols.

base_types.sequence module

class base_types.sequence.Sequence(value: list = [])

Bases: object

Ordered collection of Symbols.

append(symbol_to_append: base_types.symbol.Symbol)
get_prefixes()list
get_suffixes()list
property value

base_types.state module

class base_types.state.State(name: str, is_final: bool = False)

Bases: object

Representation 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.

Type

base_types.state.State

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

base_types.symbol module

class base_types.symbol.Symbol

Bases: abc.ABC

Abstract class representing symbols.

abstract property value
class base_types.symbol.SymbolStr(value: str)

Bases: base_types.symbol.Symbol

Symbol specification using string as a representation.

property value