-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not treat constants specially during parsing. #647
Conversation
4937a78
to
0bbac00
Compare
halo2/src/circuit_builder.rs
Outdated
@@ -38,7 +39,8 @@ pub(crate) fn analyzed_to_circuit<T: FieldElement>( | |||
|
|||
let query = |column, rotation| Expr::Var(PlonkVar::Query(ColumnQuery { column, rotation })); | |||
|
|||
let mut cd = CircuitData::from(fixed.to_owned(), witness, &analyzed.constants); | |||
let constants = compute_constants(analyzed); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TOOD: use optimize_mildly instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I'll have to look at it again after a good night of sleep!
ast/src/analyzed/mod.rs
Outdated
} | ||
}); | ||
self.definitions | ||
.retain(|name, (poly, _def)| match poly.kind { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the poly
variables should be renamed to symbol
? Also in the rest of the file.
ast/src/analyzed/mod.rs
Outdated
pub enum SymbolKind { | ||
/// Fixed, witness or intermediate polynomial | ||
Poly(PolynomialType), | ||
/// A constant value. | ||
Constant(), | ||
/// Other symbol, could be a constant, depends on the type. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Other symbol, could be a constant, depends on the type. | |
/// Other symbol |
Can't be a constant anymore, right?
I think it would also be nice to list some examples of what it could be. I think array of numbers or lambda functions?
2a1b9d4
to
e48d5fc
Compare
e48d5fc
to
7ff4bd6
Compare
e70c51b
to
f433b1e
Compare
Ok I think this is almost ready. |
c2eef6b
to
ee0781a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just went through again, it's a lot clearer to me now!
@@ -49,6 +46,14 @@ impl<T: Display> Display for Analyzed<T> { | |||
writeln!(f, ";")? | |||
} | |||
} | |||
SymbolKind::Constant() => { | |||
let indentation = if is_local { " " } else { "" }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
ee0781a
to
5d080ed
Compare
5d080ed
to
764ef2d
Compare
No description provided.