addressed comments

This commit is contained in:
Nicholas Ward 2022-06-16 23:37:51 -07:00
parent 939e63189b
commit 0514cd9646
2 changed files with 9 additions and 19 deletions

View File

@ -163,7 +163,6 @@ const NUM_MEMORY_VALUE_LIMBS: usize = 8;
pub(crate) const CLOCK: usize = SIMPLE_LOGIC_DIFF_INV + 1;
const USES_MEMOP_START: usize = CLOCK + 1;
pub const fn uses_memop(op: usize) -> usize {
debug_assert!(op < NUM_MEMORY_OPS);

View File

@ -124,25 +124,16 @@ pub fn generate_first_change_flags<F: RichField>(
let mut segment_first_change = Vec::new();
let mut virtual_first_change = Vec::new();
for idx in 0..num_ops - 1 {
let this_context_first_change = if context[idx] != context[idx + 1] {
F::ONE
} else {
F::ZERO
};
let this_segment_first_change = if segment[idx] != segment[idx + 1] {
F::ONE * (F::ONE - this_context_first_change)
} else {
F::ZERO
};
let this_virtual_first_change = if virtuals[idx] != virtuals[idx + 1] {
F::ONE * (F::ONE - this_context_first_change) * (F::ONE - this_segment_first_change)
} else {
F::ZERO
};
let this_context_first_change = context[idx] != context[idx + 1];
let this_segment_first_change =
segment[idx] != segment[idx + 1] && !this_context_first_change;
let this_virtual_first_change = virtuals[idx] != virtuals[idx + 1]
&& !this_segment_first_change
&& !this_context_first_change;
context_first_change.push(this_context_first_change);
segment_first_change.push(this_segment_first_change);
virtual_first_change.push(this_virtual_first_change);
context_first_change.push(F::from_bool(this_context_first_change));
segment_first_change.push(F::from_bool(this_segment_first_change));
virtual_first_change.push(F::from_bool(this_virtual_first_change));
}
context_first_change.push(F::ZERO);