Trait ai_kit::core::Operation
[−]
[src]
pub trait Operation<T: BindingsValue, U: Unify<T>>: Clone + Debug + Display + Eq + PartialEq + Deserialize + Serialize { fn constraints<'a>(&'a self) -> Vec<&'a Constraint>; fn snowflake(&self, _: String) -> Self; fn apply_match(&self, _bindings: &Bindings<T>) -> Option<Vec<U>>; fn r_apply_match(&self, _fact: &U) -> Option<(Vec<U>, Bindings<T>)>; fn input_patterns(&self) -> Vec<U> { ... } }
A type that implements Operation constructs new Unifys from existing Unifys that match it's input patterns.
Required Methods
fn constraints<'a>(&'a self) -> Vec<&'a Constraint>
fn snowflake(&self, _: String) -> Self
Creates a new instance of this Operation where all variables are unique
fn apply_match(&self, _bindings: &Bindings<T>) -> Option<Vec<U>>
Given some bindings, construct a set of output patterns
fn r_apply_match(&self, _fact: &U) -> Option<(Vec<U>, Bindings<T>)>
Given some bindings, construct a set of input patterns that would match
Provided Methods
fn input_patterns(&self) -> Vec<U>
Return a vector of input patterns that must be unified with in order to apply this Operation.
Implementors
impl<T, U> Operation<T, U> for Rule<T, U> where
T: ConstraintValue,
U: Unify<T>,