pub struct PermutationWitnessBuilder<P: Permutation<WIDTH>, const WIDTH: usize> { /* private fields */ }Expand description
A Permutation that records the values flowing through permutation.
Drive it through the same code as the PermutationRelation, and the
trace it records is the PermutationWitness for the instance the
relation compiles to. Handles are reference counted like the relation’s.
Implementations§
Source§impl<P: Permutation<WIDTH>, const WIDTH: usize> PermutationWitnessBuilder<P, WIDTH>
impl<P: Permutation<WIDTH>, const WIDTH: usize> PermutationWitnessBuilder<P, WIDTH>
pub fn new(permutation: P) -> Self
Sourcepub const fn permutation(&self) -> &P
pub const fn permutation(&self) -> &P
The permutation being traced.
Sourcepub fn allocate_permutation(&self, input: &[P::U; WIDTH]) -> [P::U; WIDTH]
pub fn allocate_permutation(&self, input: &[P::U; WIDTH]) -> [P::U; WIDTH]
Evaluates the permutation on input and records the step.
Sourcepub fn add_permutation(&self, input: &[P::U; WIDTH], output: &[P::U; WIDTH])
pub fn add_permutation(&self, input: &[P::U; WIDTH], output: &[P::U; WIDTH])
Records a step without evaluating the permutation.
Sourcepub fn trace(&self) -> Vec<QueryAnswerPair<P::U, WIDTH>>
pub fn trace(&self) -> Vec<QueryAnswerPair<P::U, WIDTH>>
The steps recorded so far.
Sourcepub fn snapshot(&self) -> PermutationWitness<P::U, WIDTH>
pub fn snapshot(&self) -> PermutationWitness<P::U, WIDTH>
The witness recorded so far.
Trait Implementations§
Source§impl<P: Permutation<WIDTH>, const WIDTH: usize> Clone for PermutationWitnessBuilder<P, WIDTH>
impl<P: Permutation<WIDTH>, const WIDTH: usize> Clone for PermutationWitnessBuilder<P, WIDTH>
Source§impl<P: Permutation<WIDTH>, const WIDTH: usize> From<P> for PermutationWitnessBuilder<P, WIDTH>
impl<P: Permutation<WIDTH>, const WIDTH: usize> From<P> for PermutationWitnessBuilder<P, WIDTH>
Source§impl<P: Permutation<WIDTH>, const WIDTH: usize> Permutation<WIDTH> for PermutationWitnessBuilder<P, WIDTH>
impl<P: Permutation<WIDTH>, const WIDTH: usize> Permutation<WIDTH> for PermutationWitnessBuilder<P, WIDTH>
Source§fn permute_mut(&self, state: &mut [Self::U; WIDTH])
fn permute_mut(&self, state: &mut [Self::U; WIDTH])
See the note on PermutationRelation’s implementation.
Auto Trait Implementations§
impl<P, const WIDTH: usize> !RefUnwindSafe for PermutationWitnessBuilder<P, WIDTH>
impl<P, const WIDTH: usize> !UnwindSafe for PermutationWitnessBuilder<P, WIDTH>
impl<P, const WIDTH: usize> Freeze for PermutationWitnessBuilder<P, WIDTH>
impl<P, const WIDTH: usize> Send for PermutationWitnessBuilder<P, WIDTH>
impl<P, const WIDTH: usize> Sync for PermutationWitnessBuilder<P, WIDTH>
impl<P, const WIDTH: usize> Unpin for PermutationWitnessBuilder<P, WIDTH>
impl<P, const WIDTH: usize> UnsafeUnpin for PermutationWitnessBuilder<P, WIDTH>where
P: UnsafeUnpin,
Arc<RwLock<Vec<QueryAnswerPair<<P as Permutation<WIDTH>>::U, WIDTH>>>>: UnsafeUnpin,
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
Converts
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> ⓘ
Converts
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