Trait ai_kit::core::Unify
[−]
[src]
pub trait Unify<T: BindingsValue>: Clone + Debug + Display + Eq + Serialize + Deserialize + PartialEq { fn unify(&self, _: &Self, _: &Bindings<T>) -> Option<Bindings<T>>; fn apply_bindings(&self, _: &Bindings<T>) -> Option<Self>; fn variables(&self) -> Vec<String>; fn rename_variables(&self, _: &HashMap<String, String>) -> Self; fn nil() -> Self; }
A type must implement the Unify trait for it to be unifiable - this only requirement for a data structure that the algorithms in this library operate on.
Required Methods
fn unify(&self, _: &Self, _: &Bindings<T>) -> Option<Bindings<T>>
Check if this structure can be unified with another of the same type.
fn apply_bindings(&self, _: &Bindings<T>) -> Option<Self>
Given some bindings, construct a new instance with any variables replaced by their values
fn variables(&self) -> Vec<String>
Return all variables in this tructure
fn rename_variables(&self, _: &HashMap<String, String>) -> Self
Rename any variables in this structure with another variable name
fn nil() -> Self
Return a 'nil' sentinel value unique to this type of structure
Implementors
impl Unify<Datum> for Datum
impl<B, U> Unify<B> for Negatable<B, U> where
B: BindingsValue,
U: Unify<B>,