127 return int(l) - int(r);
181 conv(std::istream& is,
bool =
true)
const 186 if (i != 0 && i != 1)
199 o << (v ?
"\\top" :
"\\bot");
201 o << (v ?
'1' :
'0');
231 template <
typename RandomGenerator>
239 using super_t::super_t;
245 = std::uniform_int_distribution<>(super_t::min_, super_t::max_);
246 return dis(super_t::gen_) ? super_t::ws_.zero() : super_t::ws_.one();
static constexpr bool show_one()
Print as a parsable type string.
weightset_mixin< detail::r_impl > r
static int compare(const value_t l, const value_t r)
Three-way comparison between l and r.
static constexpr bool is_idempotent()
ATTRIBUTE_NORETURN void raise_invalid_value(const ValueSet &vs, Args &&... args)
Cannot make a value from this.
static value_t sub(const value_t l, const value_t r)
char eat(std::istream &is, char c)
Check lookahead character and advance.
static bool less(const value_t lhs, const value_t rhs)
Whether lhs < rhs.
value_t pick_value_() const
value_t lgcd(const value_t l, const value_t r) const
static std::ostream & print(const value_t v, std::ostream &o=std::cout, format fmt={})
static bool is_one(const value_t v)
static constexpr bool is_commutative()
static size_t hash(const value_t v)
boost::flyweight< std::string, boost::flyweights::no_tracking, boost::flyweights::intermodule_holder > symbol
An internalized string.
static constexpr bool has_lightening_weights()
Print as rich UTF-8 text, escaped.
An input/output format for valuesets.
Abstract class for random weight generation.
Provide a variadic mul on top of a binary mul(), and one().
auto hash_value(const T &v) -> decltype(std::hash< T >
Following the naming convention of Boost.
typename super_t::weight_t value_t
static bool equal(const value_t l, const value_t r)
Whether l == r.
static value_t conv(self_t, const value_t v)
std::ostream & print_set(std::ostream &o, format fmt={}) const
static b make(std::istream &is)
Build from the description in is.
static constexpr bool is_special(const value_t)
static value_t star(const value_t)
Print as plain (ASCII) text, escaped.
value_t ldivide(const value_t l, const value_t r) const
static value_t transpose(const value_t v)
value_t conv(std::istream &is, bool=true) const
Print as is. For instance, don't try to escape labels.
Generic declaration of the class which is specialized in each weightset.
static bool is_zero(const value_t v)
value_t rdivide(const value_t l, const value_t r) const
void require(Bool b, Args &&... args)
If b is not verified, raise an error with args as message.
static value_t mul(const value_t l, const value_t r)
value_t rgcd(const value_t l, const value_t r) const
static value_t add(const value_t l, const value_t r)
typename weightset_t::value_t weight_t
static constexpr star_status_t star_status()
weightset_mixin< detail::b_impl > b