pub struct InvHom<'h, A> { /* private fields */ }Expand description
Nondeleting inverse-homomorphism automaton.
InvHom<A> accepts a source tree t exactly when the wrapped automaton
A accepts the homomorphic image h(t). The state type is unchanged: a
source subtree receives the state that A assigns to its image.
The homomorphism is validated when it is built, so every source child occurs exactly once in each image term. This gives the condensed implementation a well-defined way to recover source child states from target-side rules.
Implementations§
Source§impl<'h, A> InvHom<'h, A>
impl<'h, A> InvHom<'h, A>
Sourcepub fn new(inner: A, hom: &'h Homomorphism) -> Self
pub fn new(inner: A, hom: &'h Homomorphism) -> Self
Wrap inner with the given homomorphism.
Sourcepub fn homomorphism(&self) -> &Homomorphism
pub fn homomorphism(&self) -> &Homomorphism
Return the homomorphism used to map source symbols to target terms.
Trait Implementations§
Source§impl<A: BottomUpTa> BottomUpTa for InvHom<'_, A>
impl<A: BottomUpTa> BottomUpTa for InvHom<'_, A>
Source§impl<A> CondensedTa for InvHom<'_, A>where
A: CondensedTa + StateUniverse,
impl<A> CondensedTa for InvHom<'_, A>where
A: CondensedTa + StateUniverse,
Source§fn condensed_rules(
&self,
out: &mut dyn FnMut(&[A::State], &SymbolSet, A::State),
)
fn condensed_rules( &self, out: &mut dyn FnMut(&[A::State], &SymbolSet, A::State), )
(children, result) pair, reporting the set of
symbols that have that shape. Read moreSource§impl<A> CondensedTopDownTa for InvHom<'_, A>where
A: TopDownTa,
impl<A> CondensedTopDownTa for InvHom<'_, A>where
A: TopDownTa,
Source§impl<A: DetBottomUpTa> DetBottomUpTa for InvHom<'_, A>
impl<A: DetBottomUpTa> DetBottomUpTa for InvHom<'_, A>
Source§fn det_group(&self, f_src: Symbol) -> u32
fn det_group(&self, f_src: Symbol) -> u32
Source symbols sharing an image term yield identical step_det results
for any given children, so the structurally-deduplicated term id groups
them: callers can compute one transition per group and reuse it for every
symbol in the set. Unmapped symbols (step_det is always None) map to a
sentinel group.
Source§impl IntersectionHeuristic<InvHom<'_, StringDecompositionAutomaton>> for SentenceSxHeuristic<'_>
impl IntersectionHeuristic<InvHom<'_, StringDecompositionAutomaton>> for SentenceSxHeuristic<'_>
Source§fn outside_estimate(&self, left: StateId, span: &Span) -> f64
fn outside_estimate(&self, left: StateId, span: &Span) -> f64
(0, 1] on the best
outside weight of any completion around product state (left, right).Source§fn admits(&self, _left: StateId, _right: &R::State) -> bool
fn admits(&self, _left: StateId, _right: &R::State) -> bool
false iff (left, right) provably has zero outside weight (it can
appear in no valid completion), so the A* loop may skip building the edge
entirely rather than merely deprioritizing it. Read moreSource§fn estimate_if_admitted(&self, left: StateId, right: &R::State) -> Option<f64>
fn estimate_if_admitted(&self, left: StateId, right: &R::State) -> Option<f64>
None
when it is provably unable to occur in an accepting derivation. Read moreSource§fn memoize_admission(&self) -> bool
fn memoize_admission(&self) -> bool
Source§impl IntersectionHeuristic<InvHom<'_, StringDecompositionAutomaton>> for ObligatoryLeafHeuristic<'_>
impl IntersectionHeuristic<InvHom<'_, StringDecompositionAutomaton>> for ObligatoryLeafHeuristic<'_>
Source§fn outside_estimate(&self, left: StateId, span: &Span) -> f64
fn outside_estimate(&self, left: StateId, span: &Span) -> f64
(0, 1] on the best
outside weight of any completion around product state (left, right).Source§fn admits(&self, left: StateId, span: &Span) -> bool
fn admits(&self, left: StateId, span: &Span) -> bool
false iff (left, right) provably has zero outside weight (it can
appear in no valid completion), so the A* loop may skip building the edge
entirely rather than merely deprioritizing it. Read moreSource§fn estimate_if_admitted(&self, left: StateId, span: &Span) -> Option<f64>
fn estimate_if_admitted(&self, left: StateId, span: &Span) -> Option<f64>
None
when it is provably unable to occur in an accepting derivation. Read more