pub trait RewriteScheduler<L, N> where
    L: Language,
    N: Analysis<L>, 
{ fn can_stop(&mut self, iteration: usize) -> bool { ... }
fn search_rewrite<'a>(
        &mut self,
        iteration: usize,
        egraph: &EGraph<L, N>,
        rewrite: &'a Rewrite<L, N>
    ) -> Vec<SearchMatches<'a, L>> { ... }
fn apply_rewrite(
        &mut self,
        iteration: usize,
        egraph: &mut EGraph<L, N>,
        rewrite: &Rewrite<L, N>,
        matches: Vec<SearchMatches<'_, L>>
    ) -> usize { ... } }
Expand description

A way to customize how a Runner runs Rewrites.

This gives you a way to prevent certain Rewrites from exploding the EGraph and dominating how much time is spent while running the Runner.

Provided methods

Whether or not the Runner is allowed to say it has saturated.

This is only called when the runner is otherwise saturated. Default implementation just returns true.

A hook allowing you to customize rewrite searching behavior. Useful to implement rule management.

Default implementation just calls Rewrite::search.

A hook allowing you to customize rewrite application behavior. Useful to implement rule management.

Default implementation just calls Rewrite::apply and returns number of new applications.

Implementors