Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
prover_instance_inspector.hpp
Go to the documentation of this file.
1#pragma once
2
8
10
11// Determine whether a polynomial has at least one non-zero coefficient
12bool is_non_zero(auto& polynomial)
13{
14 for (auto& coeff : polynomial) {
15 if (!coeff.is_zero()) {
16 return true;
17 }
18 }
19 return false;
20}
21
27void inspect_prover_instance(auto& prover_instance)
28{
29 auto& prover_polys = prover_instance->prover_polynomials;
30 std::vector<std::string> zero_polys;
31 for (auto [label, poly] : zip_view(prover_polys.get_labels(), prover_polys.get_all())) {
32 if (!is_non_zero(poly)) {
33 zero_polys.emplace_back(label);
34 }
35 }
36 if (zero_polys.empty()) {
37 info("\nProving Key Inspector: All prover polynomials are non-zero.");
38 } else {
39 info("\nProving Key Inspector: The following prover polynomials are identically zero: ");
40 for (const std::string& label : zero_polys) {
41 info("\t", label);
42 }
43 }
44 info();
45}
46
47} // namespace bb::prover_instance_inspector
#define info(...)
Definition log.hpp:93
std::string label
Base class templates shared across Honk flavors.
void inspect_prover_instance(auto &prover_instance)
Utility for indicating which polynomials in a decider proving key are identically zero.