Custom Lookup Tables in Noir

Does Noir support custom lookup tables?

For context, take the toy battleship game as an example. Each ship placement requires range constraints and constrains the computation of the binary sequence representing a single ship. However, we know that there are 600 possible 100-bit numbers representing a valid placement:

length 5: 6 x 10 x 2 = 120
length 4: 7 x 10 x 2 = 140
length 3: 8 x 10 x 2 = 160
length 2: 9 x 10 x 2 = 180
Sum: 600

Instead of computing whether or not a given placement conforms to our rules, we could instead perform a lookup of length → binary sequence to see if a placement is valid, considerably reducing constraints used. Is this feature available in Noir compiling to UltraPlonk?

61 Likes

Not at this moment, but we’re working on RAM and ROM abstrations that will enable dynamic arrays in Noir to make use of UltraPlonk’s plookup.

Devs can create custom lookup tables using Noir arrays then.

63 Likes

:point_up_2: The PR is now merged!

67 Likes

Is it possible to make these arrays fixed / constant? Or are they only advice supplied by the prover?

76 Likes

Not sure if I understand your question :thinking: Arrays are fixed by default unless you define them with mut?

69 Likes