From efb73ef325b6c912df22aa179b8bdeaf374a3471 Mon Sep 17 00:00:00 2001 From: porcuquine Date: Wed, 13 Oct 2021 13:43:01 -0700 Subject: [PATCH] Rename Prover and ProvingAssignment. --- src/bellperson/mod.rs | 2 +- src/bellperson/r1cs.rs | 10 +++++----- src/bellperson/{prover.rs => solver.rs} | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) rename src/bellperson/{prover.rs => solver.rs} (94%) diff --git a/src/bellperson/mod.rs b/src/bellperson/mod.rs index 73f248d..12da92f 100644 --- a/src/bellperson/mod.rs +++ b/src/bellperson/mod.rs @@ -2,6 +2,6 @@ //! //! [Bellperson]: https://github.com/filecoin-project/bellperson -pub mod prover; pub mod r1cs; pub mod shape_cs; +pub mod solver; diff --git a/src/bellperson/r1cs.rs b/src/bellperson/r1cs.rs index fb0d3ee..eabf04b 100644 --- a/src/bellperson/r1cs.rs +++ b/src/bellperson/r1cs.rs @@ -2,8 +2,8 @@ #![allow(non_snake_case)] -use super::prover::ProvingAssignment; use super::shape_cs::ShapeCS; +use super::solver::SatisfyingAssignment; use bellperson::{Index, LinearCombination}; use ff::PrimeField; @@ -16,7 +16,7 @@ use crate::{ /// `NovaWitness` provide a method for acquiring an `R1CSInstance` and `R1CSWitness` from implementers. pub trait NovaWitness { - /// Return an instance and witness, given a shape and gens. + /// Return an instance and witness, given a shape and gens. fn r1cs_instance_and_witness( &self, shape: &R1CSShape, @@ -26,13 +26,13 @@ pub trait NovaWitness { /// `NovaShape` provides methods for acquiring `R1CSShape` and `R1CSGens` from implementers. pub trait NovaShape { - /// Return an appropriate `R1CSShape` struct. + /// Return an appropriate `R1CSShape` struct. fn r1cs_shape(&self) -> R1CSShape; - /// Return an appropriate `R1CSGens` struct. + /// Return an appropriate `R1CSGens` struct. fn r1cs_gens(&self) -> R1CSGens; } -impl NovaWitness for ProvingAssignment +impl NovaWitness for SatisfyingAssignment where G::Scalar: PrimeField, { diff --git a/src/bellperson/prover.rs b/src/bellperson/solver.rs similarity index 94% rename from src/bellperson/prover.rs rename to src/bellperson/solver.rs index 3f79835..d1899d0 100644 --- a/src/bellperson/prover.rs +++ b/src/bellperson/solver.rs @@ -8,7 +8,7 @@ use bellperson::{ }; /// A `ConstraintSystem` which calculates witness values for a concrete instance of an R1CS circuit. -pub struct ProvingAssignment +pub struct SatisfyingAssignment where G::Scalar: PrimeField, { @@ -28,13 +28,13 @@ where } use std::fmt; -impl fmt::Debug for ProvingAssignment +impl fmt::Debug for SatisfyingAssignment where G::Scalar: PrimeField, { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt - .debug_struct("ProvingAssignment") + .debug_struct("SatisfyingAssignment") .field("a_aux_density", &self.a_aux_density) .field("b_input_density", &self.b_input_density) .field("b_aux_density", &self.b_aux_density) @@ -68,11 +68,11 @@ where } } -impl PartialEq for ProvingAssignment +impl PartialEq for SatisfyingAssignment where G::Scalar: PrimeField, { - fn eq(&self, other: &ProvingAssignment) -> bool { + fn eq(&self, other: &SatisfyingAssignment) -> bool { self.a_aux_density == other.a_aux_density && self.b_input_density == other.b_input_density && self.b_aux_density == other.b_aux_density @@ -84,7 +84,7 @@ where } } -impl ConstraintSystem for ProvingAssignment +impl ConstraintSystem for SatisfyingAssignment where G::Scalar: PrimeField, {