33 template <
typename Tag>
40 template <
typename ValueSet>
41 value_impl(
const ValueSet& vs,
const typename ValueSet::value_t&
v)
42 : self_{std::make_shared<model<ValueSet>>(vs,
v)}
48 return self_->vname();
52 template <
typename ValueSet>
59 template <
typename ValueSet>
60 const auto&
as()
const
88 self_ = std::move(l.
self_);
96 virtual ~
base() =
default;
101 template <
typename ValueSet>
107 : valueset_(
std::move(vs))
108 , value_(
std::move(v))
113 return valueset().sname();
134 std::shared_ptr<base> self_ =
nullptr;
139 template <
typename ValueSetLhs,
typename ValueSetRhs,
typename Tag>
143 const auto& l = lhs->template as<ValueSetLhs>();
144 const auto&
r = rhs->template as<ValueSetRhs>();
145 auto rs =
join(l.valueset(), r.valueset());
146 auto lr = rs.conv(l.valueset(), l.value());
147 auto rr = rs.conv(r.valueset(), r.value());
148 return std::make_tuple(rs, lr, rr);
152 using expansion = value_impl<detail::expansion_tag>;
154 using expression = value_impl<detail::expression_tag>;
156 using label = value_impl<detail::label_tag>;
158 using polynomial = value_impl<detail::polynomial_tag>;
160 using weight = value_impl<detail::weight_tag>;
value_impl< detail::expansion_tag > expansion
auto & operator=(std::nullptr_t)
const valueset_t & valueset() const
Tag for polynomial/polynomialset.
To dyn_cast(From &&from)
A dynamic_cast in debug mode, static_cast with NDEBUG.
value_impl< detail::weight_tag > weight
context join(const context &lhs, const context &rhs)
The join between two contexts, i.e., their lowest common supertype.
const valueset_t valueset_
The value set.
const value_impl * operator->() const
std::shared_ptr< base > self_
The wrapped value/valueset.
Tag for weight/weightset.
Provide a variadic mul on top of a binary mul(), and one().
const value_t value_
The value.
boost::flyweight< std::string, boost::flyweights::no_tracking, boost::flyweights::intermodule_holder > symbol
An internalized string.
const auto & as() const
Extract wrapped typed value.
A wrapped typed Value/ValueSet.
Tag for expression/expressionset.
value_impl()
Default construction: empty.
value_impl(const ValueSet &vs, const typename ValueSet::value_t &v)
auto & operator=(const value_impl &l)
value_impl * operator->()
symbol vname() const
A description of the value type.
auto & as()
Extract wrapped typed value.
Tag for expansion/expansionset.
model(valueset_t vs, value_t v)
value_impl< detail::label_tag > label
value_impl< detail::expression_tag > expression
symbol vname() const override
Abstract wrapped typed Value/ValueSet.
const value_t value() const
value_impl< detail::polynomial_tag > polynomial
typename valueset_t::value_t value_t