Function miden_air::stack::stack_manipulation::enforce_swap_constraints
source · pub fn enforce_swap_constraints<E: FieldElement>(
frame: &EvaluationFrame<E>,
result: &mut [E],
op_flag: E
) -> usize
Expand description
Enforces constraints of the SWAP operation. The SWAP operation swaps the first two elements in the stack. Therefore, the following constraints are enforced:
- The first element in the current frame should be equal to the second element in the next frame.
- The second element in the current frame should be equal to the first element in the next frame.