Struct term_rewriting::Rule[][src]

pub struct Rule {
    pub lhs: Term,
    pub rhs: Vec<Term>,
}

A rewrite rule equating a left-hand-side Term with one or more right-hand-side Terms.

Fields

Methods

impl Rule
[src]

A serialized representation of the Rule.

A human-readable serialization of the Rule.

Return the total number of subterms across all terms in the rule.

Return the number of RHSs in the rule

Is the rule empty?

Give the lone RHS, if it exists

Return a list of the clauses in the Rule.

Construct a rewrite rule from a left-hand-side (LHS) Term with one or more right-hand-side (RHS) Terms. Returns None if the rule is not valid.

Valid rules meet two conditions:

  1. lhs is an Application. This prevents a single rule from matching all possible terms
  2. A Term in rhs can only use a Variable if it appears in lhs. This prevents rewrites from inventing arbitrary terms.

Add a clause to the rule from a term.

Add clauses to the rule from another rule.

Discard clauses from the rule.

Check whether the rule contains certain clauses.

Get all the Variables in the Rule.

Get all the Operators in the Rule.

Get all the subterms and places in a Rule.

Get a specific subterm in a Rule

Replace one subterm with another in a Rule

Match one rule against another.

Unify two rules.

Compute the alpha equivalence between two rules.

Substitute through a rule

Trait Implementations

impl Debug for Rule
[src]

Formats the value using the given formatter. Read more

impl Clone for Rule
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for Rule
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for Rule
[src]

impl Hash for Rule
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

Auto Trait Implementations

impl Send for Rule

impl Sync for Rule