Trait MultiFrameTrait

Source
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§

Source

type Ptr: Debug + Eq + Copy

The associated Ptr type

Source

type ContPtr: Debug + Eq + Copy

The associated ContPtr type

Source

type Store: Send + Sync + EvaluationStore<Ptr = Self::Ptr, ContPtr = Self::ContPtr>

The associated Store type

Source

type StoreError: Into<ProofError>

The error type for the Store type

Source

type EvalFrame: FrameLike<Self::Ptr, Self::ContPtr>

The associated Frame type

Source

type CircuitFrame: FrameLike<Self::Ptr, Self::ContPtr, FrameIO = <Self::EvalFrame as FrameLike<Self::Ptr, Self::ContPtr>>::FrameIO>

The associated CircuitFrame type

Source

type GlobalAllocation

The associated type which manages global allocations

Source

type AllocatedIO

The associated type of allocated input and output to the circuit

Required Methods§

Source

fn emitted(store: &Self::Store, eval_frame: &Self::EvalFrame) -> Vec<Self::Ptr>

the emitted frames

Source

fn significant_frame_count(frames: &[Self::EvalFrame]) -> usize

Counting the number of non-trivial frames in the evaluation

Source

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

Source

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

Source

fn precedes(&self, maybe_next: &Self) -> bool

Returns true if the supplied instance directly precedes this one in a sequential computation trace.

Source

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.

Source

fn output( &self, ) -> &Option<<Self::EvalFrame as FrameLike<Self::Ptr, Self::ContPtr>>::FrameIO>

The output of the last frame

Source

fn frames(&self) -> Option<&Vec<Self::CircuitFrame>>

Iterates through the Self::CircuitFrame instances

Source

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.

Source

fn blank(folding_config: Arc<FoldingConfig<F, C>>, pc: usize) -> Self

Synthesize a blank circuit.

Source

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.

Implementors§