diff --git a/executor/src/witgen/global_constraints.rs b/executor/src/witgen/global_constraints.rs index 745810cd7..c32df2477 100644 --- a/executor/src/witgen/global_constraints.rs +++ b/executor/src/witgen/global_constraints.rs @@ -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; @@ -236,7 +237,9 @@ fn propagate_constraints( } } 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); } @@ -253,7 +256,7 @@ fn propagate_constraints( } } 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() @@ -264,9 +267,6 @@ fn propagate_constraints( } } } - Identity::PhantomPermutation(..) | Identity::PhantomLookup(..) => { - // phantom identities do not provide any constraints - } Identity::Connect(..) => { // we do not handle connect identities yet, so we do nothing } diff --git a/executor/src/witgen/machines/machine_extractor.rs b/executor/src/witgen/machines/machine_extractor.rs index dac58d632..7f5d42984 100644 --- a/executor/src/witgen/machines/machine_extractor.rs +++ b/executor/src/witgen/machines/machine_extractor.rs @@ -349,7 +349,9 @@ fn refs_in_selected_expressions(sel_expr: &SelectedExpressions) -> HashSet fn refs_in_identity_left(identity: &Identity) -> HashSet { 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(),