Struct ai_kit::rule::Rule
[−]
[src]
pub struct Rule<T: ConstraintValue, U: Unify<T>> { pub constraints: Vec<Constraint>, pub lhs: Vec<U>, pub rhs: U, pub _marker: PhantomData<T>, }
Fields
constraints: Vec<Constraint>
lhs: Vec<U>
rhs: U
_marker: PhantomData<T>
Methods
impl<T, U> Rule<T, U> where
T: ConstraintValue,
U: Unify<T>,
[src]
T: ConstraintValue,
U: Unify<T>,
fn unify(&self, facts: &Vec<&U>, bindings: &Bindings<T>) -> Option<Bindings<T>>
fn apply_bindings(&self, bindings: &Bindings<T>) -> Option<U>
Trait Implementations
impl<T: Clone + ConstraintValue, U: Clone + Unify<T>> Clone for Rule<T, U>
[src]
fn clone(&self) -> Rule<T, U>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<T: Debug + ConstraintValue, U: Debug + Unify<T>> Debug for Rule<T, U>
[src]
impl<T: PartialEq + ConstraintValue, U: PartialEq + Unify<T>> PartialEq for Rule<T, U>
[src]
fn eq(&self, __arg_0: &Rule<T, U>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Rule<T, U>) -> bool
This method tests for !=
.
impl<T, U> Operation<T, U> for Rule<T, U> where
T: ConstraintValue,
U: Unify<T>,
[src]
T: ConstraintValue,
U: Unify<T>,
fn input_patterns(&self) -> Vec<U>
Return a vector of input patterns that must be unified with in order to apply this Operation.
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
fn constraints<'a>(&'a self) -> Vec<&'a Constraint>
fn snowflake(&self, suffix: String) -> Self
Construct a new version of this rule but with all variables updated to be unique for this invocation
impl<T, U> Display for Rule<T, U> where
T: ConstraintValue,
U: Unify<T>,
[src]
T: ConstraintValue,
U: Unify<T>,
impl<T, U> Eq for Rule<T, U> where
T: ConstraintValue,
U: Unify<T>,
[src]
T: ConstraintValue,
U: Unify<T>,