forked from visoftsolutions/noir_rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: pil lookups w/ xor table example (AztecProtocol#3880)
depends on : https://github.com/AztecProtocol/powdr/pull/37/files Lookups allow us to assert that values in a set of columns equal some values in another set of columns. This approach uses the log derivative method to perform lookups, where the lookup relation requires four extra columns ( as well as the read and write columns ) to function. - One selector column to initiate adding a value into the READ side of the lookup table ( lhs in pil ) - One selector column to initiate adding a value into the WRITE side of the lookup table ( rhs in pil ) - { adding to the table } - One selector column to compute inverses - ( helper column ) - One column to store the number of times a WRITE term is read - ( helper column ) The selector columns will need to be defined manually - as in the `ToyAvm` example. The inverse column and the counts columns are automatically included by the code gen. ( this means there are two extra columns per lookup ( which is a little bit inefficient; but will do for now ). The name of the inverse column is decided by the attribute tag `#[attribute]` above the lookup - which is required. The name of the counts column is `${attribute}_counts`. Note: that in the circuit builder you are currently required to set the counts column value manually. syntax: ```pil #[lookup_xor] // attribute q_xor { xor_a, xor_b, xor_c } in q_xor_table { table_xor_a, table_xor_b, table_xor_c }; // lhs selector, lhs columns // rhs selector, rhs columns ``` closes: AztecProtocol#2995 Co-authored-by: Rumata888 <[email protected]> --------- Co-authored-by: Jean M <[email protected]>
- Loading branch information
Showing
16 changed files
with
984 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.