18 template <
typename RatExpSet>
27 template <typename RatExpSet> \
30 ratexpset_wrapper<RatExpSet>
33 ->
typename ratexpset_t::value_t
38 DEFINE::down(
const std::string& w)
const ->
weight_t
51 return rs_.identities();
64 DEFINE::atom(
const std::string& w)
const ->
value_t
66 return rs_.atom(::
vcsn::conv(*rs_.labelset(), w));
71 return rs_.add(down(l), down(
r));
76 return rs_.mul(down(l), down(
r));
81 return rs_.conjunction(down(l), down(
r));
86 return rs_.shuffle(down(l), down(
r));
91 return rs_.ldiv(down(l), down(
r));
96 return rs_.rdiv(down(l), down(
r));
101 return rs_.concat(down(l), down(
r));
106 return rs_.star(down(v));
111 return rs_.complement(down(v));
116 return rs_.transposition(down(v));
121 return rs_.lmul(down(w), down(v));
126 return rs_.rmul(down(v), down(w));
132 return letter_class_<labelset_t>(cs, accept,
133 std::is_same<labelset_t, vcsn::oneset>{},
134 std::integral_constant<bool,
135 labelset_t::is_ratexpset()>{});
138 template <
typename RatExpSet>
139 template <
typename LabelSet_>
145 std::true_type) const
148 raise(
"not implemented");
151 template <
typename RatExpSet>
152 template <
typename LabelSet_>
158 std::false_type) const
161 auto ls = *rs_.labelset();
163 using labelset_t = decltype(ls);
164 using word_t =
typename labelset_t::word_t;
165 using label_t =
typename labelset_t::value_t;
166 using letter_t =
typename labelset_t::letter_t;
168 std::set<std::pair<letter_t, letter_t>> ccs;
177 word_t w1 = ls.word(lbl1);
178 word_t w2 = ls.word(lbl2);
179 letter_t l1 = *std::begin(ls.letters_of(w1));
180 letter_t l2 = *std::begin(ls.letters_of(w2));
183 return rs_.letter_class(ccs, accept);
186 template <
typename RatExpSet>
187 template <
typename LabelSet_,
typename Bool>
206 return rs_.print(down(v), o);
213 template <
typename RatExpSet>
219 return std::make_shared<wrapper_t>(rs);
variadic< type_t::ldiv, Context > ldiv
ratexp make_ratexp(const RatExpSet &rs, const typename RatExpSet::value_t &ratexp)
unary< type_t::complement, Context > complement
label_t_of< context_t > label_t
typename detail::labelset_t_of_impl< base_t< ValueSet >>::type labelset_t_of
ratexpset make_ratexpset(const context &ctx,::vcsn::rat::identities is)
Build an ratexpset from its context.
unary< type_t::transposition, Context > transposition
Wrapper around a ratexpset.
rat::identities identities(const ratexp &exp)
Bridge.
std::shared_ptr< detail::ratexp_base > ratexp
auto conv(const ValueSet &vs, const std::string &str, Args &&...args) -> decltype(vs.conv(std::declval< std::istream & >(), std::forward< Args >(args)...))
Parse str via vs.conv.
std::ostream & print(const ValueSet &vs, const typename ValueSet::value_t &v, std::ostream &o, const std::string &format)
Applies to (ValueSet, Value, ostream, string): for expansionset, polynomialset, ratexpset, and weightset.
#define down_pointer_cast
unary< type_t::star, Context > star
std::shared_ptr< const detail::ratexpset_base > ratexpset
ratexpset_wrapper(const ratexpset_t &rs)
Constructor.
std::istringstream is
The input stream: the specification to translate.
constant< type_t::one, Context > one
constant< type_t::zero, Context > zero
weight_t_of< context_t > weight_t
Provide a variadic mul on top of a binary mul(), and one().
Abstract wrapper around a (typeful) ratexpset.
variadic< type_t::shuffle, Context > shuffle
std::set< std::pair< std::string, std::string >> letter_class_t
identities
A ratexpset can implement several different sets of identities on expressions.
value_t letter_class_(const letter_class_t &chars, bool accept, std::true_type, Bool) const
If context is oneset.
variadic< type_t::conjunction, Context > conjunction