Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
acir_format::TestBaseWithPredicate Concept Reference

Concept defining the requirements for the Base template parameter of TestClassWithPredicate. More...

#include <test_class_predicate.hpp>

Concept definition

template<typename T>
typename T::Builder;
typename T::InvalidWitness;
typename T::InvalidWitness::Target;
typename T::AcirConstraint;
{ T::InvalidWitness::Target::None };
{ T::InvalidWitness::get_labels() } -> std::same_as<std::vector<std::string>>;
requires requires(typename T::AcirConstraint& constraint,
WitnessVector& witness_values,
const typename T::InvalidWitness::Target& invalid_witness_target) {
{ T::invalidate_witness(constraint, witness_values, invalid_witness_target) } -> std::same_as<void>;
{ T::generate_constraints(constraint, witness_values) } -> std::same_as<void>;
};
}
Concept defining the requirements for the Base template parameter of TestClassWithPredicate.
std::vector< bb::fr > WitnessVector
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13

Detailed Description

Concept defining the requirements for the Base template parameter of TestClassWithPredicate.

Base must provide:

  • A struct InvalidWitness, which specifies how to invalidate witness values to test predicate behavior. InvalidWitness must specify an enum class Target, which details the different invalidation targets (e.g., inputs, outputs, specific validation cases), and two functions get_all() and get_labels() to iterate over all possible invalidation targets.
  • Type aliases: Builder and AcirConstraint, specifying the Builder and constraint we are working with.
  • Static methods: invalidate_witness (to invalidate witness values based on the target), generate_constraints (to generate valid constraints with predicate set to witness true).

Definition at line 53 of file test_class_predicate.hpp.