Class FiniteAutomaton<S,A>
java.lang.Object
org.episteme.core.mathematics.discrete.FiniteAutomaton<S,A>
Deterministic Finite Automaton (DFA).
A DFA is defined by M = (Q, Σ, δ, q₀, F) where:
- Q is a finite set of states
- Σ is the input alphabet
- δ: Q × Σ → Q is the transition function
- q₀ ∈ Q is the initial state
- F ⊆Q is the set of accepting states
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanTests if this automaton accepts the given input string.booleanChecks if this automaton is minimal (has no unreachable or equivalent states).Returns all states reachable from the initial state.
-
Constructor Details
-
FiniteAutomaton
public FiniteAutomaton(Set<S> states, Set<A> alphabet, Map<S, Map<A, S>> transitions, S initialState, Set<S> acceptingStates) Constructs a DFA.- Parameters:
states- set of all statesalphabet- input alphabettransitions- transition functioninitialState- initial stateacceptingStates- accepting (final) states
-
-
Method Details
-
accepts
-
reachableStates
-
isMinimal
public boolean isMinimal()Checks if this automaton is minimal (has no unreachable or equivalent states).- Returns:
- true if minimal
-
getStates
-
getAlphabet
-
getInitialState
-
getAcceptingStates
-