Skip to main content

Plookup\plookup

Plookup\plookup allows us to check if witness values belong to a look up table. This is usually useful for reducing the number of constraints needed for bit-wise operations. So in the rest of this document we'll use the XOR table as an example.

ABY
000
011
101
110

First, let's define some terms:

  • lookup table: a table of values that means something, like the XOR table above
  • joint lookup table: a table where cols have been joined together in a single col (with a challenge)
  • table entry: a cell in a joint lookup table
  • single lookup value: a value we're trying to look up in a table
  • joint lookup values: several values that have been joined together (with a challenge)

A joint lookup table looks like this, for some challenge α\alpha:

joint lookup table

Constraints

Computes the aggregation polynomial for maximum nn lookups per row, whose kk-th entry is the product of terms:

(γ(1+β)+ti+βti+1)j=0n((1+β)(γ+fi,j))j=0n+1(γ(1+β)+si,j+βsi+1,j)\frac{(\gamma(1 + \beta) + t_i + \beta t_{i+1}) \prod_{j=0}^n ( (1 + \beta) (\gamma + f_{i,j}) )}{\prod_{j=0}^{n+1} (\gamma(1 + \beta) + s_{i,j} + \beta s_{i+1,j})}

for i<ki < k.

  • tit_i is the ii-th entry in the table
  • fi,jf_{i, j} is the jj-th lookup in the ii-th row of the witness

For every instance of a value in tit_i and fi,jf_{i,j}, there is an instance of the same value in si,js_{i,j}

si,js_{i,j} is sorted in the same order as tit_i, increasing along the 'snake-shape'

Whenever the same value is in si,js_{i,j} and si+1,js_{i+1,j}, that term in the denominator product becomes

(1+β)(γ+si,j)(1 + \beta) (\gamma + s_{i,j})

this will cancel with the corresponding looked-up value in the witness

(1+β)(γ+fi,j)(1 + \beta) (\gamma + f_{i,j})

Whenever the values si,js_{i,j} and si+1,js_{i+1,j} differ, that term in the denominator product will cancel with some matching

(γ(1+β)+ti+βti+1)(\gamma(1 + \beta) + t_{i'} + \beta t_{i'+1})

because the sorting is the same in ss and tt.

There will be exactly the same number of these as the number of values in tt if ff only contains values from tt. After multiplying all of the values, all of the terms will have cancelled if ss is a sorting of ff and tt, and the final term will be 11 because of the random choice of β\beta and γ\gamma, there is negligible probability that the terms will cancel if ss is not a sorting of ff and tt

But because of the snakify:

  • we are repeating an element between cols, we need to check that it's the same in a constraint
  • we invert the direction, but that shouldn't matter

FAQ

  • how do we do multiple lookups per row?
  • how do we dismiss rows where there are no lookup?