pub struct TermRewriteSystem {
pub rules: Vec<RewriteRule>,
pub signature: Signature,
}Expand description
A term rewriting system: a collection of rewrite rules.
Fields§
§rules: Vec<RewriteRule>§signature: SignatureImplementations§
Source§impl TermRewriteSystem
impl TermRewriteSystem
Sourcepub fn add_rule(&mut self, rule: RewriteRule)
pub fn add_rule(&mut self, rule: RewriteRule)
Add a rewrite rule.
Sourcepub fn rewrite_step(&self, t: &Term) -> Option<Term>
pub fn rewrite_step(&self, t: &Term) -> Option<Term>
Perform one outermost-innermost rewrite step on t.
Returns Some(result) if any rule applies; None if already normal.
Sourcepub fn normalize(&self, t: &Term, max_steps: usize) -> Term
pub fn normalize(&self, t: &Term, max_steps: usize) -> Term
Reduce t to normal form (up to a step limit to avoid infinite loops).
Sourcepub fn find_critical_pairs(&self) -> Vec<(Term, Term)>
pub fn find_critical_pairs(&self) -> Vec<(Term, Term)>
Check for local confluence by testing critical pairs (simplified). Returns a list of (t1, t2) pairs where t1 and t2 are the two reducts of a critical overlap between rules i and j.
Auto Trait Implementations§
impl Freeze for TermRewriteSystem
impl RefUnwindSafe for TermRewriteSystem
impl Send for TermRewriteSystem
impl Sync for TermRewriteSystem
impl Unpin for TermRewriteSystem
impl UnsafeUnpin for TermRewriteSystem
impl UnwindSafe for TermRewriteSystem
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