From ce62440cbb6f0c70026a36b8d5d114e06314dbf2 Mon Sep 17 00:00:00 2001 From: Pratyush Mishra Date: Fri, 23 Apr 2021 10:45:45 -0700 Subject: [PATCH] Work --- relations/src/r1cs/constraint_system.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/relations/src/r1cs/constraint_system.rs b/relations/src/r1cs/constraint_system.rs index e35a3b0d4..53bf7bae0 100644 --- a/relations/src/r1cs/constraint_system.rs +++ b/relations/src/r1cs/constraint_system.rs @@ -298,7 +298,7 @@ impl ConstraintSystem { } } self.num_constraints += 1; - + Ok(()) } @@ -541,11 +541,15 @@ impl ConstraintSystem { /// Optimize the constraint system (either by outlining or inlining, /// if an optimization goal is set). pub fn optimize(&mut self) { - match self.optimization_goal { - OptimizationGoal::None => self.inline_all_lcs(), - OptimizationGoal::Constraints => self.inline_all_lcs(), - OptimizationGoal::Weight => self.outline_lcs(), - }; + // In verify mode we don't have any linear combinations; all variables + // are instance variables, and there are no generated constraints + if !self.is_in_verify_mode() { + match self.optimization_goal { + OptimizationGoal::None => self.inline_all_lcs(), + OptimizationGoal::Constraints => self.inline_all_lcs(), + OptimizationGoal::Weight => self.outline_lcs(), + }; + } } /// This step must be called after constraint generation has completed, and