pub struct FeatureStructureAlgebra { /* private fields */ }Expand description
Feature-structure algebra compatible with Alto’s general operations.
Literal operation symbols parse to FeatureStructure values. Malformed
literals and failed operations make evaluation undefined. The remap_*
extension keeps multi-attribute selection linear, so it can be used in
inverse homomorphisms without repeating a source variable.
Implementations§
Source§impl FeatureStructureAlgebra
impl FeatureStructureAlgebra
Sourcepub fn with_signature(signature: Signature) -> Self
pub fn with_signature(signature: Signature) -> Self
Build an algebra by classifying every operation in signature.
Sourcepub fn filter(&self) -> FeatureStructureFilter<'_>
pub fn filter(&self) -> FeatureStructureFilter<'_>
Return an automaton accepting successfully evaluated feature terms.
Trait Implementations§
Source§impl Algebra for FeatureStructureAlgebra
impl Algebra for FeatureStructureAlgebra
Source§type InternalValue = FeatureStructure
type InternalValue = FeatureStructure
Efficient internal value domain used by
evaluate and decomposition.Source§type Value = FeatureStructure
type Value = FeatureStructure
Standalone public value produced for output by
evaluate_term.Source§type ParseError = FeatureStructureParseError
type ParseError = FeatureStructureParseError
Error returned when parsing a textual object representation.
Source§fn evaluate(
&self,
symbol: Symbol,
children: &[Self::InternalValue],
) -> Option<Self::InternalValue>
fn evaluate( &self, symbol: Symbol, children: &[Self::InternalValue], ) -> Option<Self::InternalValue>
Evaluate an operation over child internal values. Read more
Source§fn parse_object(
&mut self,
input: &str,
) -> Result<Self::InternalValue, Self::ParseError>
fn parse_object( &mut self, input: &str, ) -> Result<Self::InternalValue, Self::ParseError>
Parse a textual representation into an internal value.
Source§fn to_external(&self, value: &Self::InternalValue) -> Self::Value
fn to_external(&self, value: &Self::InternalValue) -> Self::Value
Map an internal value to its standalone public form.
Source§fn visualize(&self, value: &Self::Value) -> VisualRepresentation
fn visualize(&self, value: &Self::Value) -> VisualRepresentation
Convert a public value into this algebra’s preferred GUI-neutral representation.
Source§fn evaluate_term_internal(
&self,
arena: &TreeArena<Symbol>,
root: Tree,
) -> Option<Self::InternalValue>
fn evaluate_term_internal( &self, arena: &TreeArena<Symbol>, root: Tree, ) -> Option<Self::InternalValue>
Source§fn evaluate_term(
&self,
arena: &TreeArena<Symbol>,
root: Tree,
) -> Option<Self::Value>
fn evaluate_term( &self, arena: &TreeArena<Symbol>, root: Tree, ) -> Option<Self::Value>
Evaluate a term tree to its public value (bottom-up
evaluate, then
to_external).Source§fn is_valid_value(&self, _value: &Self::InternalValue) -> bool
fn is_valid_value(&self, _value: &Self::InternalValue) -> bool
Return whether
value is a valid internal value.Source§fn decompose_default(
&self,
value: Self::InternalValue,
) -> EvaluatingDecompositionAutomaton<'_, Self>where
Self: Sized,
fn decompose_default(
&self,
value: Self::InternalValue,
) -> EvaluatingDecompositionAutomaton<'_, Self>where
Self: Sized,
Build the default evaluating decomposition automaton for
value.Source§impl Clone for FeatureStructureAlgebra
impl Clone for FeatureStructureAlgebra
Source§fn clone(&self) -> FeatureStructureAlgebra
fn clone(&self) -> FeatureStructureAlgebra
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FeatureStructureAlgebra
impl RefUnwindSafe for FeatureStructureAlgebra
impl Send for FeatureStructureAlgebra
impl Sync for FeatureStructureAlgebra
impl Unpin for FeatureStructureAlgebra
impl UnsafeUnpin for FeatureStructureAlgebra
impl UnwindSafe for FeatureStructureAlgebra
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more