Struct EpsilonTransition
An epsilon transition in an automaton, defined by a starting state and an ending state.
Inherited Members
Namespace: Automata.Core
Assembly: Automata.Core.dll
Syntax
public readonly record struct EpsilonTransition : IComparable<EpsilonTransition>, IEquatable<EpsilonTransition>
Remarks
An epsilon transition is a transition that lacks a symbol. Epsilon transitions can only exist in non-deterministic finite automata (NFA).
Constructors
| Edit this page View SourceEpsilonTransition(int, int)
Initializes a new instance of the EpsilonTransition struct.
Declaration
public EpsilonTransition(int fromState, int toState)
Parameters
Type | Name | Description |
---|---|---|
int | fromState | The state origin of the transition. |
int | toState | The destination state of the transition. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown if any of arguments has a negative value. |
Fields
| Edit this page View SourceEpsilon
String representation for ε - the empty epsilon string. Epsilon is not part of any alphabet; the symbol is used solely for output purposes, never for computation.
Declaration
public const string Epsilon = "ε"
Field Value
Type | Description |
---|---|
string |
Properties
| Edit this page View SourceFromState
The state origin of the transition.
Declaration
public int FromState { get; }
Property Value
Type | Description |
---|---|
int |
ToState
The destination state of the transition.
Declaration
public int ToState { get; }
Property Value
Type | Description |
---|---|
int |
Methods
| Edit this page View SourceCompareTo(EpsilonTransition)
Compares the current epsilon transition to another epsilon transition.
Declaration
public int CompareTo(EpsilonTransition other)
Parameters
Type | Name | Description |
---|---|---|
EpsilonTransition | other | Other epsilon transition to compare to. |
Returns
Type | Description |
---|---|
int | An integer that indicates the relative order of the objects being compared. |
Reverse()
Reverses the epsilon transition.
Declaration
public EpsilonTransition Reverse()
Returns
Type | Description |
---|---|
EpsilonTransition | A new EpsilonTransition with the from and to states swapped. |
ToString()
String that represents the current transition.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string that represents the current transition. |