# Custom Lookup Tables in Noir

**URL:** <https://forum.aztec.network/t/custom-lookup-tables-in-noir/417>\
**Category:** Noir\
**Tags:** noir\
**Created:** [May 15, 2023, 1:07am UTC](https://forum.aztec.network/t/custom-lookup-tables-in-noir/417 "2023-05-15T01:07:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jp4g](https://avatars.discourse-cdn.com/v4/letter/j/f19dbf/32.png) [@jp4g](https://forum.aztec.network/u/jp4g)\
**Post date:** [May 15, 2023, 1:07am UTC](https://forum.aztec.network/t/custom-lookup-tables-in-noir/417/1 "2023-05-15T01:07:12Z")

</div>

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:

```auto
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?

---

<div class="post-metadata">

**Author:** ![Savio](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.aztec.network/savio/32/21_2.png) [@Savio](https://forum.aztec.network/u/Savio)\
**Post date:** [May 16, 2023, 7:17am UTC](https://forum.aztec.network/t/custom-lookup-tables-in-noir/417/2 "2023-05-16T07:17:44Z")

</div>

Not at this moment, but we’re working on [RAM and ROM abstrations](https://github.com/noir-lang/noir/pull/1282) that will enable dynamic arrays in Noir to make use of UltraPlonk’s plookup.

Devs can create custom lookup tables using Noir arrays then.

---

<div class="post-metadata">

**Author:** ![Savio](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.aztec.network/savio/32/21_2.png) [@Savio](https://forum.aztec.network/u/Savio)\
**Post date:** [June 15, 2023, 1:54am UTC](https://forum.aztec.network/t/custom-lookup-tables-in-noir/417/3 "2023-06-15T01:54:45Z")

</div>

👆 The PR is now merged!

---

<div class="post-metadata">

**Author:** ![jp4g](https://avatars.discourse-cdn.com/v4/letter/j/f19dbf/32.png) [@jp4g](https://forum.aztec.network/u/jp4g)\
**Post date:** [June 30, 2023, 1:20am UTC](https://forum.aztec.network/t/custom-lookup-tables-in-noir/417/4 "2023-06-30T01:20:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Savio](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.aztec.network/savio/32/21_2.png) [@Savio](https://forum.aztec.network/u/Savio)\
**Post date:** [June 30, 2023, 2:33am UTC](https://forum.aztec.network/t/custom-lookup-tables-in-noir/417/5 "2023-06-30T02:33:09Z")

</div>

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