UnindexedPFA

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

Trait of the basic usage operations on any PFA.

Type Params
S

The type of all states of the automaton.

T

The type of labels on transitions of the automaton.

Z

Type of style options for Graphviz export.

trait UnindexedFA[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
trait PFA[S, T, Z]
class PFA[S, T]
trait PFABuilder[S, T, A, K, Z]
class PFABuilder[S, T]

Value members

Concrete methods

override
def accepts(s: Seq[T]): Boolean
Definition Classes
override protected
def edgeText(style: Z[S, T], si0: Int, s0: S, ti0: Int, t: T, si1: Int, s1: S): String
Definition Classes
override protected
def edgeText(style: Z[S, T], si0: Int, s0: S, si1: Int, s1: S): String
Definition Classes
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
override
def foreachETransition(action: (S, S) => Unit): Unit
Definition Classes
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
override
Definition Classes
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
override protected
def plotInitialStateMarker(sb: StringBuilder, style: Z[S, T], s: S, idx: Int): Unit
Definition Classes
protected
override
Definition Classes
Any
override
def transitions(s: S, t: T): Set[S]
Definition Classes

Inherited methods

def acceptsProb(ts: Seq[T]): Double

Calculate the probability that the automaton accepts the given sequence

Calculate the probability that the automaton accepts the given sequence

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

Return the pairs comprising all unlabelled transitions.

Return the pairs comprising all unlabelled transitions.

Inherited from
UnindexedFA
def eTransitionProb(s0: S, s1: S): Double

Returns the probability of a transition state s0 into state s1 without a labeled event.

Returns the probability of a transition state s0 into state s1 without a labeled event.

Inherited from
UnindexedPFA

Returns the probability that s is a final state of this automaton.

Returns the probability that s is a final state of this automaton.

Inherited from
UnindexedPFA
protected
Inherited from
UnindexedFA
def foreachETransition(action: (S, S, Double) => Unit { def apply(s1: S, s2: S, prob: Double): Unit; }): Unit

Perform some action for each epsilon transition in the automaton. Note that in many (deterministic) automata, this method is a no-op, but in included for an easy consistency.

Perform some action for each epsilon transition in the automaton. Note that in many (deterministic) automata, this method is a no-op, but in included for an easy consistency.

Inherited from
UnindexedPFA
override
def foreachFinalState(action: S => Unit { def apply(s: S): Unit; }): Unit
Definition Classes
Inherited from
UnindexedFA
def foreachFinalState(action: (S, Double) => Unit { def apply(s: S, prob: Double): Unit; }): Unit

Perform some action for each final state in the automaton.

Perform some action for each final state in the automaton.

Inherited from
UnindexedPFA
override
def foreachInitialState(action: S => Unit { def apply(s: S): Unit; }): Unit
Definition Classes
Inherited from
UnindexedFA
def foreachInitialState(action: (S, Double) => Unit { def apply(s: S, prob: Double): Unit; }): Unit

Perform some action for each initial state in the automaton.

Perform some action for each initial state in the automaton.

Inherited from
UnindexedPFA
override
def foreachState(action: S => Unit { def apply(s: S): Unit; }): Unit
Definition Classes
Inherited from
UnindexedFA
def foreachState(action: (S, Double) => Unit { def apply(s: S, prob: Double): Unit; }): Unit

Perform some action for each state in the automaton.

Perform some action for each state in the automaton.

Inherited from
UnindexedPFA
override
def foreachTransition(action: (S, T, S) => Unit { def apply(s1: S, t: T, s2: S): Unit; }): Unit
Definition Classes
Inherited from
UnindexedFA
def foreachTransition(action: (S, T, S, Double) => Unit { def apply(s1: S, t: T, s2: S, prob: Double): Unit; }): Unit

Perform some action for each transition in the automaton.

Perform some action for each transition in the automaton.

Inherited from
UnindexedPFA
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

Returns the probability that s is an initial state of this automaton.

Returns the probability that s is an initial state of this automaton.

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
def isState(s: S): Boolean

Returns true if s is used as a state

Returns true if s is used as a state

Inherited from
UnindexedFA

Set of automaton transition labels

Set of automaton transition labels

Inherited from
UnindexedFA
def map[S2, T2](stateMap: S => S2, transitionMap: T => T2): UnindexedFA[S2, T2, Z]

Derive a new isomorphic automaton from this one by applying transforms to the states and transitions. This method does not check that either map is injective: if they are not, then the result may be unpredictable.

Derive a new isomorphic automaton from this one by applying transforms to the states and transitions. This method does not check that either map is injective: if they are not, then the result may be unpredictable.

Inherited from
UnindexedFA
def mapStates[S2](stateMap: S => S2): UnindexedFA[S2, T, Z]

Derive a new isomorphic automaton from this one by applying transforms to the states. This method does not check that the stateMap is injective: if it is not, then the result may have separate states which cannot be distinguished.

Derive a new isomorphic automaton from this one by applying transforms to the states. This method does not check that the stateMap is injective: if it is not, then the result may have separate states which cannot be distinguished.

Inherited from
UnindexedFA
def mapTransitions[T2](transitionMap: T => T2): UnindexedFA[S, T2, Z]

Derive a new isomorphic automaton from this one by applying transforms to the transitions. This method does not check that the transitionMap is injective: if it is not, then the result may have separate transitions which cannot be distinguished.

Derive a new isomorphic automaton from this one by applying transforms to the transitions. This method does not check that the transitionMap is injective: if it is not, then the result may have separate transitions which cannot be distinguished.

Inherited from
UnindexedFA
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
def size: Int

Number of states in the automaton

Number of states in the automaton

Inherited from
UnindexedFA

The states themselves

The states themselves

Inherited from
UnindexedFA
override
def toDOT(using Z[S, T]): String
Definition Classes
UnindexedFA -> Graphable
Inherited from
UnindexedFA
def transitionProb(s0: S, t: T, s1: S): Double

Returns the probability that from state s0 and with label t, this state would transition into state s1.

Returns the probability that from state s0 and with label t, this state would transition into state s1.

Inherited from
UnindexedPFA
override
Definition Classes
Inherited from
UnindexedFA