Skip to content

Commit

Permalink
Merge pull request ProvableHQ#2227 from tudorpintea999/fix-typos
Browse files Browse the repository at this point in the history
fix: several typos in the documentation
  • Loading branch information
howardwu authored Dec 3, 2023
2 parents dd284d7 + 506be08 commit c845d63
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion algorithms/cuda/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fn main() {
// account for cross-compilation [by examining environment variable]
let target_arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap();

// Set CC environment variable to choose alternative C compiler.
// Set CC environment variable to choose an alternative C compiler.
// Optimization level depends on whether or not --release is passed
// or implied.
let mut cc = cc::Build::new();
Expand Down
2 changes: 1 addition & 1 deletion algorithms/cuda/cuda/polynomial.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public:
size_t pcur = 0;
size_t ecur = 0;

// Set up the first polynomail / evaluation in dmem0
// Set up the first polynomial / evaluation in dmem0
if (pcount > 0) {
mul_copy_poly(hmem0, dmem0, polynomials[0], plens[0], stream, lg_domain_size);
// Perform NTT on the input data
Expand Down
2 changes: 1 addition & 1 deletion algorithms/src/crypto_hash/poseidon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl<F: PrimeField, const RATE: usize, const CAPACITY: usize> State<F, RATE, CAP
self.capacity_state.iter().chain(self.rate_state.iter())
}

/// Returns an mutable iterator over the state.
/// Returns a mutable iterator over the state.
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut F> {
self.capacity_state.iter_mut().chain(self.rate_state.iter_mut())
}
Expand Down
4 changes: 2 additions & 2 deletions algorithms/src/fft/polynomial/dense.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl<F: Field> DensePolynomial<F> {
while let Some(true) = coeffs.last().map(|c| c.is_zero()) {
coeffs.pop();
}
// Check that either the coefficients vec is empty or that the last coeff is non-zero.
// Check that either the coefficients vec are empty or that the last coeff is non-zero.
assert!(coeffs.last().map_or(true, |coeff| !coeff.is_zero()));

Self { coeffs }
Expand Down Expand Up @@ -700,7 +700,7 @@ mod tests {
multiplier.add_polynomial(a.clone(), "a");
assert_eq!(multiplier.multiply().unwrap(), a);

// Note PolyMultiplier doesn't support a evaluations with no polynomials
// Note PolyMultiplier doesn't support evaluations with no polynomials
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion algorithms/src/fft/polynomial/sparse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ impl<F: Field> SparsePolynomial<F> {
total
}

/// Perform a naive n^2 multiplicatoin of `self` by `other`.
/// Perform a naive n^2 multiplication of `self` by `other`.
pub fn mul(&self, other: &Self) -> Self {
if self.is_zero() || other.is_zero() {
SparsePolynomial::zero()
Expand Down
4 changes: 2 additions & 2 deletions algorithms/src/msm/variable_base/batched.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl PartialOrd for BucketPosition {
}
}

/// Returns a batch size of sufficient size to amortise the cost of an inversion,
/// Returns a batch size of sufficient size to amortize the cost of an inversion,
/// while attempting to reduce strain to the CPU cache.
#[inline]
const fn batch_size(msm_size: usize) -> usize {
Expand All @@ -57,7 +57,7 @@ const fn batch_size(msm_size: usize) -> usize {
// L1 and L2 cache sizes and dividing them by the size of group elements (i.e. 96 bytes).
//
// As the algorithm itself requires caching additional values beyond the group elements,
// the ideal batch size is less than expectations, to accommodate those values.
// the ideal batch size is less than expected, to accommodate those values.
// In general, it was found that undershooting is better than overshooting this heuristic.
if cfg!(target_arch = "x86_64") && msm_size < 500_000 {
// Assumes an L1 cache size of 32KiB. Note that larger cache sizes
Expand Down
2 changes: 1 addition & 1 deletion algorithms/src/polycommit/sonic_pc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ impl<E: PairingEngine, S: AlgebraicSponge<E::Fq, 2>> SonicKZG10<E, S> {
Ok((ck, vk))
}

/// Outputs a commitments to `polynomials`.
/// Outputs commitments to `polynomials`.
///
/// If `polynomials[i].is_hiding()`, then the `i`-th commitment is hiding
/// up to `polynomials.hiding_bound()` queries.
Expand Down
2 changes: 1 addition & 1 deletion algorithms/src/r1cs/constraint_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub trait ConstraintSynthesizer<F: Field>: Sync {
}

/// Represents a constraint system which can have new variables
/// allocated and constrains between them formed.
/// allocated and constraints between them formed.
pub trait ConstraintSystem<F: Field>: Sized {
/// Represents the type of the "root" of this constraint system
/// so that nested namespaces can minimize indirection.
Expand Down
4 changes: 2 additions & 2 deletions algorithms/src/r1cs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ impl Variable {
/// Represents the index of either a public variable (input) or a private variable (auxiliary).
#[derive(Copy, Clone, PartialEq, Debug, Eq, Hash)]
pub enum Index {
/// Index of an public variable.
/// Index of a public variable.
Public(usize),
/// Index of an private variable.
/// Index of a private variable.
Private(usize),
}

Expand Down
2 changes: 1 addition & 1 deletion algorithms/src/snark/varuna/ahp/ahp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ impl<F: PrimeField, SM: SNARKMode> AHPForR1CS<F, SM> {
/// Public input should be unformatted.
/// We construct the linear combinations as per section 5 of our protocol documentation.
/// We can distinguish between:
/// (1) simple comitments: $\{\cm{g_A}, \cm{g_B}, \cm{g_C}\}$ and $\{\cm{\hat{z}_{B,i,j}}\}_{i \in {[\mathcal{D}]}}$, $\cm{g_1}$
/// (1) simple commitments: $\{\cm{g_A}, \cm{g_B}, \cm{g_C}\}$ and $\{\cm{\hat{z}_{B,i,j}}\}_{i \in {[\mathcal{D}]}}$, $\cm{g_1}$
/// (2) virtual commitments for the lincheck_sumcheck and matrix_sumcheck. These are linear combinations of the simple commitments
#[allow(non_snake_case)]
pub fn construct_linear_combinations<E: EvaluationsProvider<F>>(
Expand Down
4 changes: 2 additions & 2 deletions utilities/src/biginteger/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ pub trait BigInteger:
/// Returns true iff this number is odd.
fn is_odd(&self) -> bool;

/// Returns true iff this number is even.
/// Returns true if this number is even.
fn is_even(&self) -> bool;

/// Returns true iff this number is zero.
/// Returns true if this number is zero.
fn is_zero(&self) -> bool;

/// Compute the number of bits needed to encode this number. Always a
Expand Down

0 comments on commit c845d63

Please sign in to comment.