Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Schaeff committed Oct 24, 2024
1 parent 879a6f5 commit b72ef90
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 6 additions & 6 deletions executor/src/witgen/global_constraints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ use num_traits::Zero;

use powdr_ast::analyzed::{
AlgebraicBinaryOperation, AlgebraicBinaryOperator, AlgebraicExpression as Expression,
AlgebraicReference, LookupIdentity, PermutationIdentity, PolyID, PolynomialType,
AlgebraicReference, LookupIdentity, PermutationIdentity, PhantomLookupIdentity,
PhantomPermutationIdentity, PolyID, PolynomialType,
};

use powdr_number::FieldElement;
Expand Down Expand Up @@ -236,7 +237,9 @@ fn propagate_constraints<T: FieldElement>(
}
}
Identity::Lookup(LookupIdentity { left, right, .. })
| Identity::Permutation(PermutationIdentity { left, right, .. }) => {
| Identity::PhantomLookup(PhantomLookupIdentity { left, right, .. })
| Identity::Permutation(PermutationIdentity { left, right, .. })
| Identity::PhantomPermutation(PhantomPermutationIdentity { left, right, .. }) => {
if left.selector.is_some() || right.selector.is_some() {
return (known_constraints, false);
}
Expand All @@ -253,7 +256,7 @@ fn propagate_constraints<T: FieldElement>(
}
}
if right.expressions.len() == 1 {
// We can only remove the lookup if the RHS is a fixed polynomial that
// We can only remove the lookup or permutation if the RHS is a fixed polynomial that
// provides all values in the span.
if let Some(name) = try_to_simple_poly(&right.expressions[0]) {
if try_to_simple_poly(&left.expressions[0]).is_some()
Expand All @@ -264,9 +267,6 @@ fn propagate_constraints<T: FieldElement>(
}
}
}
Identity::PhantomPermutation(..) | Identity::PhantomLookup(..) => {
// phantom identities do not provide any constraints
}
Identity::Connect(..) => {
// we do not handle connect identities yet, so we do nothing
}
Expand Down
4 changes: 3 additions & 1 deletion executor/src/witgen/machines/machine_extractor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,9 @@ fn refs_in_selected_expressions<T>(sel_expr: &SelectedExpressions<T>) -> HashSet
fn refs_in_identity_left<T>(identity: &Identity<T>) -> HashSet<PolyID> {
match identity {
Identity::Lookup(LookupIdentity { left, .. })
| Identity::Permutation(PermutationIdentity { left, .. }) => {
| Identity::PhantomLookup(PhantomLookupIdentity { left, .. })
| Identity::Permutation(PermutationIdentity { left, .. })
| Identity::PhantomPermutation(PhantomPermutationIdentity { left, .. }) => {
refs_in_selected_expressions(left)
}
Identity::Polynomial(i) => refs_in_expression(&i.expression).collect(),
Expand Down

0 comments on commit b72ef90

Please sign in to comment.