#[repr(transparent)]pub struct TropicalWeight(pub OrderedFloat<f64>);Expand description
Tropical semiring weight.
Internally stores an f64 representing cost. Lower values are better.
Infinity represents unreachable/impossible states.
Tuple Fields§
§0: OrderedFloat<f64>Implementations§
Source§impl TropicalWeight
impl TropicalWeight
Sourcepub fn is_valid_raw(value: f64) -> bool
pub fn is_valid_raw(value: f64) -> bool
Return true when a raw f64 belongs to the verified tropical domain:
any finite real cost or positive infinity for the additive identity.
Sourcepub fn new(value: f64) -> TropicalWeight
pub fn new(value: f64) -> TropicalWeight
Create a new tropical weight from a raw f64.
The verified Rocq model is R ∪ {+∞}. This constructor rejects NaN
and -∞, which have no counterpart in that model and break semiring
laws under IEEE-754 arithmetic.
Sourcepub fn try_new(value: f64) -> Option<TropicalWeight>
pub fn try_new(value: f64) -> Option<TropicalWeight>
Try to create a tropical weight in the verified domain.
Sourcepub const fn new_unchecked(value: f64) -> TropicalWeight
pub const fn new_unchecked(value: f64) -> TropicalWeight
Create a tropical weight without checking the verified-domain boundary.
This is only for low-level interop that must preserve arbitrary IEEE-754
payloads. Semiring algorithms and verified paths should use Self::new
or Self::try_new.
Sourcepub const fn infinity() -> TropicalWeight
pub const fn infinity() -> TropicalWeight
Create a tropical weight representing infinity (unreachable).
Sourcepub fn is_infinite(self) -> bool
pub fn is_infinite(self) -> bool
Check if this weight represents infinity.
Trait Implementations§
Source§impl Add for TropicalWeight
impl Add for TropicalWeight
Source§fn add(self, other: TropicalWeight) -> TropicalWeight
fn add(self, other: TropicalWeight) -> TropicalWeight
Operator + implements semiring ⊕ (min).
Source§type Output = TropicalWeight
type Output = TropicalWeight
+ operator.Source§impl AddAssign for TropicalWeight
impl AddAssign for TropicalWeight
Source§fn add_assign(&mut self, other: TropicalWeight)
fn add_assign(&mut self, other: TropicalWeight)
+= operation. Read moreSource§impl Clone for TropicalWeight
impl Clone for TropicalWeight
Source§fn clone(&self) -> TropicalWeight
fn clone(&self) -> TropicalWeight
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl CommutativeTimesSemiring for TropicalWeight
TropicalWeight has commutative multiplication: a + b = b + a
impl Copy for TropicalWeight
Source§impl Debug for TropicalWeight
impl Debug for TropicalWeight
Source§impl Default for TropicalWeight
impl Default for TropicalWeight
Source§fn default() -> TropicalWeight
fn default() -> TropicalWeight
Default is zero (multiplicative identity), not infinity.
Source§impl DivisibleSemiring for TropicalWeight
impl DivisibleSemiring for TropicalWeight
Source§fn divide(&self, other: &TropicalWeight) -> Option<TropicalWeight>
fn divide(&self, other: &TropicalWeight) -> Option<TropicalWeight>
Division: a - b
impl Eq for TropicalWeight
Source§impl From<f64> for TropicalWeight
impl From<f64> for TropicalWeight
Source§fn from(value: f64) -> TropicalWeight
fn from(value: f64) -> TropicalWeight
Source§impl Hash for TropicalWeight
impl Hash for TropicalWeight
impl IdempotentSemiring for TropicalWeight
TropicalWeight is idempotent: min(a, a) = a
Source§impl KClosedSemiring for TropicalWeight
TropicalWeight is k-closed with k=0 for non-negative weights.
impl KClosedSemiring for TropicalWeight
TropicalWeight is k-closed with k=0 for non-negative weights.
For the tropical semiring with non-negative weights:
a* = min(0, a, 2a, 3a, ...) = 0immediately (k=0)
Note: This assumes the domain is restricted to non-negative weights. Negative weights would cause the star to diverge.
Source§impl<V, D> LazyWfst<char, TropicalWeight> for UniversalLevenshteinWfst<V, D>
impl<V, D> LazyWfst<char, TropicalWeight> for UniversalLevenshteinWfst<V, D>
Source§fn is_expanded(&self, state: StateId) -> bool
fn is_expanded(&self, state: StateId) -> bool
Source§fn transitions_lazy(
&mut self,
state: StateId,
) -> &[WeightedTransition<char, TropicalWeight>]
fn transitions_lazy( &mut self, state: StateId, ) -> &[WeightedTransition<char, TropicalWeight>]
Source§fn cache_policy(&self) -> CachePolicy
fn cache_policy(&self) -> CachePolicy
Source§fn set_cache_policy(&mut self, policy: CachePolicy)
fn set_cache_policy(&mut self, policy: CachePolicy)
Source§fn computed_states(&self) -> usize
fn computed_states(&self) -> usize
Source§fn clear_cache(&mut self)
fn clear_cache(&mut self)
Source§impl<D> LazyWfst<char, TropicalWeight> for LevenshteinWfst<D>
impl<D> LazyWfst<char, TropicalWeight> for LevenshteinWfst<D>
Source§fn is_expanded(&self, state: StateId) -> bool
fn is_expanded(&self, state: StateId) -> bool
Source§fn transitions_lazy(
&mut self,
state: StateId,
) -> &[WeightedTransition<char, TropicalWeight>]
fn transitions_lazy( &mut self, state: StateId, ) -> &[WeightedTransition<char, TropicalWeight>]
Source§fn cache_policy(&self) -> CachePolicy
fn cache_policy(&self) -> CachePolicy
Source§fn set_cache_policy(&mut self, policy: CachePolicy)
fn set_cache_policy(&mut self, policy: CachePolicy)
Source§fn computed_states(&self) -> usize
fn computed_states(&self) -> usize
Source§fn clear_cache(&mut self)
fn clear_cache(&mut self)
Source§impl LazyWfst<char, TropicalWeight> for PhoneticNfaWfst
Available on crate feature phonetic-rules only.
impl LazyWfst<char, TropicalWeight> for PhoneticNfaWfst
phonetic-rules only.Source§fn is_expanded(&self, state: StateId) -> bool
fn is_expanded(&self, state: StateId) -> bool
Source§fn transitions_lazy(
&mut self,
state: StateId,
) -> &[WeightedTransition<char, TropicalWeight>]
fn transitions_lazy( &mut self, state: StateId, ) -> &[WeightedTransition<char, TropicalWeight>]
Source§fn cache_policy(&self) -> CachePolicy
fn cache_policy(&self) -> CachePolicy
Source§fn set_cache_policy(&mut self, policy: CachePolicy)
fn set_cache_policy(&mut self, policy: CachePolicy)
Source§fn computed_states(&self) -> usize
fn computed_states(&self) -> usize
Source§fn clear_cache(&mut self)
fn clear_cache(&mut self)
Source§impl LazyWfst<char, TropicalWeight> for RewriteWfst
impl LazyWfst<char, TropicalWeight> for RewriteWfst
Source§fn is_expanded(&self, state: StateId) -> bool
fn is_expanded(&self, state: StateId) -> bool
Source§fn transitions_lazy(
&mut self,
state: StateId,
) -> &[WeightedTransition<char, TropicalWeight>]
fn transitions_lazy( &mut self, state: StateId, ) -> &[WeightedTransition<char, TropicalWeight>]
Source§fn cache_policy(&self) -> CachePolicy
fn cache_policy(&self) -> CachePolicy
Source§fn set_cache_policy(&mut self, policy: CachePolicy)
fn set_cache_policy(&mut self, policy: CachePolicy)
Source§fn computed_states(&self) -> usize
fn computed_states(&self) -> usize
Source§fn clear_cache(&mut self)
fn clear_cache(&mut self)
Source§impl<D> LazyWfst<char, TropicalWeight> for PhoneticWfst<D>
Available on crate feature phonetic-rules only.
impl<D> LazyWfst<char, TropicalWeight> for PhoneticWfst<D>
phonetic-rules only.Source§fn is_expanded(&self, state: StateId) -> bool
fn is_expanded(&self, state: StateId) -> bool
Source§fn transitions_lazy(
&mut self,
state: StateId,
) -> &[WeightedTransition<char, TropicalWeight>]
fn transitions_lazy( &mut self, state: StateId, ) -> &[WeightedTransition<char, TropicalWeight>]
Source§fn cache_policy(&self) -> CachePolicy
fn cache_policy(&self) -> CachePolicy
Source§fn set_cache_policy(&mut self, policy: CachePolicy)
fn set_cache_policy(&mut self, policy: CachePolicy)
Source§fn computed_states(&self) -> usize
fn computed_states(&self) -> usize
Source§fn clear_cache(&mut self)
fn clear_cache(&mut self)
Source§impl<D> LazyWfst<char, TropicalWeight> for GeneralizedWfst<D>
impl<D> LazyWfst<char, TropicalWeight> for GeneralizedWfst<D>
Source§fn is_expanded(&self, state: StateId) -> bool
fn is_expanded(&self, state: StateId) -> bool
Source§fn transitions_lazy(
&mut self,
state: StateId,
) -> &[WeightedTransition<char, TropicalWeight>]
fn transitions_lazy( &mut self, state: StateId, ) -> &[WeightedTransition<char, TropicalWeight>]
Source§fn cache_policy(&self) -> CachePolicy
fn cache_policy(&self) -> CachePolicy
Source§fn set_cache_policy(&mut self, policy: CachePolicy)
fn set_cache_policy(&mut self, policy: CachePolicy)
Source§fn computed_states(&self) -> usize
fn computed_states(&self) -> usize
Source§fn clear_cache(&mut self)
fn clear_cache(&mut self)
Source§impl<'a, D> LazyWfst<char, TropicalWeight> for WallBreakerWfst<'a, D>where
D: Dictionary + SubstringDictionary + Clone + Send + Sync,
D::Node: BidirectionalDictionaryNode,
<D::Node as DictionaryNode>::Unit: Into<u32>,
impl<'a, D> LazyWfst<char, TropicalWeight> for WallBreakerWfst<'a, D>where
D: Dictionary + SubstringDictionary + Clone + Send + Sync,
D::Node: BidirectionalDictionaryNode,
<D::Node as DictionaryNode>::Unit: Into<u32>,
Source§fn is_expanded(&self, state: StateId) -> bool
fn is_expanded(&self, state: StateId) -> bool
Source§fn transitions_lazy(
&mut self,
state: StateId,
) -> &[WeightedTransition<char, TropicalWeight>]
fn transitions_lazy( &mut self, state: StateId, ) -> &[WeightedTransition<char, TropicalWeight>]
Source§fn cache_policy(&self) -> CachePolicy
fn cache_policy(&self) -> CachePolicy
Source§fn set_cache_policy(&mut self, policy: CachePolicy)
fn set_cache_policy(&mut self, policy: CachePolicy)
Source§fn computed_states(&self) -> usize
fn computed_states(&self) -> usize
Source§fn clear_cache(&mut self)
fn clear_cache(&mut self)
Source§impl Mul for TropicalWeight
impl Mul for TropicalWeight
Source§fn mul(self, other: TropicalWeight) -> TropicalWeight
fn mul(self, other: TropicalWeight) -> TropicalWeight
Operator * implements semiring ⊗ (+).
Source§type Output = TropicalWeight
type Output = TropicalWeight
* operator.Source§impl MulAssign for TropicalWeight
impl MulAssign for TropicalWeight
Source§fn mul_assign(&mut self, other: TropicalWeight)
fn mul_assign(&mut self, other: TropicalWeight)
*= operation. Read moreimpl NonnegativeSemiring for TropicalWeight
TropicalWeight is non-negative when used for shortest-path problems.
Note: This is a semantic guarantee. The tropical semiring can represent negative costs, but when used with non-negative edge weights (the common case for shortest-path problems), it satisfies this property.
Source§impl NumericalWeight for TropicalWeight
impl NumericalWeight for TropicalWeight
Source§fn numerical_value(&self) -> f64
fn numerical_value(&self) -> f64
Source§impl Ord for TropicalWeight
impl Ord for TropicalWeight
Source§fn cmp(&self, other: &TropicalWeight) -> Ordering
fn cmp(&self, other: &TropicalWeight) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for TropicalWeight
impl PartialEq for TropicalWeight
Source§fn eq(&self, other: &TropicalWeight) -> bool
fn eq(&self, other: &TropicalWeight) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for TropicalWeight
impl PartialOrd for TropicalWeight
Source§impl QuantizableSemiring for TropicalWeight
TropicalWeight can be quantized for approximate comparison.
impl QuantizableSemiring for TropicalWeight
TropicalWeight can be quantized for approximate comparison.
Source§impl Semiring for TropicalWeight
impl Semiring for TropicalWeight
Source§fn zero() -> TropicalWeight
fn zero() -> TropicalWeight
Additive identity: ∞ (unreachable)
Source§fn one() -> TropicalWeight
fn one() -> TropicalWeight
Multiplicative identity: 0 (zero cost)
Source§fn plus(&self, other: &TropicalWeight) -> TropicalWeight
fn plus(&self, other: &TropicalWeight) -> TropicalWeight
Addition: min(a, b)
Source§fn times(&self, other: &TropicalWeight) -> TropicalWeight
fn times(&self, other: &TropicalWeight) -> TropicalWeight
Multiplication: a + b
Source§fn natural_less(&self, other: &TropicalWeight) -> Option<bool>
fn natural_less(&self, other: &TropicalWeight) -> Option<bool>
Natural ordering: smaller is better (shorter path).
Source§impl StarSemiring for TropicalWeight
impl StarSemiring for TropicalWeight
Source§fn star(&self) -> Option<TropicalWeight>
fn star(&self) -> Option<TropicalWeight>
Kleene closure for tropical semiring.
For tropical semiring:
- If weight > 0: star = 0 (taking zero copies is optimal)
- If weight = 0: star = 0 (any number of copies has cost 0)
- If weight < 0: series diverges to -∞ (no finite star)
Source§impl<D> StateSource<char, TropicalWeight> for LevenshteinStateSource<D>
impl<D> StateSource<char, TropicalWeight> for LevenshteinStateSource<D>
Source§fn compute_state(&self, state: StateId) -> LazyState<char, TropicalWeight>
fn compute_state(&self, state: StateId) -> LazyState<char, TropicalWeight>
Source§impl<V, D> StateSource<char, TropicalWeight> for UniversalLevenshteinStateSource<V, D>
impl<V, D> StateSource<char, TropicalWeight> for UniversalLevenshteinStateSource<V, D>
Source§fn compute_state(&self, state: StateId) -> LazyState<char, TropicalWeight>
fn compute_state(&self, state: StateId) -> LazyState<char, TropicalWeight>
Source§impl StateSource<char, TropicalWeight> for PhoneticNfaWfst
Available on crate feature phonetic-rules only.
impl StateSource<char, TropicalWeight> for PhoneticNfaWfst
phonetic-rules only.Source§fn compute_state(&self, _state: StateId) -> LazyState<char, TropicalWeight>
fn compute_state(&self, _state: StateId) -> LazyState<char, TropicalWeight>
Source§impl StateSource<char, TropicalWeight> for RewriteWfst
impl StateSource<char, TropicalWeight> for RewriteWfst
Source§fn compute_state(&self, state: StateId) -> LazyState<char, TropicalWeight>
fn compute_state(&self, state: StateId) -> LazyState<char, TropicalWeight>
Source§impl<D> StateSource<char, TropicalWeight> for PhoneticStateSource<D>
Available on crate feature phonetic-rules only.
impl<D> StateSource<char, TropicalWeight> for PhoneticStateSource<D>
phonetic-rules only.Source§fn compute_state(&self, state: StateId) -> LazyState<char, TropicalWeight>
fn compute_state(&self, state: StateId) -> LazyState<char, TropicalWeight>
Source§impl<D> StateSource<char, TropicalWeight> for GeneralizedWfst<D>
impl<D> StateSource<char, TropicalWeight> for GeneralizedWfst<D>
Source§fn compute_state(&self, _state: StateId) -> LazyState<char, TropicalWeight>
fn compute_state(&self, _state: StateId) -> LazyState<char, TropicalWeight>
Source§impl<'a, D> StateSource<char, TropicalWeight> for WallBreakerWfst<'a, D>where
D: Dictionary + SubstringDictionary + Clone + Send + Sync,
D::Node: BidirectionalDictionaryNode,
<D::Node as DictionaryNode>::Unit: Into<u32>,
impl<'a, D> StateSource<char, TropicalWeight> for WallBreakerWfst<'a, D>where
D: Dictionary + SubstringDictionary + Clone + Send + Sync,
D::Node: BidirectionalDictionaryNode,
<D::Node as DictionaryNode>::Unit: Into<u32>,
Source§fn compute_state(&self, _state: StateId) -> LazyState<char, TropicalWeight>
fn compute_state(&self, _state: StateId) -> LazyState<char, TropicalWeight>
Source§impl StochasticSemiring for TropicalWeight
TropicalWeight can be converted to probability for sampling.
impl StochasticSemiring for TropicalWeight
TropicalWeight can be converted to probability for sampling.
Uses exp(-cost) to convert costs to probability-like values. Lower costs (better paths) map to higher probabilities.
Source§fn to_probability(&self) -> f64
fn to_probability(&self) -> f64
impl StructuralPartialEq for TropicalWeight
Source§impl TotallyOrderedSemiring for TropicalWeight
TropicalWeight has a total order via OrderedFloat.
impl TotallyOrderedSemiring for TropicalWeight
TropicalWeight has a total order via OrderedFloat.
All real numbers (including infinity) are totally ordered.
Source§impl TryFrom<SignedTropicalWeight> for TropicalWeight
impl TryFrom<SignedTropicalWeight> for TropicalWeight
Source§fn try_from(
w: SignedTropicalWeight,
) -> Result<TropicalWeight, <TropicalWeight as TryFrom<SignedTropicalWeight>>::Error>
fn try_from( w: SignedTropicalWeight, ) -> Result<TropicalWeight, <TropicalWeight as TryFrom<SignedTropicalWeight>>::Error>
Convert to standard tropical weight.
Fails if the weight is negative.
Source§impl WeaklyLeftDivisibleSemiring for TropicalWeight
TropicalWeight is weakly left-divisible.
impl WeaklyLeftDivisibleSemiring for TropicalWeight
TropicalWeight is weakly left-divisible.
For tropical semiring where ⊕ = min and ⊗ = +:
- Given
aanddivisor = min(a, b), we needcsuch thatc + divisor = a - This is
c = a - divisor
Source§fn left_divide(&self, divisor: &TropicalWeight) -> Option<TropicalWeight>
fn left_divide(&self, divisor: &TropicalWeight) -> Option<TropicalWeight>
Source§impl<V, D> Wfst<char, TropicalWeight> for UniversalLevenshteinWfst<V, D>
impl<V, D> Wfst<char, TropicalWeight> for UniversalLevenshteinWfst<V, D>
Source§fn final_weight(&self, state: StateId) -> TropicalWeight
fn final_weight(&self, state: StateId) -> TropicalWeight
Source§fn transitions(
&self,
state: StateId,
) -> &[WeightedTransition<char, TropicalWeight>]
fn transitions( &self, state: StateId, ) -> &[WeightedTransition<char, TropicalWeight>]
Source§fn num_states(&self) -> usize
fn num_states(&self) -> usize
Source§fn is_valid_state(&self, state: StateId) -> bool
fn is_valid_state(&self, state: StateId) -> bool
Source§fn num_transitions(&self, state: u32) -> usize
fn num_transitions(&self, state: u32) -> usize
Source§fn total_transitions(&self) -> usize
fn total_transitions(&self) -> usize
Source§impl<D> Wfst<char, TropicalWeight> for LevenshteinWfst<D>
impl<D> Wfst<char, TropicalWeight> for LevenshteinWfst<D>
Source§fn is_empty(&self) -> bool
fn is_empty(&self) -> bool
For lazy WFSTs, is_empty() returns false if there’s a valid start state.
Source§fn is_valid_state(&self, state: StateId) -> bool
fn is_valid_state(&self, state: StateId) -> bool
For lazy WFSTs, any encoded state is potentially valid. The actual validity is determined when the state is expanded.
Source§fn final_weight(&self, state: StateId) -> TropicalWeight
fn final_weight(&self, state: StateId) -> TropicalWeight
Source§fn transitions(
&self,
state: StateId,
) -> &[WeightedTransition<char, TropicalWeight>]
fn transitions( &self, state: StateId, ) -> &[WeightedTransition<char, TropicalWeight>]
Source§fn num_states(&self) -> usize
fn num_states(&self) -> usize
Source§fn num_transitions(&self, state: u32) -> usize
fn num_transitions(&self, state: u32) -> usize
Source§fn total_transitions(&self) -> usize
fn total_transitions(&self) -> usize
Source§impl Wfst<char, TropicalWeight> for PhoneticNfaWfst
Available on crate feature phonetic-rules only.
impl Wfst<char, TropicalWeight> for PhoneticNfaWfst
phonetic-rules only.Source§fn final_weight(&self, state: StateId) -> TropicalWeight
fn final_weight(&self, state: StateId) -> TropicalWeight
Source§fn transitions(
&self,
state: StateId,
) -> &[WeightedTransition<char, TropicalWeight>]
fn transitions( &self, state: StateId, ) -> &[WeightedTransition<char, TropicalWeight>]
Source§fn num_states(&self) -> usize
fn num_states(&self) -> usize
Source§fn is_valid_state(&self, state: StateId) -> bool
fn is_valid_state(&self, state: StateId) -> bool
Source§fn num_transitions(&self, state: u32) -> usize
fn num_transitions(&self, state: u32) -> usize
Source§fn total_transitions(&self) -> usize
fn total_transitions(&self) -> usize
Source§impl Wfst<char, TropicalWeight> for RewriteWfst
impl Wfst<char, TropicalWeight> for RewriteWfst
Source§fn final_weight(&self, state: StateId) -> TropicalWeight
fn final_weight(&self, state: StateId) -> TropicalWeight
Source§fn transitions(
&self,
state: StateId,
) -> &[WeightedTransition<char, TropicalWeight>]
fn transitions( &self, state: StateId, ) -> &[WeightedTransition<char, TropicalWeight>]
Source§fn num_states(&self) -> usize
fn num_states(&self) -> usize
Source§fn is_valid_state(&self, state: StateId) -> bool
fn is_valid_state(&self, state: StateId) -> bool
Source§fn num_transitions(&self, state: u32) -> usize
fn num_transitions(&self, state: u32) -> usize
Source§fn total_transitions(&self) -> usize
fn total_transitions(&self) -> usize
Source§impl<D> Wfst<char, TropicalWeight> for PhoneticWfst<D>
Available on crate feature phonetic-rules only.
impl<D> Wfst<char, TropicalWeight> for PhoneticWfst<D>
phonetic-rules only.Source§fn final_weight(&self, state: StateId) -> TropicalWeight
fn final_weight(&self, state: StateId) -> TropicalWeight
Source§fn transitions(
&self,
state: StateId,
) -> &[WeightedTransition<char, TropicalWeight>]
fn transitions( &self, state: StateId, ) -> &[WeightedTransition<char, TropicalWeight>]
Source§fn num_states(&self) -> usize
fn num_states(&self) -> usize
Source§fn is_valid_state(&self, state: StateId) -> bool
fn is_valid_state(&self, state: StateId) -> bool
Source§fn num_transitions(&self, state: u32) -> usize
fn num_transitions(&self, state: u32) -> usize
Source§fn total_transitions(&self) -> usize
fn total_transitions(&self) -> usize
Source§impl<D> Wfst<char, TropicalWeight> for GeneralizedWfst<D>
impl<D> Wfst<char, TropicalWeight> for GeneralizedWfst<D>
Source§fn final_weight(&self, state: StateId) -> TropicalWeight
fn final_weight(&self, state: StateId) -> TropicalWeight
Source§fn transitions(
&self,
state: StateId,
) -> &[WeightedTransition<char, TropicalWeight>]
fn transitions( &self, state: StateId, ) -> &[WeightedTransition<char, TropicalWeight>]
Source§fn num_states(&self) -> usize
fn num_states(&self) -> usize
Source§fn is_valid_state(&self, state: StateId) -> bool
fn is_valid_state(&self, state: StateId) -> bool
Source§fn num_transitions(&self, state: u32) -> usize
fn num_transitions(&self, state: u32) -> usize
Source§fn total_transitions(&self) -> usize
fn total_transitions(&self) -> usize
Source§impl<'a, D> Wfst<char, TropicalWeight> for WallBreakerWfst<'a, D>where
D: Dictionary + SubstringDictionary + Clone + Send + Sync,
D::Node: BidirectionalDictionaryNode,
<D::Node as DictionaryNode>::Unit: Into<u32>,
impl<'a, D> Wfst<char, TropicalWeight> for WallBreakerWfst<'a, D>where
D: Dictionary + SubstringDictionary + Clone + Send + Sync,
D::Node: BidirectionalDictionaryNode,
<D::Node as DictionaryNode>::Unit: Into<u32>,
Source§fn final_weight(&self, state: StateId) -> TropicalWeight
fn final_weight(&self, state: StateId) -> TropicalWeight
Source§fn transitions(
&self,
state: StateId,
) -> &[WeightedTransition<char, TropicalWeight>]
fn transitions( &self, state: StateId, ) -> &[WeightedTransition<char, TropicalWeight>]
Source§fn num_states(&self) -> usize
fn num_states(&self) -> usize
Source§fn is_valid_state(&self, state: StateId) -> bool
fn is_valid_state(&self, state: StateId) -> bool
Source§fn num_transitions(&self, state: u32) -> usize
fn num_transitions(&self, state: u32) -> usize
Source§fn total_transitions(&self) -> usize
fn total_transitions(&self) -> usize
impl ZeroSumFreeSemiring for TropicalWeight
TropicalWeight is zero-sum-free: min(a, b) = ∞ only if both a = ∞ and b = ∞