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§
Sourcefn occurs<'s>(&self, x: &Var, s: &Substitution<'s>) -> bool
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.
Sourcefn unify<'s>(&self, v: &Value, s: Substitution<'s>) -> Option<Substitution<'s>>
fn unify<'s>(&self, v: &Value, s: Substitution<'s>) -> Option<Substitution<'s>>
Attempt to unify self with Value v under substitution s.
Sourcefn walk_star(self: Arc<Self>, s: &Substitution<'_>) -> Value
fn walk_star(self: Arc<Self>, s: &Substitution<'_>) -> Value
Recursively replace any variables contained in self with
their substituted values.
Sourcefn reify_s<'s>(&self, s: Substitution<'s>) -> Substitution<'s>
fn reify_s<'s>(&self, s: Substitution<'s>) -> Substitution<'s>
Substitute all variables that remain fresh in self with reified variables.