pub struct RewriteSystem { /* private fields */ }Expand description
A collection of rewrite rules that can be applied to expressions.
Implementations§
Source§impl RewriteSystem
impl RewriteSystem
Sourcepub fn add_rule(self, rule: RewriteRule) -> Self
pub fn add_rule(self, rule: RewriteRule) -> Self
Add a rule to the system.
Sourcepub fn with_logic_equivalences() -> Self
pub fn with_logic_equivalences() -> Self
Create a system with common logical equivalences.
Sourcepub fn apply_once(&self, expr: &TLExpr) -> Option<TLExpr>
pub fn apply_once(&self, expr: &TLExpr) -> Option<TLExpr>
Try to apply the first matching rule to an expression.
Sourcepub fn apply_recursive(&self, expr: &TLExpr) -> TLExpr
pub fn apply_recursive(&self, expr: &TLExpr) -> TLExpr
Apply rules recursively to an expression and all its subexpressions.
Sourcepub fn apply_until_fixpoint(&self, expr: &TLExpr) -> TLExpr
pub fn apply_until_fixpoint(&self, expr: &TLExpr) -> TLExpr
Apply rules until no more changes occur (fixed point).
Trait Implementations§
Source§impl Clone for RewriteSystem
impl Clone for RewriteSystem
Source§fn clone(&self) -> RewriteSystem
fn clone(&self) -> RewriteSystem
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 moreSource§impl Debug for RewriteSystem
impl Debug for RewriteSystem
Source§impl Default for RewriteSystem
impl Default for RewriteSystem
Source§fn default() -> RewriteSystem
fn default() -> RewriteSystem
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RewriteSystem
impl RefUnwindSafe for RewriteSystem
impl Send for RewriteSystem
impl Sync for RewriteSystem
impl Unpin for RewriteSystem
impl UnwindSafe for RewriteSystem
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