2#include "../circuit_builders/circuit_builders_fwd.hpp"
3#include "../witness/witness.hpp"
5namespace proof_system::plonk::stdlib {
7template <
typename Builder>
class bool_t {
9 bool_t(
const bool value =
false);
16 bool_t& operator=(
const bool other);
33 bool_t operator~()
const {
return operator!(); }
44 void operator|=(
const bool_t& other) { *
this = operator|(other); }
48 void operator^=(
const bool_t& other) { *
this = operator^(other); }
51 void assert_equal(
const bool_t& rhs, std::string
const& msg =
"bool_t::assert_equal")
const;
55 void must_imply(
const bool_t& other, std::string
const& msg =
"bool_t::must_imply")
const;
57 void must_imply(
const std::vector<std::pair<bool_t, std::string>>& conds)
const;
59 bool get_value()
const {
return witness_bool ^ witness_inverted; }
61 bool is_constant()
const {
return witness_index == IS_CONSTANT; }
65 Builder* get_context()
const {
return context; }
67 mutable Builder* context =
nullptr;
68 mutable bool witness_bool =
false;
69 mutable bool witness_inverted =
false;
70 mutable uint32_t witness_index = IS_CONSTANT;
73template <
typename T>
inline std::ostream& operator<<(std::ostream& os,
bool_t<T> const& v)
75 return os << v.get_value();
78EXTERN_STDLIB_TYPE(bool_t);
Definition: standard_circuit_builder.hpp:12
bool_t operator&(const bool_t &other) const
Definition: bool.cpp:104
void must_imply(const bool_t &other, std::string const &msg="bool_t::must_imply") const
Definition: bool.cpp:447
Definition: witness.hpp:10