Struct egg::BackoffScheduler [−][src]
pub struct BackoffScheduler { /* fields omitted */ }
Expand description
A RewriteScheduler
that implements exponentional rule backoff.
For each rewrite, there exists a configurable initial match limit. If a rewrite search yield more than this limit, then we ban this rule for number of iterations, double its limit, and double the time it will be banned next time.
This seems effective at preventing explosive rules like associativity from taking an unfair amount of resources.
BackoffScheduler
is configurable in the builder-pattern style.
Implementations
Set the initial match limit after which a rule will be banned. Default: 1,000
Set the initial ban length. Default: 5 iterations
Never ban a particular rule.
Set the initial match limit for a rule.
Set the initial ban length for a rule.
Trait Implementations
fn search_rewrite<'a>(
&mut self,
iteration: usize,
egraph: &EGraph<L, N>,
rewrite: &'a Rewrite<L, N>
) -> Vec<SearchMatches<'a, L>>
fn search_rewrite<'a>(
&mut self,
iteration: usize,
egraph: &EGraph<L, N>,
rewrite: &'a Rewrite<L, N>
) -> Vec<SearchMatches<'a, L>>
A hook allowing you to customize rewrite searching behavior. Useful to implement rule management. Read more
fn apply_rewrite(
&mut self,
iteration: usize,
egraph: &mut EGraph<L, N>,
rewrite: &Rewrite<L, N>,
matches: Vec<SearchMatches<'_, L>>
) -> usize
fn apply_rewrite(
&mut self,
iteration: usize,
egraph: &mut EGraph<L, N>,
rewrite: &Rewrite<L, N>,
matches: Vec<SearchMatches<'_, L>>
) -> usize
A hook allowing you to customize rewrite application behavior. Useful to implement rule management. Read more