From 0ae405770a195782941b2f500a2e39426a5ff71e Mon Sep 17 00:00:00 2001 From: Polina Chernyshova Date: Mon, 27 Mar 2023 09:02:34 +0000 Subject: [PATCH] removes must_pass from is_satisfied #116 --- .../blueprint/utils/satisfiability_check.hpp | 19 +++---------------- test/test_plonk_component.hpp | 2 +- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/include/nil/blueprint/utils/satisfiability_check.hpp b/include/nil/blueprint/utils/satisfiability_check.hpp index ff8a845095..99d72a0d6f 100644 --- a/include/nil/blueprint/utils/satisfiability_check.hpp +++ b/include/nil/blueprint/utils/satisfiability_check.hpp @@ -44,8 +44,7 @@ namespace nil { bool is_satisfied(circuit> bp, crypto3::zk::snark::plonk_assignment_table assignments, - bool must_pass = true) { + ArithmetizationParams> assignments) { const std::vector>> gates = bp.gates(); @@ -69,11 +68,7 @@ namespace nil { if (!constraint_result.is_zero()) { std::cout << "Constraint " << j << " from gate " << i << "on row " << selector_row << " is not satisfied." << std::endl; - if (must_pass) { - return false; - } else { - return true; - } + return false; } } } @@ -84,18 +79,10 @@ namespace nil { if (var_value(assignments, copy_constraints[i].first) != var_value(assignments, copy_constraints[i].second)){ std::cout << "Copy constraint number " << i << " is not satisfied." << std::endl; - if (must_pass) { - return false; - } else { - return true; - } + return false; } } - if (!must_pass) { - std::cout << "All constraints are satisfied." << std::endl; - return false; - } return true; } diff --git a/test/test_plonk_component.hpp b/test/test_plonk_component.hpp index 5833782e2f..af98b7f0d1 100644 --- a/test/test_plonk_component.hpp +++ b/test/test_plonk_component.hpp @@ -135,7 +135,7 @@ namespace nil { profiling(assignment); #endif - assert(blueprint::is_satisfied(bp, assignment, must_pass)); + assert(blueprint::is_satisfied(bp, assignment) == must_pass); return std::make_tuple(desc, bp, assignment); }