pub trait MultiFrameTrait<'a, F: LurkField, C: Coprocessor<F> + 'a>:
Provable<F>
+ Circuit<F>
+ StepCircuit<F>
+ 'a {
type Ptr: Debug + Eq + Copy;
type ContPtr: Debug + Eq + Copy;
type Store: Send + Sync + EvaluationStore<Ptr = Self::Ptr, ContPtr = Self::ContPtr>;
type StoreError: Into<ProofError>;
type EvalFrame: FrameLike<Self::Ptr, Self::ContPtr>;
type CircuitFrame: FrameLike<Self::Ptr, Self::ContPtr, FrameIO = <Self::EvalFrame as FrameLike<Self::Ptr, Self::ContPtr>>::FrameIO>;
type GlobalAllocation;
type AllocatedIO;
// Required methods
fn emitted(
store: &Self::Store,
eval_frame: &Self::EvalFrame,
) -> Vec<Self::Ptr>;
fn significant_frame_count(frames: &[Self::EvalFrame]) -> usize;
fn build_frames(
expr: Self::Ptr,
env: Self::Ptr,
store: &Self::Store,
limit: usize,
ec: &EvalConfig<'_, F, C>,
) -> Result<Vec<Self::EvalFrame>, ProofError>;
fn io_to_scalar_vector(
store: &Self::Store,
io: &<Self::EvalFrame as FrameLike<Self::Ptr, Self::ContPtr>>::FrameIO,
) -> Vec<F>;
fn precedes(&self, maybe_next: &Self) -> bool;
fn cache_witness(&mut self, s: &Self::Store) -> Result<(), SynthesisError>;
fn output(
&self,
) -> &Option<<Self::EvalFrame as FrameLike<Self::Ptr, Self::ContPtr>>::FrameIO>;
fn frames(&self) -> Option<&Vec<Self::CircuitFrame>>;
fn synthesize_frames<CS: ConstraintSystem<F>>(
&self,
cs: &mut CS,
store: &Self::Store,
input: Self::AllocatedIO,
frames: &[Self::CircuitFrame],
g: &Self::GlobalAllocation,
) -> Result<Self::AllocatedIO, SynthesisError>;
fn blank(folding_config: Arc<FoldingConfig<F, C>>, pc: usize) -> Self;
fn from_frames(
frames: &[Self::EvalFrame],
store: &'a Self::Store,
folding_config: Arc<FoldingConfig<F, C>>,
) -> Vec<Self>;
}Expand description
Trait to support multiple MultiFrame implementations.
Required Associated Types§
Sourcetype Store: Send + Sync + EvaluationStore<Ptr = Self::Ptr, ContPtr = Self::ContPtr>
type Store: Send + Sync + EvaluationStore<Ptr = Self::Ptr, ContPtr = Self::ContPtr>
The associated Store type
Sourcetype StoreError: Into<ProofError>
type StoreError: Into<ProofError>
The error type for the Store type
Sourcetype CircuitFrame: FrameLike<Self::Ptr, Self::ContPtr, FrameIO = <Self::EvalFrame as FrameLike<Self::Ptr, Self::ContPtr>>::FrameIO>
type CircuitFrame: FrameLike<Self::Ptr, Self::ContPtr, FrameIO = <Self::EvalFrame as FrameLike<Self::Ptr, Self::ContPtr>>::FrameIO>
The associated CircuitFrame type
Sourcetype GlobalAllocation
type GlobalAllocation
The associated type which manages global allocations
Sourcetype AllocatedIO
type AllocatedIO
The associated type of allocated input and output to the circuit
Required Methods§
Sourcefn emitted(store: &Self::Store, eval_frame: &Self::EvalFrame) -> Vec<Self::Ptr>
fn emitted(store: &Self::Store, eval_frame: &Self::EvalFrame) -> Vec<Self::Ptr>
the emitted frames
Sourcefn significant_frame_count(frames: &[Self::EvalFrame]) -> usize
fn significant_frame_count(frames: &[Self::EvalFrame]) -> usize
Counting the number of non-trivial frames in the evaluation
Sourcefn build_frames(
expr: Self::Ptr,
env: Self::Ptr,
store: &Self::Store,
limit: usize,
ec: &EvalConfig<'_, F, C>,
) -> Result<Vec<Self::EvalFrame>, ProofError>
fn build_frames( expr: Self::Ptr, env: Self::Ptr, store: &Self::Store, limit: usize, ec: &EvalConfig<'_, F, C>, ) -> Result<Vec<Self::EvalFrame>, ProofError>
Evaluates and generates the frames of the computation given the expression, environment, and store
Sourcefn io_to_scalar_vector(
store: &Self::Store,
io: &<Self::EvalFrame as FrameLike<Self::Ptr, Self::ContPtr>>::FrameIO,
) -> Vec<F>
fn io_to_scalar_vector( store: &Self::Store, io: &<Self::EvalFrame as FrameLike<Self::Ptr, Self::ContPtr>>::FrameIO, ) -> Vec<F>
Returns a public IO vector when equipped with the local store, and the Self::Frame’s IO
Sourcefn precedes(&self, maybe_next: &Self) -> bool
fn precedes(&self, maybe_next: &Self) -> bool
Returns true if the supplied instance directly precedes this one in a sequential computation trace.
Sourcefn cache_witness(&mut self, s: &Self::Store) -> Result<(), SynthesisError>
fn cache_witness(&mut self, s: &Self::Store) -> Result<(), SynthesisError>
Cache the witness internally, which can be used later during synthesis.
This function can be called in parallel to speed up the witness generation
for a series of MultiFrameTrait instances.
Sourcefn output(
&self,
) -> &Option<<Self::EvalFrame as FrameLike<Self::Ptr, Self::ContPtr>>::FrameIO>
fn output( &self, ) -> &Option<<Self::EvalFrame as FrameLike<Self::Ptr, Self::ContPtr>>::FrameIO>
The output of the last frame
Sourcefn frames(&self) -> Option<&Vec<Self::CircuitFrame>>
fn frames(&self) -> Option<&Vec<Self::CircuitFrame>>
Iterates through the Self::CircuitFrame instances
Sourcefn synthesize_frames<CS: ConstraintSystem<F>>(
&self,
cs: &mut CS,
store: &Self::Store,
input: Self::AllocatedIO,
frames: &[Self::CircuitFrame],
g: &Self::GlobalAllocation,
) -> Result<Self::AllocatedIO, SynthesisError>
fn synthesize_frames<CS: ConstraintSystem<F>>( &self, cs: &mut CS, store: &Self::Store, input: Self::AllocatedIO, frames: &[Self::CircuitFrame], g: &Self::GlobalAllocation, ) -> Result<Self::AllocatedIO, SynthesisError>
Synthesize some frames.
Sourcefn blank(folding_config: Arc<FoldingConfig<F, C>>, pc: usize) -> Self
fn blank(folding_config: Arc<FoldingConfig<F, C>>, pc: usize) -> Self
Synthesize a blank circuit.
Sourcefn from_frames(
frames: &[Self::EvalFrame],
store: &'a Self::Store,
folding_config: Arc<FoldingConfig<F, C>>,
) -> Vec<Self>
fn from_frames( frames: &[Self::EvalFrame], store: &'a Self::Store, folding_config: Arc<FoldingConfig<F, C>>, ) -> Vec<Self>
Create an instance from some Self::Frames.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.