@@ -61,7 +61,7 @@ pub struct MemcpyIterCols<T> {
61
61
pub shift : [ T ; 2 ] ,
62
62
pub is_valid : T ,
63
63
pub is_valid_not_start : T ,
64
- pub is_shift_non_zero : T ,
64
+ pub is_shift_zero : T ,
65
65
// -1 for the first iteration, 1 for the last iteration, 0 for the middle iterations
66
66
pub is_boundary : T ,
67
67
pub data_1 : [ T ; MEMCPY_LOOP_NUM_LIMBS ] ,
@@ -106,7 +106,7 @@ impl<AB: InteractionBuilder> Air<AB> for MemcpyIterAir {
106
106
} ;
107
107
108
108
let shift = local. shift [ 0 ] * AB :: Expr :: TWO + local. shift [ 1 ] ;
109
- let is_shift_zero = not :: < AB :: Expr > ( local. is_shift_non_zero . clone ( ) ) ;
109
+ let is_shift_non_zero = not :: < AB :: Expr > ( local. is_shift_zero ) ;
110
110
let is_shift_one = and :: < AB :: Expr > ( local. shift [ 0 ] , not :: < AB :: Expr > ( local. shift [ 1 ] ) ) ;
111
111
let is_shift_two = and :: < AB :: Expr > ( not :: < AB :: Expr > ( local. shift [ 0 ] ) , local. shift [ 1 ] ) ;
112
112
let is_shift_three = and :: < AB :: Expr > ( local. shift [ 0 ] , local. shift [ 1 ] ) ;
@@ -141,7 +141,7 @@ impl<AB: InteractionBuilder> Air<AB> for MemcpyIterAir {
141
141
. iter ( )
142
142
. map ( |( prev_data, next_data) | {
143
143
array:: from_fn :: < _ , MEMCPY_LOOP_NUM_LIMBS , _ > ( |i| {
144
- is_shift_zero. clone ( ) * ( next_data[ i] )
144
+ local . is_shift_zero . clone ( ) * ( next_data[ i] )
145
145
+ is_shift_one. clone ( )
146
146
* ( if i < 3 {
147
147
next_data[ i + 1 ]
@@ -167,7 +167,7 @@ impl<AB: InteractionBuilder> Air<AB> for MemcpyIterAir {
167
167
builder. assert_bool ( local. is_valid ) ;
168
168
local. shift . iter ( ) . for_each ( |x| builder. assert_bool ( * x) ) ;
169
169
builder. assert_bool ( local. is_valid_not_start ) ;
170
- builder. assert_bool ( local. is_shift_non_zero ) ;
170
+ builder. assert_bool ( local. is_shift_zero ) ;
171
171
// is_boundary is either -1, 0 or 1
172
172
builder. assert_tern ( local. is_boundary + AB :: Expr :: ONE ) ;
173
173
@@ -178,7 +178,7 @@ impl<AB: InteractionBuilder> Air<AB> for MemcpyIterAir {
178
178
) ;
179
179
180
180
// is_shift_non_zero is correct
181
- builder. assert_eq ( local. is_shift_non_zero , or :: < AB :: Expr > ( local. shift [ 0 ] , local. shift [ 1 ] ) ) ;
181
+ builder. assert_eq ( local. is_shift_zero , not :: < AB :: Expr > ( or :: < AB :: Expr > ( local. shift [ 0 ] , local. shift [ 1 ] ) ) ) ;
182
182
183
183
// if !is_valid, then is_boundary = 0, shift = 0 (we will use this assumption later)
184
184
let mut is_not_valid_when = builder. when ( not :: < AB :: Expr > ( local. is_valid ) ) ;
@@ -205,7 +205,7 @@ impl<AB: InteractionBuilder> Air<AB> for MemcpyIterAir {
205
205
// since is_shift_non_zero degree is 2, we need to keep the degree of the condition to 1
206
206
builder
207
207
. when ( not :: < AB :: Expr > ( prev. is_valid_not_start ) - not :: < AB :: Expr > ( prev. is_valid ) )
208
- . assert_eq ( local. timestamp , prev. timestamp + local . is_shift_non_zero . clone ( ) ) ;
208
+ . assert_eq ( local. timestamp , prev. timestamp + is_shift_non_zero. clone ( ) ) ;
209
209
210
210
// if prev.is_valid_not_start and local.is_valid_not_start, then timestamp=prev_timestamp+8
211
211
// prev.is_valid_not_start is the opposite of previous condition
@@ -247,7 +247,7 @@ impl<AB: InteractionBuilder> Air<AB> for MemcpyIterAir {
247
247
. enumerate ( )
248
248
. for_each ( |( idx, ( data, read_aux) ) | {
249
249
let is_valid_read = if idx == 3 {
250
- or :: < AB :: Expr > ( local . is_shift_non_zero . clone ( ) , local. is_valid_not_start )
250
+ or :: < AB :: Expr > ( is_shift_non_zero. clone ( ) , local. is_valid_not_start )
251
251
} else {
252
252
local. is_valid_not_start . into ( )
253
253
} ;
@@ -694,7 +694,7 @@ impl<F: PrimeField32> TraceFiller<F> for MemcpyIterFiller {
694
694
} else {
695
695
F :: ZERO
696
696
} ;
697
- cols. is_shift_non_zero = F :: from_canonical_u8 ( ( record. inner . shift ! = 0 ) as u8 ) ;
697
+ cols. is_shift_zero = F :: from_canonical_u8 ( ( record. inner . shift = = 0 ) as u8 ) ;
698
698
cols. is_valid_not_start = F :: from_canonical_u8 ( 1 - is_start as u8 ) ;
699
699
cols. is_valid = F :: ONE ;
700
700
cols. shift = [ record. inner . shift & 1 , record. inner . shift >> 1 ]
0 commit comments