pub trait Factoid: Debug + Clone + PartialEq + Default + Hash {
type Concrete: Debug;
// Required methods
fn concretize(&self) -> Option<Self::Concrete>;
fn unify(&self, other: &Self) -> TractResult<Self>;
// Provided methods
fn is_concrete(&self) -> bool { ... }
fn unify_with(&mut self, other: &Self) -> TractResult<bool> { ... }
fn unify_with_mut(&mut self, other: &mut Self) -> TractResult<bool> { ... }
fn unify_all(facts: &mut [&mut Self]) -> TractResult<bool> { ... }
}
Expand description
Partial information about any value.
Required Associated Types§
Required Methods§
sourcefn concretize(&self) -> Option<Self::Concrete>
fn concretize(&self) -> Option<Self::Concrete>
Tries to transform the fact into a concrete value.
sourcefn unify(&self, other: &Self) -> TractResult<Self>
fn unify(&self, other: &Self) -> TractResult<Self>
Tries to unify the fact with another fact of the same type.
Provided Methods§
sourcefn is_concrete(&self) -> bool
fn is_concrete(&self) -> bool
Returns whether the value is fully determined.
sourcefn unify_with(&mut self, other: &Self) -> TractResult<bool>
fn unify_with(&mut self, other: &Self) -> TractResult<bool>
Tries to unify the fact with another fact of the same type and update self.
Returns true if it actually changed something.
sourcefn unify_with_mut(&mut self, other: &mut Self) -> TractResult<bool>
fn unify_with_mut(&mut self, other: &mut Self) -> TractResult<bool>
Tries to unify the fact with another fact of the same type and update both of them.
Returns true if it actually changed something.
sourcefn unify_all(facts: &mut [&mut Self]) -> TractResult<bool>
fn unify_all(facts: &mut [&mut Self]) -> TractResult<bool>
Tries to unify all facts in the list.
Returns true if it actually changed something.
Object Safety§
This trait is not object safe.