Instruction-Specific Transition Constraints
Instruction pop + n
This instruction is fully constrained by its instruction groups
Instruction push + a
In addition to its instruction groups, this instruction has the following constraints.
Description
- The instruction's argument
ais moved onto the stack.
Polynomials
st0' - nia
Instruction divine + n
This instruction is fully constrained by its instruction groups
Instruction pick + i
This instruction makes use of indicator polynomials. In addition to its instruction groups, this instruction has the following constraints.
Description
For 0 ⩽ i < 16:
- Stack element
iis moved to the top. - For 0 ⩽
j<i: stack elementjis shifted down by 1. - For
j>i: stack elementjremains unchanged.
Instruction place + i
This instruction makes use of indicator polynomials. In addition to its instruction groups, this instruction has the following constraints.
Description
For 0 ⩽ i < 16:
- Stack element 0 is moved to position
i. - For 0 ⩽
j<i: stack elementjis shifted up by 1. - For
j>i: stack elementjremains unchanged.
Instruction dup + i
This instruction makes use of indicator polynomials. In addition to its instruction groups, this instruction has the following constraints.
Description
- If
iis 0, thenst0is put on top of the stack and
ifiis 1, thenst1is put on top of the stack and
ifiis 2, thenst2is put on top of the stack and
ifiis 3, thenst3is put on top of the stack and
ifiis 4, thenst4is put on top of the stack and
ifiis 5, thenst5is put on top of the stack and
ifiis 6, thenst6is put on top of the stack and
ifiis 7, thenst7is put on top of the stack and
ifiis 8, thenst8is put on top of the stack and
ifiis 9, thenst9is put on top of the stack and
ifiis 10, thenst10is put on top of the stack and
ifiis 11, thenst11is put on top of the stack and
ifiis 12, thenst12is put on top of the stack and
ifiis 13, thenst13is put on top of the stack and
ifiis 14, thenst14is put on top of the stack and
ifiis 15, thenst15is put on top of the stack.
Polynomials
ind_0(hv3, hv2, hv1, hv0)·(st0' - st0)
+ ind_1(hv3, hv2, hv1, hv0)·(st0' - st1)
+ ind_2(hv3, hv2, hv1, hv0)·(st0' - st2)
+ ind_3(hv3, hv2, hv1, hv0)·(st0' - st3)
+ ind_4(hv3, hv2, hv1, hv0)·(st0' - st4)
+ ind_5(hv3, hv2, hv1, hv0)·(st0' - st5)
+ ind_6(hv3, hv2, hv1, hv0)·(st0' - st6)
+ ind_7(hv3, hv2, hv1, hv0)·(st0' - st7)
+ ind_8(hv3, hv2, hv1, hv0)·(st0' - st8)
+ ind_9(hv3, hv2, hv1, hv0)·(st0' - st9)
+ ind_10(hv3, hv2, hv1, hv0)·(st0' - st10)
+ ind_11(hv3, hv2, hv1, hv0)·(st0' - st11)
+ ind_12(hv3, hv2, hv1, hv0)·(st0' - st12)
+ ind_13(hv3, hv2, hv1, hv0)·(st0' - st13)
+ ind_14(hv3, hv2, hv1, hv0)·(st0' - st14)
+ ind_15(hv3, hv2, hv1, hv0)·(st0' - st15)
Instruction swap + i
This instruction makes use of indicator polynomials. In addition to its instruction groups, this instruction has the following constraints.
Description
For 0 ⩽ i < 16:
- Stack element
iis moved to the top. - The top stack element is moved to position
i - For
j≠i: stack elementjremains unchanged.
Instruction nop
This instruction is fully constrained by its instruction groups
Instruction skiz
For the correct behavior of instruction skiz, the instruction pointer ip needs to increment by either 1, or 2, or 3.
The concrete value depends on the top of the stack st0 and the next instruction, held in nia.
Helper variable hv0 helps with identifying whether st0 is 0.
To this end, it holds the inverse-or-zero of st0, i.e., is 0 if and only if st0 is 0, and is the inverse of st0 otherwise.
Efficient arithmetization of instruction skiz makes use of one of the properties of opcodes.
Concretely, the least significant bit of an opcode is 1 if and only if the instruction takes an argument.
The arithmetization of skiz can incorporate this simple flag by decomposing nia into helper variable registers hv,
similarly to how ci is (always) deconstructed into instruction bit registers ib.
Correct decomposition is guaranteed by employing a range check.
In addition to its instruction groups, this instruction has the following constraints.
Description
- Helper variable
hv1is the inverse ofst0or 0. - Helper variable
hv1is the inverse ofst0orst0is 0. - The next instruction
niais decomposed into helper variableshv1throughhv5. - The indicator helper variable
hv1is either 0 or 1. Here,hv1 == 1means thatniatakes an argument. - The helper variable
hv2is either 0 or 1 or 2 or 3. - The helper variable
hv3is either 0 or 1 or 2 or 3. - The helper variable
hv4is either 0 or 1 or 2 or 3. - The helper variable
hv5is either 0 or 1 or 2 or 3. - If
st0is non-zero, registeripis incremented by 1. Ifst0is 0 andniatakes no argument, registeripis incremented by 2. Ifst0is 0 andniatakes an argument, registeripis incremented by 3.
Written as Disjunctive Normal Form, the last constraint can be expressed as:
- (Register
st0is 0 oripis incremented by 1), and (st0has a multiplicative inverse orhv1is 1 oripis incremented by 2), and (st0has a multiplicative inverse orhv1is 0 oripis incremented by 3).
Since the three cases are mutually exclusive, the three respective polynomials can be summed up into one.
Polynomials
(st0·hv0 - 1)·hv0(st0·hv0 - 1)·st0nia - hv1 - 2·hv2 - 8·hv3 - 32·hv4 - 128·hv5hv1·(hv1 - 1)hv2·(hv2 - 1)·(hv2 - 2)·(hv2 - 3)hv3·(hv3 - 1)·(hv3 - 2)·(hv3 - 3)hv4·(hv4 - 1)·(hv4 - 2)·(hv4 - 3)hv5·(hv5 - 1)·(hv5 - 2)·(hv5 - 3)(ip' - (ip + 1)·st0)
+ ((ip' - (ip + 2))·(st0·hv0 - 1)·(hv1 - 1))
+ ((ip' - (ip + 3))·(st0·hv0 - 1)·hv1)
Helper variable definitions for skiz
hv0 = inverse(st0)(ifst0 ≠ 0)hv1 = nia mod 2hv2 = (nia >> 1) mod 4hv3 = (nia >> 3) mod 4hv4 = (nia >> 5) mod 4hv5 = nia >> 7
Instruction call + d
In addition to its instruction groups, this instruction has the following constraints.
Description
- The jump stack pointer
jspis incremented by 1. - The jump's origin
jsois set to the current instruction pointeripplus 2. - The jump's destination
jsdis set to the instruction's argumentd. - The instruction pointer
ipis set to the instruction's argumentd.
Polynomials
jsp' - (jsp + 1)jso' - (ip + 2)jsd' - niaip' - nia
Instruction return
In addition to its instruction groups, this instruction has the following constraints.
Description
- The jump stack pointer
jspis decremented by 1. - The instruction pointer
ipis set to the last call's originjso.
Polynomials
jsp' - (jsp - 1)ip' - jso
Instruction recurse
In addition to its instruction groups, this instruction has the following constraints.
Description
- The jump stack pointer
jspdoes not change. - The last jump's origin
jsodoes not change. - The last jump's destination
jsddoes not change. - The instruction pointer
ipis set to the last jump's destinationjsd.
Polynomials
jsp' - jspjso' - jsojsd' - jsdip' - jsd
Instruction recurse_or_return
In addition to its instruction groups, this instruction has the following constraints.
Description
- If
ST5equalsST6, thenipin the next row equalsjsoin the current row. - If
ST5equalsST6, thenjspdecrements by one. - If
ST5equalsST6, thenhv0in the current row is 0. - If
ST5is unequal toST6, thenhv0in the current row is the inverse of(ST6 - ST5). - If
ST5is unequal toST6, thenipin the next row is equal tojsdin the current row. - If
ST5is unequal toST6, thenjspremains unchanged. - If
ST5is unequal toST6, thenjsoremains unchanged. - If
ST5is unequal toST6, thenjsdremains unchanged.
Helper variable definitions for recurse_or_return
To help arithmetizing the equality check between ST5 and ST6, helper variable hv0 is the inverse-or-zero of (ST6 - ST5).
Instruction assert
In addition to its instruction groups, this instruction has the following constraints.
Description
- The current top of the stack
st0is 1.
Polynomials
st0 - 1
Instruction halt
In addition to its instruction groups, this instruction has the following constraints.
Description
- The instruction executed in the following step is instruction
halt.
Polynomials
ci' - ci
Instruction read_mem + n
In addition to its instruction groups, this instruction has the following constraints.
Description
- The RAM pointer
st0is decremented byn. - If
nis 1, thenst1is moved intost2
else ifnis 2, thenst1is moved intost3
else ifnis 3, thenst1is moved intost4
else ifnis 4, thenst1is moved intost5
else ifnis 5, thenst1is moved intost6. - If
nis 1, thenst2is moved intost3
else ifnis 2, thenst2is moved intost4
else ifnis 3, thenst2is moved intost5
else ifnis 4, thenst2is moved intost6
else ifnis 5, thenst2is moved intost7. - If
nis 1, thenst3is moved intost4
else ifnis 2, thenst3is moved intost5
else ifnis 3, thenst3is moved intost6
else ifnis 4, thenst3is moved intost7
else ifnis 5, thenst3is moved intost8. - If
nis 1, thenst4is moved intost5
else ifnis 2, thenst4is moved intost6
else ifnis 3, thenst4is moved intost7
else ifnis 4, thenst4is moved intost8
else ifnis 5, thenst4is moved intost9. - If
nis 1, thenst5is moved intost6
else ifnis 2, thenst5is moved intost7
else ifnis 3, thenst5is moved intost8
else ifnis 4, thenst5is moved intost9
else ifnis 5, thenst5is moved intost10. - If
nis 1, thenst6is moved intost7
else ifnis 2, thenst6is moved intost8
else ifnis 3, thenst6is moved intost9
else ifnis 4, thenst6is moved intost10
else ifnis 5, thenst6is moved intost11. - If
nis 1, thenst7is moved intost8
else ifnis 2, thenst7is moved intost9
else ifnis 3, thenst7is moved intost10
else ifnis 4, thenst7is moved intost11
else ifnis 5, thenst7is moved intost12. - If
nis 1, thenst8is moved intost9
else ifnis 2, thenst8is moved intost10
else ifnis 3, thenst8is moved intost11
else ifnis 4, thenst8is moved intost12
else ifnis 5, thenst8is moved intost13. - If
nis 1, thenst9is moved intost10
else ifnis 2, thenst9is moved intost11
else ifnis 3, thenst9is moved intost12
else ifnis 4, thenst9is moved intost13
else ifnis 5, thenst9is moved intost14. - If
nis 1, thenst10is moved intost11
else ifnis 2, thenst10is moved intost12
else ifnis 3, thenst10is moved intost13
else ifnis 4, thenst10is moved intost14
else ifnis 5, thenst10is moved intost15. - If
nis 1, thenst11is moved intost12
else ifnis 2, thenst11is moved intost13
else ifnis 3, thenst11is moved intost14
else ifnis 4, thenst11is moved intost15
else ifnis 5, then the op stack pointer grows by 5. - If
nis 1, thenst12is moved intost13
else ifnis 2, thenst12is moved intost14
else ifnis 3, thenst12is moved intost15
else ifnis 4, then the op stack pointer grows by 4
else ifnis 5, then with the Op Stack Table accumulatesst11throughst15. - If
nis 1, thenst13is moved intost14
else ifnis 2, thenst13is moved intost15
else ifnis 3, then the op stack pointer grows by 3
else ifnis 4, then the running product with the Op Stack Table accumulatesst12throughst15
else ifnis 5, then the running product with the RAM Table accumulates next row'sst1throughst5. - If
nis 1, thenst14is moved intost15
else ifnis 2, then the op stack pointer grows by 2
else ifnis 3, then the running product with the Op Stack Table accumulatesst13throughst15
else ifnis 4, then the running product with the RAM Table accumulates next row'sst1throughst4 - If
nis 1, then the op stack pointer grows by 1
else ifnis 2, then the running product with the Op Stack Table accumulatesst14andst15
else ifnis 3, then the running product with the RAM Table accumulates next row'sst1throughst3. - If
nis 1, then the running product with the Op Stack Table accumulatesst15
else ifnis 2, then the running product with the RAM Table accumulates next row'sst1andst2. - If
nis 1, then the running product with the RAM Table accumulates next row'sst1.
Instruction write_mem + n
In addition to its instruction groups, this instruction has the following constraints.
Description
- The RAM pointer
st0is incremented byn. - If
nis 1, thenst2is moved intost1
else ifnis 2, thenst3is moved intost1
else ifnis 3, thenst4is moved intost1
else ifnis 4, thenst5is moved intost1
else ifnis 5, thenst6is moved intost1. - If
nis 1, thenst3is moved intost2
else ifnis 2, thenst4is moved intost2
else ifnis 3, thenst5is moved intost2
else ifnis 4, thenst6is moved intost2
else ifnis 5, thenst7is moved intost2. - If
nis 1, thenst4is moved intost3
else ifnis 2, thenst5is moved intost3
else ifnis 3, thenst6is moved intost3
else ifnis 4, thenst7is moved intost3
else ifnis 5, thenst8is moved intost3. - If
nis 1, thenst5is moved intost4
else ifnis 2, thenst6is moved intost4
else ifnis 3, thenst7is moved intost4
else ifnis 4, thenst8is moved intost4
else ifnis 5, thenst9is moved intost4. - If
nis 1, thenst6is moved intost5
else ifnis 2, thenst7is moved intost5
else ifnis 3, thenst8is moved intost5
else ifnis 4, thenst9is moved intost5
else ifnis 5, thenst10is moved intost5. - If
nis 1, thenst7is moved intost6
else ifnis 2, thenst8is moved intost6
else ifnis 3, thenst9is moved intost6
else ifnis 4, thenst10is moved intost6
else ifnis 5, thenst11is moved intost6. - If
nis 1, thenst8is moved intost7
else ifnis 2, thenst9is moved intost7
else ifnis 3, thenst10is moved intost7
else ifnis 4, thenst11is moved intost7
else ifnis 5, thenst12is moved intost7. - If
nis 1, thenst9is moved intost8
else ifnis 2, thenst10is moved intost8
else ifnis 3, thenst11is moved intost8
else ifnis 4, thenst12is moved intost8
else ifnis 5, thenst13is moved intost8. - If
nis 1, thenst10is moved intost9
else ifnis 2, thenst11is moved intost9
else ifnis 3, thenst12is moved intost9
else ifnis 4, thenst13is moved intost9
else ifnis 5, thenst14is moved intost9. - If
nis 1, thenst11is moved intost10
else ifnis 2, thenst12is moved intost10
else ifnis 3, thenst13is moved intost10
else ifnis 4, thenst14is moved intost10
else ifnis 5, thenst15is moved intost10. - If
nis 1, thenst12is moved intost11
else ifnis 2, thenst13is moved intost11
else ifnis 3, thenst14is moved intost11
else ifnis 4, thenst15is moved intost11
else ifnis 5, then the op stack pointer shrinks by 5. - If
nis 1, thenst13is moved intost12
else ifnis 2, thenst14is moved intost12
else ifnis 3, thenst15is moved intost12
else ifnis 4, then the op stack pointer shrinks by 4
else ifnis 5, then the running product with the Op Stack Table accumulates next row'sst11throughst15. - If
nis 1, thenst14is moved intost13
else ifnis 2, thenst15is moved intost13
else ifnis 3, then the op stack pointer shrinks by 3
else ifnis 4, then the running product with the Op Stack Table accumulates next row'sst12throughst15
else ifnis 5, then the running product with the RAM Table accumulatesst1throughst5. - If
nis 1, thenst15is moved intost14
else ifnis 2, then the op stack pointer shrinks by 2
else ifnis 3, then the running product with the Op Stack Table accumulates next row'sst13throughst15
else ifnis 4, then the running product with the RAM Table accumulatesst1throughst4. - If
nis 1, then the op stack pointer shrinks by 1
else ifnis 2, then the running product with the Op Stack Table accumulates next row'sst14andst15
else ifnis 3, then the running product with the RAM Table accumulatesst1throughst2. - If
nis 1, then the running product with the Op Stack Table accumulates next row'sst15
else ifnis 2, then the running product with the RAM Table accumulatesst1andst1. - If
nis 1, then the running product with the RAM Table accumulatesst1.
Instruction hash
In addition to its instruction groups, this instruction has the following constraints.
Description
st10is moved intost5.st11is moved intost6.st12is moved intost7.st13is moved intost8.st14is moved intost9.st15is moved intost10.- The op stack pointer shrinks by 5.
- The running product with the Op Stack Table accumulates next row's
st11throughst15.
Polynomials
st5' - st10st6' - st11st7' - st12st8' - st13st9' - st14st10' - st15op_stack_pointer' - op_stack_pointer + 5RunningProductOpStackTable' - RunningProductOpStackTable·(🪤 - 🍋·clk - 🍊 - 🍉·op_stack_pointer' - 🫒·st15')
·(🪤 - 🍋·clk - 🍊 - 🍉·(op_stack_pointer' + 1) - 🫒·st14')
·(🪤 - 🍋·clk - 🍊 - 🍉·(op_stack_pointer' + 2) - 🫒·st13')
·(🪤 - 🍋·clk - 🍊 - 🍉·(op_stack_pointer' + 3) - 🫒·st12')
·(🪤 - 🍋·clk - 🍊 - 🍉·(op_stack_pointer' + 4) - 🫒·st11')
Instruction assert_vector
In addition to its instruction groups, this instruction has the following constraints.
Description
st0is equal tost5.st1is equal tost6.st2is equal tost7.st3is equal tost8.st4is equal tost9.st10is moved intost5.st11is moved intost6.st12is moved intost7.st13is moved intost8.st14is moved intost9.st15is moved intost10.- The op stack pointer shrinks by 5.
- The running product with the Op Stack Table accumulates next row's
st11throughst15.
Polynomials
st5 - st0st6 - st1st7 - st2st8 - st3st9 - st4st5' - st10st6' - st11st7' - st12st8' - st13st9' - st14st10' - st15op_stack_pointer' - op_stack_pointer + 5RunningProductOpStackTable' - RunningProductOpStackTable·(🪤 - 🍋·clk - 🍊 - 🍉·op_stack_pointer' - 🫒·st15')
·(🪤 - 🍋·clk - 🍊 - 🍉·(op_stack_pointer' + 1) - 🫒·st14')
·(🪤 - 🍋·clk - 🍊 - 🍉·(op_stack_pointer' + 2) - 🫒·st13')
·(🪤 - 🍋·clk - 🍊 - 🍉·(op_stack_pointer' + 3) - 🫒·st12')
·(🪤 - 🍋·clk - 🍊 - 🍉·(op_stack_pointer' + 4) - 🫒·st11')
Instruction sponge_init
This instruction is fully constrained by its instruction groups Beyond that, correct transition is guaranteed by the Hash Table.
Instruction sponge_absorb
In addition to its instruction groups, this instruction has the following constraints. Beyond that, correct transition is guaranteed by the Hash Table.
Description
st10is moved intost0.st11is moved intost1.st12is moved intost2.st13is moved intost3.st14is moved intost4.st15is moved intost5.- The op stack pointer shrinks by 10.
- The running product with the Op Stack Table accumulates next row's
st6throughst15.
Polynomials
st0' - st10st1' - st11st2' - st12st3' - st13st4' - st14st5' - st15op_stack_pointer' - op_stack_pointer + 10RunningProductOpStackTable' - RunningProductOpStackTable·(🪤 - 🍋·clk - 🍊 - 🍉·op_stack_pointer' - 🫒·st15')
·(🪤 - 🍋·clk - 🍊 - 🍉·(op_stack_pointer' + 1) - 🫒·st14')
·(🪤 - 🍋·clk - 🍊 - 🍉·(op_stack_pointer' + 2) - 🫒·st13')
·(🪤 - 🍋·clk - 🍊 - 🍉·(op_stack_pointer' + 3) - 🫒·st12')
·(🪤 - 🍋·clk - 🍊 - 🍉·(op_stack_pointer' + 4) - 🫒·st11')
·(🪤 - 🍋·clk - 🍊 - 🍉·(op_stack_pointer' + 5) - 🫒·st10')
·(🪤 - 🍋·clk - 🍊 - 🍉·(op_stack_pointer' + 6) - 🫒·st9')
·(🪤 - 🍋·clk - 🍊 - 🍉·(op_stack_pointer' + 7) - 🫒·st8')
·(🪤 - 🍋·clk - 🍊 - 🍉·(op_stack_pointer' + 8) - 🫒·st7')
·(🪤 - 🍋·clk - 🍊 - 🍉·(op_stack_pointer' + 9) - 🫒·st6')
Instruction sponge_absorb_mem
In addition to its instruction groups, this instruction has the following constraints. Beyond that, correct transition is guaranteed by the Hash Table and the RAM Table.
Description
st0is incremented by 10.
Instruction sponge_squeeze
In addition to its instruction groups, this instruction has the following constraints. Beyond that, correct transition is guaranteed by the Hash Table.
Description
st0is moved intost10.st1is moved intost11.st2is moved intost12.st3is moved intost13.st4is moved intost14.st5is moved intost15.- The op stack pointer grows by 10.
- The running product with the Op Stack Table accumulates
st6throughst15.
Polynomials
st10' - st0st11' - st1st12' - st2st13' - st3st14' - st4st15' - st5op_stack_pointer' - op_stack_pointer - 10RunningProductOpStackTable' - RunningProductOpStackTable·(🪤 - 🍋·clk - 🍉·op_stack_pointer - 🫒·st15)
·(🪤 - 🍋·clk - 🍉·(op_stack_pointer + 1) - 🫒·st14)
·(🪤 - 🍋·clk - 🍉·(op_stack_pointer + 2) - 🫒·st13)
·(🪤 - 🍋·clk - 🍉·(op_stack_pointer + 3) - 🫒·st12)
·(🪤 - 🍋·clk - 🍉·(op_stack_pointer + 4) - 🫒·st11)
·(🪤 - 🍋·clk - 🍉·(op_stack_pointer + 5) - 🫒·st10)
·(🪤 - 🍋·clk - 🍉·(op_stack_pointer + 6) - 🫒·st9)
·(🪤 - 🍋·clk - 🍉·(op_stack_pointer + 7) - 🫒·st8)
·(🪤 - 🍋·clk - 🍉·(op_stack_pointer + 8) - 🫒·st7)
·(🪤 - 🍋·clk - 🍉·(op_stack_pointer + 9) - 🫒·st6)
Instruction add
In addition to its instruction groups, this instruction has the following constraints.
Description
- The sum of the top two stack elements is moved into the top of the stack.
Polynomials
st0' - (st0 + st1)
Instruction mul
In addition to its instruction groups, this instruction has the following constraints.
Description
- The product of the top two stack elements is moved into the top of the stack.
Polynomials
st0' - st0·st1
Instruction invert
In addition to its instruction groups, this instruction has the following constraints.
Description
- The top of the stack's inverse is moved into the top of the stack.
Polynomials
st0'·st0 - 1
Instruction eq
In addition to its instruction groups, this instruction has the following constraints.
Description
- Helper variable
hv0is the inverse of the difference of the stack's two top-most elements or 0. - Helper variable
hv0is the inverse of the difference of the stack's two top-most elements or the difference is 0. - The new top of the stack is 1 if the difference between the stack's two top-most elements is not invertible, 0 otherwise.
Polynomials
hv0·(hv0·(st1 - st0) - 1)(st1 - st0)·(hv0·(st1 - st0) - 1)st0' - (1 - hv0·(st1 - st0))
Helper variable definitions for eq
hv0 = inverse(rhs - lhs)ifrhs ≠ lhs.hv0 = 0ifrhs = lhs.
Instruction split
In addition to its instruction groups, this instruction has the following constraints. Part of the correct transition, namely the range check on the instruction's result, is guaranteed by the U32 Table.
Description
- The top of the stack is decomposed as 32-bit chunks into the stack's top-most two elements.
- Helper variable
hv0holds the inverse of subtracted from the high 32 bits or the low 32 bits are 0.
Polynomials
st0 - (2^32·st1' + st0')st0'·(hv0·(st1' - (2^32 - 1)) - 1)
Helper variable definitions for split
Given the high 32 bits of st0 as hi = st0 >> 32 and the low 32 bits of st0 as lo = st0 & 0xffff_ffff,
hv0 = (hi - (2^32 - 1))iflo ≠ 0.hv0 = 0iflo = 0.
Instruction lt
This instruction is fully constrained by its instruction groups Beyond that, correct transition is guaranteed by the U32 Table.
Instruction and
This instruction is fully constrained by its instruction groups Beyond that, correct transition is guaranteed by the U32 Table.
Instruction xor
This instruction is fully constrained by its instruction groups Beyond that, correct transition is guaranteed by the U32 Table.
Instruction log2floor
This instruction is fully constrained by its instruction groups Beyond that, correct transition is guaranteed by the U32 Table.
Instruction pow
This instruction is fully constrained by its instruction groups Beyond that, correct transition is guaranteed by the U32 Table.
Instruction div_mod
Recall that instruction div_mod takes stack _ d n and computes _ q r where n is the numerator, d is the denominator, r is the remainder, and q is the quotient.
The following two properties are guaranteed by the U32 Table:
- The remainder
ris smaller than the denominatord, and - all four of
n,d,q, andrare u32s.
In addition to its instruction groups, this instruction has the following constraints.
Description
- Numerator is quotient times denominator plus remainder:
n == q·d + r.
Polynomials
st0 - st1·st1' - st0'st2' - st2
Instruction pop_count
This instruction is fully constrained by its instruction groups Beyond that, correct transition is guaranteed by the U32 Table.
Instruction xx_add
In addition to its instruction groups, this instruction has the following constraints.
Description
- The result of adding
st0tost3is moved intost0. - The result of adding
st1tost4is moved intost1. - The result of adding
st2tost5is moved intost2. st6is moved intost3.st7is moved intost4.st8is moved intost5.st9is moved intost6.st10is moved intost7.st11is moved intost8.st12is moved intost9.st13is moved intost10.st14is moved intost11.st15is moved intost12.- The op stack pointer shrinks by 3.
- The running product with the Op Stack Table accumulates next row's
st13throughst15.
Polynomials
st0' - (st0 + st3)st1' - (st1 + st4)st2' - (st2 + st5)st3' - st6st4' - st7st5' - st8st6' - st9st7' - st10st8' - st11st9' - st12st10' - st13st11' - st14st12' - st15op_stack_pointer' - op_stack_pointer + 3RunningProductOpStackTable' - RunningProductOpStackTable·(🪤 - 🍋·clk - 🍊 - 🍉·op_stack_pointer' - 🫒·st15')
·(🪤 - 🍋·clk - 🍊 - 🍉·(op_stack_pointer' + 1) - 🫒·st14')
·(🪤 - 🍋·clk - 🍊 - 🍉·(op_stack_pointer' + 2) - 🫒·st13')
Instruction xx_mul
In addition to its instruction groups, this instruction has the following constraints.
Description
- The coefficient of x^0 of multiplying the two X-Field elements on the stack is moved into
st0. - The coefficient of x^1 of multiplying the two X-Field elements on the stack is moved into
st1. - The coefficient of x^2 of multiplying the two X-Field elements on the stack is moved into
st2. st6is moved intost3.st7is moved intost4.st8is moved intost5.st9is moved intost6.st10is moved intost7.st11is moved intost8.st12is moved intost9.st13is moved intost10.st14is moved intost11.st15is moved intost12.- The op stack pointer shrinks by 3.
- The running product with the Op Stack Table accumulates next row's
st13throughst15.
Polynomials
st0' - (st0·st3 - st2·st4 - st1·st5)st1' - (st1·st3 + st0·st4 - st2·st5 + st2·st4 + st1·st5)st2' - (st2·st3 + st1·st4 + st0·st5 + st2·st5)st3' - st6st4' - st7st5' - st8st6' - st9st7' - st10st8' - st11st9' - st12st10' - st13st11' - st14st12' - st15op_stack_pointer' - op_stack_pointer + 3RunningProductOpStackTable' - RunningProductOpStackTable·(🪤 - 🍋·clk - 🍊 - 🍉·op_stack_pointer' - 🫒·st15')
·(🪤 - 🍋·clk - 🍊 - 🍉·(op_stack_pointer' + 1) - 🫒·st14')
·(🪤 - 🍋·clk - 🍊 - 🍉·(op_stack_pointer' + 2) - 🫒·st13')
Instruction x_invert
In addition to its instruction groups, this instruction has the following constraints.
Description
- The coefficient of x^0 of multiplying X-Field element on top of the current stack and on top of the next stack is 1.
- The coefficient of x^1 of multiplying X-Field element on top of the current stack and on top of the next stack is 0.
- The coefficient of x^2 of multiplying X-Field element on top of the current stack and on top of the next stack is 0.
Polynomials
st0·st0' - st2·st1' - st1·st2' - 1st1·st0' + st0·st1' - st2·st2' + st2·st1' + st1·st2'st2·st0' + st1·st1' + st0·st2' + st2·st2'
Instruction xb_mul
In addition to its instruction groups, this instruction has the following constraints.
Description
- The result of multiplying the top of the stack with the X-Field element's coefficient for x^0 is moved into
st0. - The result of multiplying the top of the stack with the X-Field element's coefficient for x^1 is moved into
st1. - The result of multiplying the top of the stack with the X-Field element's coefficient for x^2 is moved into
st2. st4is moved intost3.st5is moved intost4.st6is moved intost5.st7is moved intost6.st8is moved intost7.st9is moved intost8.st10is moved intost9.st11is moved intost10.st12is moved intost11.st13is moved intost12.st14is moved intost13.st15is moved intost14.- The op stack pointer shrinks by 3.
- The running product with the Op Stack Table accumulates next row's
st15.
Polynomials
st0' - st0·st1st1' - st0·st2st2' - st0·st3st3' - st4st4' - st5st5' - sttst6' - st7st7' - st8st8' - st9st9' - st10st10' - st11st11' - st12st12' - st13st13' - st14st14' - st15op_stack_pointer' - op_stack_pointer + 1RunningProductOpStackTable' - RunningProductOpStackTable·(🪤 - 🍋·clk - 🍊 - 🍉·op_stack_pointer' - 🫒·st15')
Instruction read_io + n
In addition to its instruction groups, this instruction has the following constraints.
Description
- If
nis 1, the running evaluation for standard input accumulates next row'sst0
else ifnis 2, the running evaluation for standard input accumulates next row'sst0andst1
else ifnis 3, the running evaluation for standard input accumulates next row'sst0throughst2
else ifnis 4, the running evaluation for standard input accumulates next row'sst0throughst3
else ifnis 5, the running evaluation for standard input accumulates next row'sst0throughst4.
Polynomials
ind_1(hv3, hv2, hv1, hv0)·(RunningEvaluationStandardInput' - 🛏·RunningEvaluationStandardInput - st0')
+ ind_2(hv3, hv2, hv1, hv0)·(RunningEvaluationStandardInput' - 🛏·(🛏·RunningEvaluationStandardInput - st0') - st1')
+ ind_3(hv3, hv2, hv1, hv0)·(RunningEvaluationStandardInput' - 🛏·(🛏·(🛏·RunningEvaluationStandardInput - st0') - st1') - st2')
+ ind_4(hv3, hv2, hv1, hv0)·(RunningEvaluationStandardInput' - 🛏·(🛏·(🛏·(🛏·RunningEvaluationStandardInput - st0') - st1') - st2') - st3')
+ ind_5(hv3, hv2, hv1, hv0)·(RunningEvaluationStandardInput' - 🛏·(🛏·(🛏·(🛏·(🛏·RunningEvaluationStandardInput - st0') - st1') - st2') - st3') - st4')
Instruction write_io + n
In addition to its instruction groups, this instruction has the following constraints.
Description
- If
nis 1, the running evaluation for standard output accumulatesst0
else ifnis 2, the running evaluation for standard output accumulatesst0andst1
else ifnis 3, the running evaluation for standard output accumulatesst0throughst2
else ifnis 4, the running evaluation for standard output accumulatesst0throughst3
else ifnis 5, the running evaluation for standard output accumulatesst0throughst4.
Polynomials
ind_1(hv3, hv2, hv1, hv0)·(RunningEvaluationStandardOutput' - 🧯·RunningEvaluationStandardOutput - st0)
+ ind_2(hv3, hv2, hv1, hv0)·(RunningEvaluationStandardOutput' - 🧯·(🧯·RunningEvaluationStandardOutput - st0) - st1)
+ ind_3(hv3, hv2, hv1, hv0)·(RunningEvaluationStandardOutput' - 🧯·(🧯·(🧯·RunningEvaluationStandardOutput - st0) - st1) - st2)
+ ind_4(hv3, hv2, hv1, hv0)·(RunningEvaluationStandardOutput' - 🧯·(🧯·(🧯·(🧯·RunningEvaluationStandardOutput - st0) - st1) - st2) - st3)
+ ind_5(hv3, hv2, hv1, hv0)·(RunningEvaluationStandardOutput' - 🧯·(🧯·(🧯·(🧯·(🧯·RunningEvaluationStandardOutput - st0) - st1) - st2) - st3) - st4)
Instruction merkle_step
Recall that in a Merkle tree, the indices of left (respectively right) leaves have 0 (respectively 1) as their least significant bit. This motivates the use of a helper variable to hold that least significant bit.
In addition to its instruction groups, this instruction has the following constraints. The two Evaluation Arguments also used for instruction hash guarantee correct transition of the top of the stack.
Description
- Helper variable
hv5is either 0 or 1. st5is shifted by 1 bit to the right. In other words, twicest5in the next row plushv5equalsst5in the current row.
Helper variable definitions for merkle_step
hv0throughhv4hold the sibling digest of the node indicated byst5, as read from the interface for non-deterministic input.hv5holds the result ofst5 % 2, the Merkle tree node index's least significant bit, indicating whether it is a left or right node.
Instruction merkle_step_mem
In addition to its instruction groups, this instruction has the following constraints.
The two Evaluation Arguments also used for instruction hash guarantee correct transition of the top of the stack.
See also merkle_step.
Description
- Stack element
st6does not change. - Stack element
st7is incremented by 5. - Helper variable
hv5is either 0 or 1. st5is shifted by 1 bit to the right. In other words, twicest5in the next row plushv5equalsst5in the current row.- The running product with the RAM Table accumulates
hv0throughhv4using the (appropriately adjusted) RAM pointer held inst7.
Helper variable definitions for merkle_step_mem
hv0throughhv4hold the sibling digest of the node indicated byst5, as read from RAM at the address held inst7.hv5holds the result ofst5 % 2, the Merkle tree node index's least significant bit, indicating whether it is a left or right node.
Instruction xx_dot_step
In addition to its instruction groups, this instruction has the following constraints.
Description
- Store
(RAM[st0], RAM[st0+1], RAM[st0+2])in(hv0, hv1, hv2). - Store
(RAM[st1], RAM[st1+1], RAM[st1+2])in(hv3, hv4, hv5). - Add
(hv0 + hv1·x + hv2·x²) · (hv3 + hv4·x + hv5·x²)into(st2, st3, st4) - Increase the pointers:
st0andst1by 3 each.
Instruction xb_dot_step
In addition to its instruction groups, this instruction has the following constraints.
Description
- Store
RAM[st0]inhv0. - Store
(RAM[st1], RAM[st1+1], RAM[st1+2])in(hv1, hv2, hv3). - Add
hv0 · (hv1 + hv2·x + hv3·x²)into(st1, st2, st3) - Increase the pointers:
st0andst1by 1 and 3, respectively.