Class FsaDet
Inherited Members
Namespace: Automata.Core
Assembly: Automata.Core.dll
Syntax
public abstract class FsaDet : Fsa
Constructors
| Edit this page View SourceFsaDet(Alphabet)
Initializes a new instance with the specified alphabet.
Declaration
public FsaDet(Alphabet alphabet)
Parameters
Type | Name | Description |
---|---|---|
Alphabet | alphabet | Alphabet used by the automaton. |
Properties
| Edit this page View SourceAcceptsEpsilon
Indicates whether the automaton accepts ϵ - the empty sting.
Returns trueiff
an InitialState exists and it is also a final state.
Declaration
public override bool AcceptsEpsilon { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
| Edit this page View SourceHasInitialState
Indicates whether the automaton has an initial state.
Declaration
public override bool HasInitialState { get; }
Property Value
Type | Description |
---|---|
bool | true
|
Overrides
| Edit this page View SourceInitialState
Initial state of the deterministic automaton.
Declaration
public abstract int InitialState { get; }
Property Value
Type | Description |
---|---|
int |
IsEpsilonFree
Indicates whether the MFA is epsilon-free. Always returns true.
Declaration
public override bool IsEpsilonFree { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
| Edit this page View SourceMaxState
Upper limit for the maximum state number in the DFA.
A value (MaxState + 1) is guaranteed to be an unused state number.
Declaration
public abstract int MaxState { get; }
Property Value
Type | Description |
---|---|
int |
StateRange
Range of states in this automaton.
Any value from End and higher is guaranteed to be free and not used by the automaton.
Declaration
public abstract Range StateRange { get; }
Property Value
Type | Description |
---|---|
Range |
TransitionCount
Number of transitions in the automaton.
Declaration
public abstract int TransitionCount { get; }
Property Value
Type | Description |
---|---|
int |
Methods
| Edit this page View SourceAccepts(IEnumerable<int>)
Indicates whether the automaton accepts the given sequence of symbols as integers.
Declaration
public bool Accepts(IEnumerable<int> sequence)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<int> | sequence | Sequence of symbols to check. |
Returns
Type | Description |
---|---|
bool | true
|
Remarks
The automaton processes each symbol in the sequence, transitioning between states according to its transition function. If the automaton reaches a final state after processing all symbols, the sequence is accepted.
Accepts(IEnumerable<string>)
Indicates whether the automaton accepts the given sequence of symbols as strings.
Declaration
public bool Accepts(IEnumerable<string> sequence)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<string> | sequence | Sequence of symbols to check. |
Returns
Type | Description |
---|---|
bool | true
|
Remarks
The automaton processes each symbol in the sequence, transitioning between states according to its transition function. If the automaton reaches a final state after processing all symbols, the sequence is accepted.
EpsilonTransitions()
Epsilon transitions of the MFA, which is always empty.
Declaration
public override IReadOnlyCollection<EpsilonTransition> EpsilonTransitions()
Returns
Type | Description |
---|---|
IReadOnlyCollection<EpsilonTransition> | An empty collection of EpsilonTransition. |
Overrides
| Edit this page View SourceIsInitial(int)
Indicates whether the specified state is the initial state.
Declaration
public override bool IsInitial(int state)
Parameters
Type | Name | Description |
---|---|---|
int | state | State to check. |
Returns
Type | Description |
---|---|
bool | true
|
Overrides
| Edit this page View SourceState(int)
Returns a readonly view of the specified state.
Declaration
public abstract StateView State(int fromState)
Parameters
Type | Name | Description |
---|---|---|
int | fromState | State from which to get the state view. |
Returns
Type | Description |
---|---|
StateView | A StateView representing the state view from the specified state. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException |
|
StatePath(IEnumerable<int>)
Sequence of states visited by the automaton for the given input sequence as integers.
Declaration
public IEnumerable<int> StatePath(IEnumerable<int> sequence)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<int> | sequence | Sequence of input symbols. |
Returns
Type | Description |
---|---|
IEnumerable<int> | An IEnumerable<T> of state indices representing the path taken by the automaton. |
Remarks
The method yields each state as it is visited. The result sequence may be partial, if the entire input is not accepted by this automaton. For a complete path, the number of states is sequence.Length + 1, with the last state being a final state.
StatePath(IEnumerable<string>)
Sequence of states visited by the automaton for the given input sequence as string.
Declaration
public IEnumerable<int> StatePath(IEnumerable<string> sequence)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<string> | sequence | Sequence of input symbols. |
Returns
Type | Description |
---|---|
IEnumerable<int> | An IEnumerable<T> of state indices representing the path taken by the automaton. |
Remarks
The method yields each state as it is visited. The result sequence may be partial, if the entire input is not accepted by this automaton.
Transition(int, int)
Returns the state reachable from the given state on the given symbol.
Declaration
public abstract int Transition(int fromState, int symbol)
Parameters
Type | Name | Description |
---|---|---|
int | fromState | The state origin of the transition. |
int | symbol | Symbol for the transition. |
Returns
Type | Description |
---|---|
int | The state reachable from the given state on the given symbol. If no such transition exists, InvalidState is returned. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException |
|
See Also
| Edit this page View SourceTryTransition(int, int, out int)
Tries to get the state reachable from the given state on the given symbol.
Declaration
public bool TryTransition(int fromState, int symbol, out int toState)
Parameters
Type | Name | Description |
---|---|---|
int | fromState | The state origin of the transition. |
int | symbol | Symbol for the transition. |
int | toState | The reachable state, or InvalidState if no state is reachable. |
Returns
Type | Description |
---|---|
bool | true
|