[−][src]Struct egg::BackoffScheduler
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
impl BackoffScheduler
[src]
pub fn with_initial_match_limit(self, initial_match_limit: usize) -> Self
[src]
Set the initial match limit after which a rule will be banned. Default: 1,000
pub fn with_ban_length(self, ban_length: usize) -> Self
[src]
Set the initial ban length. Default: 5 iterations
pub fn do_not_ban(self, name: impl Into<String>) -> Self
[src]
Never ban a particular rule.
Trait Implementations
impl Default for BackoffScheduler
[src]
impl<L, N> RewriteScheduler<L, N> for BackoffScheduler where
L: Language,
N: Analysis<L>,
[src]
L: Language,
N: Analysis<L>,
fn can_stop(&mut self, iteration: usize) -> bool
[src]
fn search_rewrite(
&mut self,
iteration: usize,
egraph: &EGraph<L, N>,
rewrite: &Rewrite<L, N>
) -> Vec<SearchMatches>
[src]
&mut self,
iteration: usize,
egraph: &EGraph<L, N>,
rewrite: &Rewrite<L, N>
) -> Vec<SearchMatches>
fn apply_rewrite(
&mut self,
iteration: usize,
egraph: &mut EGraph<L, N>,
rewrite: &Rewrite<L, N>,
matches: Vec<SearchMatches>
) -> usize
[src]
&mut self,
iteration: usize,
egraph: &mut EGraph<L, N>,
rewrite: &Rewrite<L, N>,
matches: Vec<SearchMatches>
) -> usize
Auto Trait Implementations
impl RefUnwindSafe for BackoffScheduler
impl Send for BackoffScheduler
impl Sync for BackoffScheduler
impl Unpin for BackoffScheduler
impl UnwindSafe for BackoffScheduler
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,