PFA

trait PFA[S, T, -Z <: (ProbabilisticAutomatonStyle)] extends PFA[S, T, Z] with UnindexedPFA[S, T, Z]

Implementation of a DFA using `IndexedSeq`s and Arrays.

Type Params
S

The type of all states of the automaton

T

The type of labels on (non-epsilon) transitions of the automaton

Value Params
finalStateIndices

Set of the indices of the final states of the automaton

initialStateIndex

Index of the initial state of the automaton.

trait UnindexedPFA[S, T, Z]
trait UnindexedFA[S, T, Z]
trait PFA[S, T, Z]
trait FA[S, T, Z]
trait UnindexedPFA[S, T, Z]
trait UnindexedFA[S, T, Z]
trait Pretty
trait Graphable[S, T, Z]
class Object
trait Matchable
class Any
class PFA[S, T]

Value members

Abstract methods

def assemblePFA[S0, T0](stateSeq: IndexedSeq[S0], initialProbs: Array[Double], finalProbs: Array[Double], transitionsSeq: IndexedSeq[T0], transitionsMatrix: Array[Array[Array[Double]]], eTransitionsMatrix: Array[Array[Double]]): PFA[S0, T0, Z]

Internal method for instantiating a PFA of the appropriate runtime type.

Internal method for instantiating a PFA of the appropriate runtime type.

protected
protected
protected
protected

Concrete methods

override
def acceptsProb(ts: Seq[T]): Double
Definition Classes
override
Definition Classes
override
Definition Classes
override
def eTransitionProb(s0: S, s1: S): Double
Definition Classes
override
Definition Classes
override
Definition Classes
override
def foreachETransition(action: (S, S, Double) => Unit): Unit
Definition Classes
override
def foreachFinalState(action: (S, Double) => Unit): Unit
Definition Classes
override
def foreachInitialState(action: (S, Double) => Unit): Unit
Definition Classes
override
def foreachState(action: (S, Double) => Unit): Unit
Definition Classes
override
def foreachTransition(action: (S, T, S, Double) => Unit): Unit
Definition Classes
override
Definition Classes
override
Definition Classes
override
Definition Classes
override
Definition Classes
override
def isState(s: S): Boolean
Definition Classes
override
def label(i: Int): T
Definition Classes
override
Definition Classes
override
def map[S2, T2](stateMap: S => S2, transitionMap: T => T2): PFA[S2, T2, Z]
Definition Classes
override
def mapStates[S2](stateMap: S => S2): PFA[S2, T, Z]
Definition Classes
override
def mapTransitions[T2](transitionMap: T => T2): PFA[S, T2, Z]
Definition Classes
override
def possibleTransitions(s0: S, t: T): Map[S, Double]
Definition Classes
override
Definition Classes
override
def size: Int
Definition Classes
override
def state(i: Int): S
Definition Classes
override
Definition Classes
override
def transitionIndexProb(fromIdx: Int, labelIdx: Int, toIdx: Int): Double
Definition Classes
override
def transitionProb(s0: S, t: T, s1: S): Double
Definition Classes

Inherited methods

override
def accepts(s: Seq[T]): Boolean
Definition Classes
Inherited from
UnindexedPFA
protected
def afterStatePlot(sb: StringBuilder, style: Z[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
protected
Inherited from
UnindexedFA
def dump(out: PrintStream): Unit
Inherited from
UnindexedFA
override protected
def edgeText(style: Z[S, T], si0: Int, s0: S, si1: Int, s1: S): String
Definition Classes
Inherited from
UnindexedPFA
override protected
def edgeText(style: Z[S, T], si0: Int, s0: S, ti0: Int, t: T, si1: Int, s1: S): String
Definition Classes
Inherited from
UnindexedPFA
override

Returns the Set of final states in this automaton. For PFAs, this method returns the states which map via [[org.maraist.fa.PFA#finalStateProb]] to a non-zero probability.

Returns the Set of final states in this automaton. For PFAs, this method returns the states which map via [[org.maraist.fa.PFA#finalStateProb]] to a non-zero probability.

Definition Classes
Inherited from
UnindexedPFA
protected
Inherited from
UnindexedFA
override
def foreachETransition(action: (S, S) => Unit): Unit
Definition Classes
Inherited from
UnindexedPFA
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
def graphviz(sourceFile: String, outputFile: String)(using options: Z[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: Z[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

Returns the Set of initial states in this automaton. For PFAs, this method returns the states which map via [[org.maraist.fa.PFA#initialStateProb]] to a non-zero probability.

Returns the Set of initial states in this automaton. For PFAs, this method returns the states which map via [[org.maraist.fa.PFA#initialStateProb]] to a non-zero probability.

Definition Classes
Inherited from
UnindexedPFA
protected
def internalsToDOT(stateList: IndexedSeq[S], stateMap: Map[S, Int], theLabels: IndexedSeq[T], sb: StringBuilder)(using style: Z[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
UnindexedPFA
override

Returns whether the given state s is initial in this automaton. For PFAs, this method returns true if s has a non-zero chance of being an initial state of the automaton.

Returns whether the given state s is initial in this automaton. For PFAs, this method returns true if s has a non-zero chance of being an initial state of the automaton.

Definition Classes
Inherited from
UnindexedPFA
protected
Inherited from
UnindexedPFA
override protected
def plotInitialStateMarker(sb: StringBuilder, style: Z[S, T], s: S, idx: Int): Unit
Definition Classes
Inherited from
UnindexedPFA
protected
def plotPresentEdge(sb: StringBuilder, style: Z[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: Z[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: Z[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: Z[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
protected
def prettyHeader: Doc
Inherited from
UnindexedFA
protected
def prettyState(s: S): Doc
Inherited from
UnindexedFA
protected
def prettyStateInTransition(state: S): Doc
Inherited from
UnindexedFA
protected
def prettyStateLeader(s: S): Doc
Inherited from
UnindexedFA
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 toDOT(using Z[S, T]): String
Definition Classes
UnindexedFA -> Graphable
Inherited from
UnindexedFA
override
Definition Classes
Inherited from
UnindexedPFA
override
Definition Classes
Inherited from
UnindexedFA
override
def transitions(s: S, t: T): Set[S]
Definition Classes
Inherited from
UnindexedPFA

Concrete fields

override
override
val indexOf: Map[S, Int]
override
override