pub struct OpFlags<E: FieldElement> { /* private fields */ }
Expand description
Operation flags for all stack operations.
Computes all the operation flag values of the individual stack operations using intermediate values which helps in reducing the number of field multiplication operations being used in the calculation of the operation flag.
The operation flag values are computed separately for degree 7 and degree 6 and 4 stack operations. Only one flag will be set to ONE and rest all would be ZERO for an execution trace. It also computes the composite flags using individual stack operation flags for generic stack constraints.
Implementations§
source§impl<E: FieldElement> OpFlags<E>
impl<E: FieldElement> OpFlags<E>
sourcepub fn new(frame: &EvaluationFrame<E>) -> Self
pub fn new(frame: &EvaluationFrame<E>) -> Self
Returns a new instance of OpFlags instantiated with all stack operation flags. It computes the following operations:
- degree 7 operations which doesn’t shift the stack.
- degree 7 operations which shifts the stack to the left.
- degree 7 operations which shifts the stack to the right.
- degree 6 and 4 operations.
- composite flags for individual stack items whose value has been copied over.
- composite flags for individual stack items which has been shifted to the left.
- composite flags for individual stack items which has been shifted to the right.
- composite flag for the stack if the stack has been shifted to the left.
- composite flag for the stack if the stack has been shifted to the right.
- composite flag if the current operation being executed is a control flow operation or not.
- composite flag if the current operation being executed has a binary element constraint on the top element in the stack.
sourcepub fn u32assert2(&self) -> E
pub fn u32assert2(&self) -> E
Operation Flag of U32ASSERT2 operation.
sourcepub fn no_shift_at(&self, index: usize) -> E
pub fn no_shift_at(&self, index: usize) -> E
Returns ONE when the stack item at the specified depth remains unchanged during an operation, and ZERO otherwise
sourcepub fn left_shift_at(&self, index: usize) -> E
pub fn left_shift_at(&self, index: usize) -> E
Returns ONE when the stack item at the specified depth shifts to the left during an operation, and ZERO otherwise. The left shift is not defined on the first postion in the stack and therefore, a ZERO is returned.
sourcepub fn right_shift_at(&self, index: usize) -> E
pub fn right_shift_at(&self, index: usize) -> E
Returns ONE when the stack item at the specified depth shifts to the right during an operation, and ZERO otherwise. The right shift is not defined on the last postion in the stack and therefore, a ZERO is returned.
sourcepub fn right_shift(&self) -> E
pub fn right_shift(&self) -> E
Returns the flag when the stack operation shifts the flag to the right.
sourcepub fn left_shift(&self) -> E
pub fn left_shift(&self) -> E
Returns the flag when the stack operation shifts the flag to the left.
sourcepub fn control_flow(&self) -> E
pub fn control_flow(&self) -> E
Returns the flag when the stack operation is a control flow operation.
sourcepub fn overflow(&self) -> E
pub fn overflow(&self) -> E
Returns the flag if the stack overflow table contains values or not.
sourcepub fn top_binary(&self) -> E
pub fn top_binary(&self) -> E
Returns the flag when the stack operation needs the top element to be binary.