Enum term_rewriting::Term
[−]
[src]
pub enum Term { Variable(Variable), Application { op: Operator, args: Vec<Term>, }, }
Variants
Variable(Variable)
A concrete but unspecified Term
(e.g. x
, y
)
Application
An Operator
applied to zero or more Term
s (e.g. (f(x, y)
, g()
)
Fields of Application
op: Operator | |
args: Vec<Term> |
Methods
impl Term
[src]
pub fn variables(&self) -> Vec<Variable>
[src]
Every Variable
used in the term.
pub fn operators(&self) -> Vec<Operator>
[src]
Every Operator
used in the term.
pub fn subterms(&self) -> Vec<(&Term, Place)>
[src]
Every subterm and its place, starting with the original term itself.
pub fn at(&self, place: &Place) -> Option<&Term>
[src]
Get the subterm at the given Place
, or None
if the place does not exist in the term.
pub fn replace(&self, place: &Place, subterm: Term) -> Option<Term>
[src]
Create a copy of self
where the term at the given Place
has been replaced with
subterm
.
pub fn substitute(&self, sub: &HashMap<Variable, Term>) -> Term
[src]
pub fn alpha_equivalent(t1: &Term, t2: &Term) -> bool
[src]
Whether two terms are alpha equivalent.
pub fn shape_equivalent(t1: &Term, t2: &Term) -> bool
[src]
pub fn pmatch(cs: Vec<(Term, Term)>) -> Option<HashMap<Variable, Term>>
[src]
Given a vector of contraints, return a substitution which satisfies the constrants.
If the constraints are not satisfiable, None
is retuned. Constraints are in the form of
patterns, where substitutions are only considered for variables in the first term of each
pair.
pub fn unify(cs: Vec<(Term, Term)>) -> Option<HashMap<Variable, Term>>
[src]
Given a vector of contraints, return a substitution which satisfies the constrants.
If the constraints are not satisfiable, None
is retuned.
Trait Implementations
impl From<Term> for Context
[src]
impl Debug for Term
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl PartialEq for Term
[src]
fn eq(&self, __arg_0: &Term) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Term) -> bool
[src]
This method tests for !=
.
impl Eq for Term
[src]
impl Hash for Term
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more