Skip to content

Commit

Permalink
Use expression_for_poly_id.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriseth committed Oct 30, 2023
1 parent 0f35173 commit 5ddf05c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions executor/src/witgen/global_constraints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,9 @@ fn propagate_constraints<T: FieldElement>(
.is_none());
remove = true;
} else {
for (p, c) in try_transfer_constraints(
identity.left.selector.as_ref().unwrap(),
&known_constraints,
) {
for (p, c) in
try_transfer_constraints(identity.expression_for_poly_id(), &known_constraints)
{
known_constraints
.entry(p)
.and_modify(|existing| *existing = existing.conjunction(&c))
Expand Down
4 changes: 2 additions & 2 deletions pilopt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ fn remove_constant_witness_columns<T: FieldElement>(pil_file: &mut Analyzed<T>)
.identities
.iter()
.filter_map(|id| (id.kind == IdentityKind::Polynomial).then(|| id.expression_for_poly_id()))
.filter_map(|expr| constrained_to_constant(expr))
.filter_map(constrained_to_constant)
.collect::<BTreeMap<PolyID, _>>();

substitute_polynomial_references(pil_file, &constant_polys);
Expand Down Expand Up @@ -323,7 +323,7 @@ fn remove_trivial_identities<T: FieldElement>(pil_file: &mut Analyzed<T>) {
.enumerate()
.filter_map(|(index, identity)| match identity.kind {
IdentityKind::Polynomial => {
if let AlgebraicExpression::Number(n) = identity.left.selector.as_ref().unwrap() {
if let AlgebraicExpression::Number(n) = identity.expression_for_poly_id() {
if *n == 0.into() {
return Some(index);
}
Expand Down

0 comments on commit 5ddf05c

Please sign in to comment.