Skip to content

Commit bb53982

Browse files
authored
Merge pull request #3 from scroll-tech/feat/double-range-check
Add two structural witin types to support double range check
2 parents 3bb5e60 + 1e27159 commit bb53982

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

crates/multilinear_extensions/src/expression.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,6 +1032,14 @@ pub enum StructuralWitInType {
10321032
/// The corresponding evaluation vector is the sequence: [0, 0] + [1, 1] + [2] * 4 + [3] * 8 + ... + [max_value] * (2^max_value)
10331033
/// The length of the vectors is 2^(max_value + 1)
10341034
StackedConstantSequence { max_value: usize },
1035+
/// The corresponding evaluation vector is the sequence: [0, ..., 0, 1, ..., 1, ..., 2^(n-k-1)-1, ..., 2^(n-k-1)-1]
1036+
/// where each element is repeated by 2^k times
1037+
/// The total length of the vector is 2^n
1038+
InnerRepeatingIncrementalSequence { k: usize, n: usize },
1039+
/// The corresponding evaluation vector is the sequence: [0, ..., 2^k-1]
1040+
/// repeated by 2^(n-k) times
1041+
/// The total length of the vector is 2^n
1042+
OuterRepeatingIncrementalSequence { k: usize, n: usize },
10351043
}
10361044

10371045
impl StructuralWitInType {
@@ -1040,6 +1048,8 @@ impl StructuralWitInType {
10401048
StructuralWitInType::EqualDistanceSequence { max_len, .. } => *max_len,
10411049
StructuralWitInType::StackedIncrementalSequence { max_bits } => 1 << (max_bits + 1),
10421050
StructuralWitInType::StackedConstantSequence { max_value } => 1 << (max_value + 1),
1051+
StructuralWitInType::InnerRepeatingIncrementalSequence { n, .. } => 1 << n,
1052+
StructuralWitInType::OuterRepeatingIncrementalSequence { n, .. } => 1 << n,
10431053
}
10441054
}
10451055
}

0 commit comments

Comments
 (0)