[][src]Trait egg::RewriteScheduler

pub trait RewriteScheduler<L, M> where
    L: Language,
    M: Metadata<L>, 
{ fn can_stop(&self, iteration: usize) -> bool { ... }
fn search_rewrite(
        &mut self,
        iteration: usize,
        egraph: &EGraph<L, M>,
        rewrite: &Rewrite<L, M>
    ) -> Vec<SearchMatches> { ... }
fn apply_rewrite(
        &mut self,
        iteration: usize,
        egraph: &mut EGraph<L, M>,
        rewrite: &Rewrite<L, M>,
        matches: Vec<SearchMatches>
    ) -> usize { ... } }

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

fn can_stop(&self, iteration: usize) -> bool

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

Default implementation just returns true.

fn search_rewrite(
    &mut self,
    iteration: usize,
    egraph: &EGraph<L, M>,
    rewrite: &Rewrite<L, M>
) -> Vec<SearchMatches>

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

Default implementation just calls Rewrite::search.

fn apply_rewrite(
    &mut self,
    iteration: usize,
    egraph: &mut EGraph<L, M>,
    rewrite: &Rewrite<L, M>,
    matches: Vec<SearchMatches>
) -> usize

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.

Loading content...

Implementors

impl<L, M> RewriteScheduler<L, M> for BackoffScheduler where
    L: Language,
    M: Metadata<L>, 
[src]

impl<L, M> RewriteScheduler<L, M> for SimpleScheduler where
    L: Language,
    M: Metadata<L>, 
[src]

Loading content...