diff --git a/src/iop/generator.rs b/src/iop/generator.rs index a64afed6..eb2c95f7 100644 --- a/src/iop/generator.rs +++ b/src/iop/generator.rs @@ -62,7 +62,7 @@ pub(crate) fn generate_partial_witness<'a, F: RichField + Extendable, const D let new_target_reps = buffer .target_values .drain(..) - .flat_map(|(t, v)| witness.set_target_returning_parent(t, v)); + .flat_map(|(t, v)| witness.set_target_returning_rep(t, v)); // Enqueue unfinished generators that were watching one of the newly populated targets. for watch in new_target_reps { diff --git a/src/iop/witness.rs b/src/iop/witness.rs index 13d1fa2c..858bacd9 100644 --- a/src/iop/witness.rs +++ b/src/iop/witness.rs @@ -212,14 +212,10 @@ impl<'a, F: Field> PartitionWitness<'a, F> { /// Set a `Target`. On success, returns the representative index of the newly-set target. If the /// target was already set, returns `None`. - pub(crate) fn set_target_returning_parent( - &mut self, - target: Target, - value: F, - ) -> Option { - let parent_index = self.representative_map[self.target_index(target)]; - let parent_value = &mut self.values[parent_index]; - if let Some(old_value) = *parent_value { + pub(crate) fn set_target_returning_rep(&mut self, target: Target, value: F) -> Option { + let rep_index = self.representative_map[self.target_index(target)]; + let rep_value = &mut self.values[rep_index]; + if let Some(old_value) = *rep_value { assert_eq!( value, old_value, "Partition containing {:?} was set twice with different values", @@ -227,8 +223,8 @@ impl<'a, F: Field> PartitionWitness<'a, F> { ); None } else { - *parent_value = Some(value); - Some(parent_index) + *rep_value = Some(value); + Some(rep_index) } } @@ -253,11 +249,11 @@ impl<'a, F: Field> PartitionWitness<'a, F> { impl<'a, F: Field> Witness for PartitionWitness<'a, F> { fn try_get_target(&self, target: Target) -> Option { - let parent_index = self.representative_map[self.target_index(target)]; - self.values[parent_index] + let rep_index = self.representative_map[self.target_index(target)]; + self.values[rep_index] } fn set_target(&mut self, target: Target, value: F) { - self.set_target_returning_parent(target, value); + self.set_target_returning_rep(target, value); } } diff --git a/src/plonk/permutation_argument.rs b/src/plonk/permutation_argument.rs index acf3686c..ee9474d7 100644 --- a/src/plonk/permutation_argument.rs +++ b/src/plonk/permutation_argument.rs @@ -76,6 +76,7 @@ impl Forest { } } + /// Assumes `compress_paths` has already been called. pub fn wire_partition(&mut self) -> WirePartition { let mut partition = HashMap::<_, Vec<_>>::new();