Skip to main content

Structure

Trait Structure 

Source
pub trait Structure: Any + Debug {
    // Required methods
    fn occurs<'s>(&self, x: &Var, s: &Substitution<'s>) -> bool;
    fn unify<'s>(
        &self,
        v: &Value,
        s: Substitution<'s>,
    ) -> Option<Substitution<'s>>;
    fn walk_star(self: Arc<Self>, s: &Substitution<'_>) -> Value;
    fn reify_s<'s>(&self, s: Substitution<'s>) -> Substitution<'s>;
    fn as_any(&self) -> &dyn Any;
    fn eqv(&self, other: &Value) -> bool;
}
Expand description

Trait implemented by all logic-compatible types

Required Methods§

Source

fn occurs<'s>(&self, x: &Var, s: &Substitution<'s>) -> bool

Returns true if self contains a variable that is equivalent to x when considering substitution s.

Source

fn unify<'s>(&self, v: &Value, s: Substitution<'s>) -> Option<Substitution<'s>>

Attempt to unify self with Value v under substitution s.

Source

fn walk_star(self: Arc<Self>, s: &Substitution<'_>) -> Value

Recursively replace any variables contained in self with their substituted values.

Source

fn reify_s<'s>(&self, s: Substitution<'s>) -> Substitution<'s>

Substitute all variables that remain fresh in self with reified variables.

Source

fn as_any(&self) -> &dyn Any

Cast to Any reference.

Source

fn eqv(&self, other: &Value) -> bool

Return true if self is equivalent to other.

Implementations on Foreign Types§

Source§

impl Structure for Option<Value>

Source§

fn occurs<'s>(&self, x: &Var, s: &Substitution<'s>) -> bool

Source§

fn unify<'s>(&self, v: &Value, s: Substitution<'s>) -> Option<Substitution<'s>>

Source§

fn walk_star(self: Arc<Self>, s: &Substitution<'_>) -> Value

Source§

fn reify_s<'s>(&self, s: Substitution<'s>) -> Substitution<'s>

Source§

fn as_any(&self) -> &dyn Any

Source§

fn eqv(&self, other: &Value) -> bool

Source§

impl<T: 'static + Debug + Eq + Hash> Structure for HashMap<T, Value>

Source§

fn occurs<'s>(&self, _x: &Var, _s: &Substitution<'s>) -> bool

Source§

fn unify<'s>(&self, v: &Value, s: Substitution<'s>) -> Option<Substitution<'s>>

Source§

fn walk_star(self: Arc<Self>, _s: &Substitution<'_>) -> Value

Source§

fn reify_s<'s>(&self, _s: Substitution<'s>) -> Substitution<'s>

Source§

fn as_any(&self) -> &dyn Any

Source§

fn eqv(&self, other: &Value) -> bool

Implementors§