pub struct PreprocessorChain<L: Literal, S: LiteralStorage<L>> { /* private fields */ }Expand description
A chain of preprocessors, allowing multiple preprocessing techniques to be applied sequentially.
Preprocessors are stored as Arc<dyn Preprocessor<L, S>> to allow for
different concrete preprocessor types in the same chain.
§Type Parameters
L: TheLiteraltype.S: TheLiteralStoragetype.
Implementations§
Source§impl<L: Literal, S: LiteralStorage<L>> PreprocessorChain<L, S>
impl<L: Literal, S: LiteralStorage<L>> PreprocessorChain<L, S>
Sourcepub fn add_preprocessor<P: Preprocessor<L, S> + 'static>(
self,
preprocessor: P,
) -> Self
pub fn add_preprocessor<P: Preprocessor<L, S> + 'static>( self, preprocessor: P, ) -> Self
Adds a preprocessor to the chain.
The preprocessor is wrapped in an Arc to be stored in the chain.
This method consumes self and returns a new chain with the added preprocessor.
§Arguments
preprocessor: An instance of a typePthat implementsPreprocessor<L, S>and is'static(required fordyn Trait).
§Returns
A new PreprocessorChain with the added preprocessor.
Trait Implementations§
Source§impl<L: Clone + Literal, S: Clone + LiteralStorage<L>> Clone for PreprocessorChain<L, S>
impl<L: Clone + Literal, S: Clone + LiteralStorage<L>> Clone for PreprocessorChain<L, S>
Source§fn clone(&self) -> PreprocessorChain<L, S>
fn clone(&self) -> PreprocessorChain<L, S>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<L: Literal, S: LiteralStorage<L>> Debug for PreprocessorChain<L, S>
Custom Debug implementation for PreprocessorChain.
impl<L: Literal, S: LiteralStorage<L>> Debug for PreprocessorChain<L, S>
Custom Debug implementation for PreprocessorChain.
As dyn Preprocessor is not Debug, we provide a simple placeholder debug output.
Source§impl<L: Default + Literal, S: Default + LiteralStorage<L>> Default for PreprocessorChain<L, S>
impl<L: Default + Literal, S: Default + LiteralStorage<L>> Default for PreprocessorChain<L, S>
Source§fn default() -> PreprocessorChain<L, S>
fn default() -> PreprocessorChain<L, S>
Source§impl<L: Literal, S: LiteralStorage<L>> Preprocessor<L, S> for PreprocessorChain<L, S>
impl<L: Literal, S: LiteralStorage<L>> Preprocessor<L, S> for PreprocessorChain<L, S>
Source§fn preprocess(&self, cnf: &[Clause<L, S>]) -> Vec<Clause<L, S>>
fn preprocess(&self, cnf: &[Clause<L, S>]) -> Vec<Clause<L, S>>
Applies each preprocessor in the chain sequentially.
The output of one preprocessor becomes the input to the next.
The initial input cnf is cloned to start the process.
§Arguments
cnf: A slice ofClause<L, S>representing the input formula.
§Returns
A Vec<Clause<L, S>> representing the formula after all preprocessors
in the chain have been applied.
Auto Trait Implementations§
impl<L, S> Freeze for PreprocessorChain<L, S>
impl<L, S> !RefUnwindSafe for PreprocessorChain<L, S>
impl<L, S> !Send for PreprocessorChain<L, S>
impl<L, S> !Sync for PreprocessorChain<L, S>
impl<L, S> Unpin for PreprocessorChain<L, S>
impl<L, S> !UnwindSafe for PreprocessorChain<L, S>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more