DFA

class DFA[S, T](val stateSeq: IndexedSeq[S], val initialStateIndex: Int, val finalStateIndices: Set[Int], val transitionsSeq: IndexedSeq[T], val transitionsMatrix: Array[Array[Int]]) extends DFA[S, T, AutomatonStyle]

Implementation of DFAs.

Type Params
S

The type of all states of the automaton

T

The type of labels on transitions of the automaton

Companion
object
trait FA[S, T, AutomatonStyle]
trait FA[S, T, AutomatonStyle]
trait Pretty
trait Graphable[S, T, AutomatonStyle]
class Object
trait Matchable
class Any

Value members

Concrete methods

def assembleDFA[S0, T0](stateSeq: IndexedSeq[S0], transitionsSeq: IndexedSeq[T0], initialStateIndex: Int, finalStateIndices: Set[Int], transitionsMatrix: Array[Array[Int]]): DFA[S0, T0]

Inherited methods

override
def accepts(string: Seq[T]): Boolean
Definition Classes
Inherited from
DFA
protected
def afterStatePlot(sb: StringBuilder, style: AutomatonStyle[S, T], stateList: IndexedSeq[S], stateMap: Map[S, Int]): Unit
Inherited from
UnindexedFA
protected
def assemblePrettyTransition(before: Doc, arrow: Doc, after: Doc): Doc
Inherited from
UnindexedFA
override protected
Definition Classes
Inherited from
FA
def dump(out: PrintStream): Unit
Inherited from
UnindexedFA
override
Definition Classes
Inherited from
UnindexedDFA
protected
def edgeText(style: AutomatonStyle[S, T], si0: Int, s0: S, si1: Int, s1: S): String
Inherited from
UnindexedFA
protected
def edgeText(style: AutomatonStyle[S, T], si0: Int, s0: S, ti0: Int, t: T, si1: Int, s1: S): String
Inherited from
UnindexedFA
override
Definition Classes
Inherited from
FA
protected
Inherited from
UnindexedFA
override
def foreachETransition(action: (S, S) => Unit { def apply(s1: S, s2: S): Unit; }): Unit
Definition Classes
Inherited from
UnindexedDFA
override
def foreachFinalState(action: S => Unit { def apply(s: S): Unit; }): Unit
Definition Classes
Inherited from
UnindexedFA
override
def foreachInitialState(action: S => Unit { def apply(s: S): Unit; }): Unit
Definition Classes
Inherited from
UnindexedFA
override
def foreachState(action: S => Unit { def apply(s: S): Unit; }): Unit
Definition Classes
Inherited from
UnindexedFA
override
def foreachTransition(action: (S, T, S) => Unit { def apply(s1: S, t: T, s2: S): Unit; }): Unit
Definition Classes
Inherited from
UnindexedFA
override
Definition Classes
FA -> FA
Inherited from
FA
override
Definition Classes
FA -> FA
Inherited from
FA
def graphviz(sourceFile: String, outputFile: String)(using options: AutomatonStyle[S, T]): Unit

Use Graphviz to render this object as specified.

Use Graphviz to render this object as specified.

Inherited from
Graphable
def graphviz(fileRoot: String)(using options: AutomatonStyle[S, T]): Unit

Use Graphviz to render this object (in the default format) to the given file.

Use Graphviz to render this object (in the default format) to the given file.

Inherited from
Graphable
protected
def initPlot(sb: StringBuilder, states: Int, labels: Int): Unit
Inherited from
UnindexedFA
override
Definition Classes
DFA -> FA
Inherited from
DFA
protected
def internalsToDOT(stateList: IndexedSeq[S], stateMap: Map[S, Int], theLabels: IndexedSeq[T], sb: StringBuilder)(using style: AutomatonStyle[S, T]): Unit

Internal routine used by [[#toDOT]]. Subclesses may override, but still call super.internalsToDOT, to extend the Graphviz representation of a DFA.

Internal routine used by [[#toDOT]]. Subclesses may override, but still call super.internalsToDOT, to extend the Graphviz representation of a DFA.

Inherited from
UnindexedFA
override
Definition Classes
Inherited from
FA
override
Definition Classes
Inherited from
FA
override
def isState(s: S): Boolean
Definition Classes
Inherited from
FA
override
def label(i: Int): T
Definition Classes
FA -> FA
Inherited from
FA
override
Definition Classes
Inherited from
FA
override
def map[S2, T2](stateMap: S => S2, transitionMap: T => T2): DFA[S2, T2, AutomatonStyle]
Definition Classes
Inherited from
DFA
override
def mapStates[S2](stateMap: S => S2): DFA[S2, T, AutomatonStyle]
Definition Classes
Inherited from
DFA
override
def mapTransitions[T2](transitionMap: T => T2): DFA[S, T2, AutomatonStyle]
Definition Classes
Inherited from
DFA
protected

Add decorations for an initial state.

Add decorations for an initial state.

Inherited from
UnindexedFA
protected
def plotPresentEdge(sb: StringBuilder, style: AutomatonStyle[S, T], stateList: IndexedSeq[S], stateMap: Map[S, Int], si0: Int, s0: S, si1: Int, s1: S): Unit
Inherited from
UnindexedFA
protected
def plotPresentEdge(sb: StringBuilder, style: AutomatonStyle[S, T], stateList: IndexedSeq[S], stateMap: Map[S, Int], si0: Int, s0: S, ti0: Int, t: T, si1: Int, s1: S): Unit
Inherited from
UnindexedFA
protected
def plotState(sb: StringBuilder, style: AutomatonStyle[S, T], si: Int, s: S, isInitial: Boolean, isFinal: Boolean): Unit
Inherited from
UnindexedFA
protected
def plotTransitions(stateList: IndexedSeq[S], stateMap: Map[S, Int], theLabels: IndexedSeq[T], sb: StringBuilder, style: AutomatonStyle[S, T]): Unit
Inherited from
UnindexedFA
def pretty: Doc
Inherited from
UnindexedFA
protected
def prettyETransition(src: S, dest: S): Doc
Inherited from
UnindexedFA
protected
def prettyETransitionArrow(src: S, dest: S): Doc
Inherited from
UnindexedFA
protected
def prettyFooter: Doc
Inherited from
UnindexedFA
override protected
def prettyHeader: Doc
Definition Classes
Inherited from
DFA
protected
def prettyState(s: S): Doc
Inherited from
UnindexedFA
override protected
def prettyStateInTransition(state: S): Doc
Definition Classes
Inherited from
FA
override protected
def prettyStateLeader(s: S): Doc
Definition Classes
Inherited from
FA
protected
def prettyStates: Doc
Inherited from
UnindexedFA
protected
def prettyTransition(src: S, label: T, dest: S): Doc
Inherited from
UnindexedFA
protected
def prettyTransitionArrow(src: S, label: T, dest: S): Doc
Inherited from
UnindexedFA
protected
Inherited from
UnindexedFA
override
def size: Int
Definition Classes
Inherited from
FA
override
def state(i: Int): S
Definition Classes
FA -> FA
Inherited from
FA
override
Definition Classes
Inherited from
FA
override
def toDOT(using AutomatonStyle[S, T]): String
Definition Classes
FA -> UnindexedFA -> Graphable
Inherited from
FA
override
def transition(s: S, t: T): Option[S]
Definition Classes
Inherited from
DFA
override
def transitionIndex(si: Int, ti: Int): Option[Int]
Definition Classes
DFA -> DFA
Inherited from
DFA
override
Definition Classes
Inherited from
UnindexedFA
override
def transitions(s: S, t: T): Set[S]
Definition Classes
Inherited from
UnindexedDFA

Concrete fields

Inherited fields

override
val indexOf: Map[S, Int]
Inherited from
FA
override
Inherited from
DFA
override
Inherited from
DFA
override
Inherited from
FA