From 73f24a32b9be36104a5bd691963b8911de1269a6 Mon Sep 17 00:00:00 2001 From: Tom French <15848336+TomAFrench@users.noreply.github.com> Date: Tue, 26 Mar 2024 19:41:31 +0000 Subject: [PATCH] chore: delete `R1CSTransformer` (#4649) # Description ## Problem\* Resolves ## Summary\* The R1CS transformer is currently a no-op as the expression width is unbounded and we guarantee that expressions will be at most degree 2 by default. It also looks increasingly likely that the CSAT transformer code will be moved into the acir_gen pass so this is redundant. ## Additional Context ## Documentation\* Check one: - [x] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[For Experimental Features]** Documentation to be submitted in a separate PR. # PR Checklist\* - [x] I have tested the changes locally. - [x] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings. --- acvm-repo/acvm/src/compiler/transformers/mod.rs | 5 +---- acvm-repo/acvm/src/compiler/transformers/r1cs.rs | 16 ---------------- 2 files changed, 1 insertion(+), 20 deletions(-) delete mode 100644 acvm-repo/acvm/src/compiler/transformers/r1cs.rs diff --git a/acvm-repo/acvm/src/compiler/transformers/mod.rs b/acvm-repo/acvm/src/compiler/transformers/mod.rs index 2e549854521..18f49c154f1 100644 --- a/acvm-repo/acvm/src/compiler/transformers/mod.rs +++ b/acvm-repo/acvm/src/compiler/transformers/mod.rs @@ -6,10 +6,8 @@ use acir::{ use indexmap::IndexMap; mod csat; -mod r1cs; pub(crate) use csat::CSatTransformer; -pub(crate) use r1cs::R1CSTransformer; use super::{transform_assert_messages, AcirTransformationMap}; @@ -43,8 +41,7 @@ pub(super) fn transform_internal( ) -> (Circuit, Vec) { let mut transformer = match &expression_width { ExpressionWidth::Unbounded => { - let transformer = R1CSTransformer::new(acir); - return (transformer.transform(), acir_opcode_positions); + return (acir, acir_opcode_positions); } ExpressionWidth::Bounded { width } => { let mut csat = CSatTransformer::new(*width); diff --git a/acvm-repo/acvm/src/compiler/transformers/r1cs.rs b/acvm-repo/acvm/src/compiler/transformers/r1cs.rs deleted file mode 100644 index 3bdd29c9c53..00000000000 --- a/acvm-repo/acvm/src/compiler/transformers/r1cs.rs +++ /dev/null @@ -1,16 +0,0 @@ -use acir::circuit::Circuit; - -/// Currently a "noop" transformer. -pub(crate) struct R1CSTransformer { - acir: Circuit, -} - -impl R1CSTransformer { - pub(crate) fn new(acir: Circuit) -> Self { - Self { acir } - } - // TODO: We could possibly make sure that all polynomials are at most degree-2 - pub(crate) fn transform(self) -> Circuit { - self.acir - } -}