pub struct RewriteRule {
pub lhs: Term,
pub rhs: Term,
pub name: String,
}Expand description
A rewrite rule: lhs → rhs.
Fields§
§lhs: Term§rhs: Term§name: StringImplementations§
Source§impl RewriteRule
impl RewriteRule
Sourcepub fn match_term<'a>(
pattern: &'a Term,
target: &'a Term,
subst: &mut Vec<(usize, Term)>,
) -> bool
pub fn match_term<'a>( pattern: &'a Term, target: &'a Term, subst: &mut Vec<(usize, Term)>, ) -> bool
Attempt to match pattern against target, binding variables.
Returns Some(substitution) if match succeeds; each entry is (var_idx, term).
Sourcepub fn apply_subst(term: &Term, subst: &[(usize, Term)]) -> Term
pub fn apply_subst(term: &Term, subst: &[(usize, Term)]) -> Term
Apply the substitution to a term.
Sourcepub fn try_apply_top(&self, t: &Term) -> Option<Term>
pub fn try_apply_top(&self, t: &Term) -> Option<Term>
Try to apply this rule at the top level of t.
Returns Some(rewritten) if the rule fires; None otherwise.
Trait Implementations§
Source§impl Clone for RewriteRule
impl Clone for RewriteRule
Source§fn clone(&self) -> RewriteRule
fn clone(&self) -> RewriteRule
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RewriteRule
impl RefUnwindSafe for RewriteRule
impl Send for RewriteRule
impl Sync for RewriteRule
impl Unpin for RewriteRule
impl UnsafeUnpin for RewriteRule
impl UnwindSafe for RewriteRule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more