TransitionConstraintDegree

Struct TransitionConstraintDegree 

Source
pub struct TransitionConstraintDegree { /* private fields */ }
Expand description

Degree descriptor of a transition constraint.

Describes constraint degree as a combination of multiplications of periodic and trace columns. For example, degree of a constraint which requires multiplication of two trace columns can be described as: base: 2, cycles: []. A constraint which requires multiplication of 3 trace columns and a periodic column with a period of 32 steps can be described as: base: 3, cycles: [32].

Implementations§

Source§

impl TransitionConstraintDegree

Source

pub fn new(degree: usize) -> TransitionConstraintDegree

Creates a new transition constraint degree descriptor for constraints which involve multiplications of trace columns only.

For example, if a constraint involves multiplication of two trace columns, degree should be set to 2. If a constraint involves multiplication of three trace columns, degree should be set to 3 etc.

§Panics

Panics if the provided degree is zero.

Source

pub fn with_cycles( base_degree: usize, cycles: Vec<usize>, ) -> TransitionConstraintDegree

Creates a new transition degree descriptor for constraints which involve multiplication of trace columns and periodic columns.

For example, if a constraint involves multiplication of two trace columns and one periodic column with a period length of 32 steps, base_degree should be set to 2, and cycles should be set to vec![32].

§Panics

Panics if:

  • base_degree is zero.
  • Any of the values in the cycles vector is smaller than two or is not powers of two.
Source

pub fn get_evaluation_degree(&self, trace_length: usize) -> usize

Computes a degree to which this degree description expands in the context of execution trace of the specified length.

The expanded degree is computed as follows:

$$ b \cdot (n - 1) + \sum_{i = 0}^{k - 1}{\frac{n \cdot (c_i - 1)}{c_i}} $$

where: $b$ is the base degree, $n$ is the trace_length, $c_i$ is a cycle length of periodic column $i$, and $k$ is the total number of periodic columns for this degree descriptor.

Thus, evaluation degree of a transition constraint which involves multiplication of two trace columns and one periodic column with a period length of 32 steps when evaluated over an execution trace of 64 steps would be:

$$ 2 \cdot (64 - 1) + \frac{64 \cdot (32 - 1)}{32} = 126 + 62 = 188 $$

Source

pub fn min_blowup_factor(&self) -> usize

Returns a minimum blowup factor needed to evaluate constraint of this degree.

This is guaranteed to be a power of two, greater than one.

Trait Implementations§

Source§

impl Clone for TransitionConstraintDegree

Source§

fn clone(&self) -> TransitionConstraintDegree

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TransitionConstraintDegree

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl PartialEq for TransitionConstraintDegree

Source§

fn eq(&self, other: &TransitionConstraintDegree) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for TransitionConstraintDegree

Source§

impl StructuralPartialEq for TransitionConstraintDegree

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.