barretenberg
Loading...
Searching...
No Matches
instance_inspector.hpp
1#pragma once
2
3#include "barretenberg/common/log.hpp"
4
5namespace instance_inspector {
6
7// Determine whether a polynomial has at least one non-zero coefficient
8bool is_non_zero(auto& polynomial)
9{
10 for (auto& coeff : polynomial) {
11 if (!coeff.is_zero()) {
12 return true;
13 }
14 }
15 return false;
16}
17
23void inspect_instance(auto& prover_instance)
24{
25 auto& prover_polys = prover_instance->prover_polynomials;
26 std::vector<std::string> zero_polys;
27 for (auto [label, poly] : zip_view(prover_polys.get_labels(), prover_polys.get_all())) {
28 if (!is_non_zero(poly)) {
29 zero_polys.emplace_back(label);
30 }
31 }
32 if (zero_polys.empty()) {
33 info("\nDebug Utility: All prover polynomials are non-zero.");
34 } else {
35 info("\nDebug Utility: The following prover polynomials are identically zero: ");
36 for (const std::string& label : zero_polys) {
37 info("\t", label);
38 }
39 }
40 info();
41}
42
43} // namespace instance_inspector
Definition: zip_view.hpp:159