Skip to content

Commit

Permalink
Merge branch 'avm' into md/codegen-public-input-cols
Browse files Browse the repository at this point in the history
  • Loading branch information
Maddiaa0 committed May 13, 2024
2 parents a5e529b + 0cab75e commit f4dd8b8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 33 deletions.
2 changes: 1 addition & 1 deletion asm_to_pil/src/vm_to_constrained.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,7 @@ fn witness_column<S: Into<String>, T>(
start: usize,
name: S,
def: Option<FunctionDefinition<T>>,
is_public: bool,
is_public: bool
) -> PilStatement<T> {
PilStatement::PolynomialCommitDeclaration(
start,
Expand Down
7 changes: 1 addition & 6 deletions ast/src/parsed/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,7 @@ pub enum PilStatement<T> {
),
PolynomialConstantDeclaration(usize, Vec<PolynomialName<T>>),
PolynomialConstantDefinition(usize, String, FunctionDefinition<T>),
PolynomialCommitDeclaration(
usize,
Vec<PolynomialName<T>>,
Option<FunctionDefinition<T>>,
/*public=*/ bool,
),
PolynomialCommitDeclaration(usize, Vec<PolynomialName<T>>, Option<FunctionDefinition<T>>, /*public=*/ bool),
PolynomialIdentity(usize, Option<String>, Expression<T>),
PlookupIdentity(
usize,
Expand Down
36 changes: 10 additions & 26 deletions pil_analyzer/src/statement_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,9 @@ where
PilStatement::PublicDeclaration(start, name, polynomial, array_index, index) => {
self.handle_public_declaration(start, name, polynomial, array_index, index)
}
PilStatement::PolynomialConstantDeclaration(start, polynomials) => self
.handle_polynomial_declarations(
start,
polynomials,
PolynomialType::Constant,
false,
),
PilStatement::PolynomialConstantDeclaration(start, polynomials) => {
self.handle_polynomial_declarations(start, polynomials, PolynomialType::Constant, false)
}
PilStatement::PolynomialConstantDefinition(start, name, definition) => self
.handle_symbol_definition(
start,
Expand All @@ -124,19 +120,10 @@ where
SymbolKind::Poly(PolynomialType::Constant),
Some(definition),
),
PilStatement::PolynomialCommitDeclaration(start, polynomials, None, is_public) => self
.handle_polynomial_declarations(
start,
polynomials,
PolynomialType::Committed,
is_public,
),
PilStatement::PolynomialCommitDeclaration(
start,
mut polynomials,
Some(definition),
_,
) => {
PilStatement::PolynomialCommitDeclaration(start, polynomials, None, is_public) => {
self.handle_polynomial_declarations(start, polynomials, PolynomialType::Committed, is_public)
}
PilStatement::PolynomialCommitDeclaration(start, mut polynomials, Some(definition), _) => {
assert!(polynomials.len() == 1);
let name = polynomials.pop().unwrap();
self.handle_symbol_definition(
Expand Down Expand Up @@ -285,12 +272,9 @@ where
polynomials
.into_iter()
.flat_map(|PolynomialName { name, array_size }| {
// TODO: hack: add an is_public modifier to the end of a commited polynomial????
let name = if is_public {
format!("{name}__is_public")
} else {
name
};

// hack(https://github.com/AztecProtocol/aztec-packages/issues/6359): add an is_public modifier to the end of a committed polynomial
let name = if is_public { format!("{name}__is_public")} else {name};

self.handle_symbol_definition(
start,
Expand Down

0 comments on commit f4dd8b8

Please sign in to comment.