pub struct Trs {
pub rules: Vec<Rule>,
}Expand description
A Term Rewriting System: a list of rewrite rules.
Fields§
§rules: Vec<Rule>Implementations§
Source§impl Trs
impl Trs
Sourcepub fn is_left_linear(&self) -> bool
pub fn is_left_linear(&self) -> bool
Returns true if all rules are left-linear.
Sourcepub fn reduce_innermost(&self, term: &Term) -> Option<Term>
pub fn reduce_innermost(&self, term: &Term) -> Option<Term>
One-step innermost reduction: reduces the leftmost-innermost redex.
Sourcepub fn reduce_outermost(&self, term: &Term) -> Option<Term>
pub fn reduce_outermost(&self, term: &Term) -> Option<Term>
One-step outermost reduction: reduces the leftmost-outermost redex.
Sourcepub fn normalize_innermost(&self, term: &Term, limit: usize) -> Term
pub fn normalize_innermost(&self, term: &Term, limit: usize) -> Term
Fully reduces a term to normal form under innermost strategy (up to limit steps).
Sourcepub fn normalize_outermost(&self, term: &Term, limit: usize) -> Term
pub fn normalize_outermost(&self, term: &Term, limit: usize) -> Term
Fully reduces a term to normal form under outermost strategy (up to limit steps).
Sourcepub fn is_normal_form(&self, t: &Term) -> bool
pub fn is_normal_form(&self, t: &Term) -> bool
Checks whether t is a normal form (no rule applies at any position).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Trs
impl RefUnwindSafe for Trs
impl Send for Trs
impl Sync for Trs
impl Unpin for Trs
impl UnsafeUnpin for Trs
impl UnwindSafe for Trs
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