Class DfaReverseLookup
Provides a reverse lookup for a DFA.
Specifically:
- Get the set of states that can transition to a given state with a given symbol.
- Get the set of symbols that can transition to a given state.
Inherited Members
Namespace: Automata.Core
Assembly: Automata.Core.dll
Syntax
public class DfaReverseLookup
Constructors
| Edit this page View SourceDfaReverseLookup(Dfa)
Initializes a new instance of the DfaReverseLookup class using the specified DFA.
Declaration
public DfaReverseLookup(Dfa dfa)
Parameters
| Type | Name | Description |
|---|---|---|
| Dfa | dfa | The DFA to initialize the reverse lookup from. |
Remarks
Initially, this method perform a trim operation on the DFA that removes states that are not both accessible and co-accessible.
Properties
| Edit this page View SourceAllStates
All states in the DFA after trimming.
Declaration
public ISet<int> AllStates { get; }
Property Value
| Type | Description |
|---|---|
| ISet<int> |
Methods
| Edit this page View SourceAddSymbols(IntSet, HashSet<int>)
Adds the symbols for the specified to-states to the provided set of symbols.
Declaration
public void AddSymbols(IntSet toStates, HashSet<int> symbols)
Parameters
| Type | Name | Description |
|---|---|---|
| IntSet | toStates | Set of destination states. |
| HashSet<int> | symbols | Set of symbols to add to. |
FromStates(IntSet, int)
The set of states that can transition to any of the specified to-states with the specified symbol.
Declaration
public IntSet FromStates(IntSet toStates, int symbol)
Parameters
| Type | Name | Description |
|---|---|---|
| IntSet | toStates | Set of destination states. |
| int | symbol | The transition symbol. |
Returns
| Type | Description |
|---|---|
| IntSet | Set of from-states. |
FromStates(int, int)
The set of states that can transition to the specified state with the specified symbol.
Declaration
public IntSet FromStates(int toState, int symbol)
Parameters
| Type | Name | Description |
|---|---|---|
| int | toState | The destination state. |
| int | symbol | The transition symbol. |
Returns
| Type | Description |
|---|---|
| IntSet | Set of from-states. |
Symbols(int)
Gets the array of symbols for the specified to-state. The returned symbols are unique and ordered.
Declaration
public int[] Symbols(int toState)
Parameters
| Type | Name | Description |
|---|---|---|
| int | toState | The destination state. |
Returns
| Type | Description |
|---|---|
| int[] | Array of symbols. |