17 template <
typename InExpSet,
typename OutExpSet>
18 std::enable_if_t<std::is_same<InExpSet, OutExpSet>{},
19 typename OutExpSet::value_t>
20 copy(
const InExpSet& in_rs,
const OutExpSet& out_rs,
21 const typename InExpSet::value_t&
v);
23 template <
typename InExpSet,
typename OutExpSet>
24 std::enable_if_t<!std::is_same<InExpSet, OutExpSet>{},
25 typename OutExpSet::value_t>
26 copy(
const InExpSet& in_rs,
const OutExpSet& out_rs,
27 const typename InExpSet::value_t&
v);
33 template <
typename InExpSet,
typename OutExpSet>
35 :
public InExpSet::const_visitor
40 using super_t =
typename in_expressionset_t::const_visitor;
46 template <type_t Type>
48 template <type_t Type>
73 template <exp::type_t Type,
typename Fun>
75 rec_(
const unary_t<Type>&
v, Fun&& fun)
82 template <exp::type_t Type,
typename Fun>
84 rec_(
const variadic_t<Type>&
v, Fun&& fun)
87 for (
const auto& c: v.tail())
142 template <
typename =
void>
151 std::get<I>(v.sub()));
155 template <
size_t... I>
171 detail::static_if<in_context_t::is_lat>
186 template <
typename InExpSet,
typename OutExpSet>
187 std::enable_if_t<std::is_same<InExpSet, OutExpSet>{},
188 typename OutExpSet::value_t>
189 copy(
const InExpSet& in_rs,
const OutExpSet& out_rs,
190 const typename InExpSet::value_t&
v)
195 if (in_rs.identities() == out_rs.identities())
202 catch (
const std::runtime_error& e)
205 " while converting expression ",
211 template <
typename InExpSet,
typename OutExpSet>
212 std::enable_if_t<!std::is_same<InExpSet, OutExpSet>{},
213 typename OutExpSet::value_t>
214 copy(
const InExpSet& in_rs,
const OutExpSet& out_rs,
215 const typename InExpSet::value_t&
v)
222 catch (
const std::runtime_error& e)
225 " while converting expression ",
void rec_(const unary_t< Type > &v, Fun &&fun)
Factor the handling of unary operations.
VCSN_RAT_VISIT(infiltrate, v)
VCSN_RAT_VISIT(compose, v)
auto work_(const tuple_t &v)
Copy one tape.
void visit(const tuple_t &v, std::true_type) override
InExpSet in_expressionset_t
An inner node with multiple children.
OutExpSet out_expressionset_t
VCSN_RAT_VISIT(rweight, v)
VCSN_RAT_VISIT(conjunction, v)
VCSN_RAT_VISIT(shuffle, v)
An inner node to name the subexpression.
typename detail::context_t_of_impl< base_t< ValueSet > >::type context_t_of
typename in_expressionset_t::value_t in_expression_t
typename detail::labelset_t_of_impl< base_t< ValueSet > >::type labelset_t_of
typename in_expressionset_t::const_visitor super_t
out_expression_t(ors_t::*)(const out_expression_t &, const out_expression_t &) const bin_t
const in_expressionset_t & in_rs_
Expressionset to decode the input value.
out_expression_t work_(const tuple_t &v, detail::index_sequence< I... >)
Copy all the tapes.
VCSN_RAT_VISIT(transposition, v)
out_expression_t operator()(const tuple_t &v)
Entry point.
VCSN_RAT_VISIT(complement, v)
std::string to_string(identities i)
Wrapper around operator<<.
An inner node implementing a weight.
void rec_(const variadic_t< Type > &v, Fun &&fun)
Factor the handling of n-ary operations.
out_expression_t rec_(const in_expression_t &v)
Easy recursion.
context_t_of< in_expressionset_t > in_context_t
VCSN_RAT_VISIT(ldivide, v)
copy_impl(const in_expressionset_t &in_rs, const out_expressionset_t &out_rs)
typename super_t::template variadic_t< Type > variadic_t
Functor to copy/convert a rational expression.
typename super_t::template unary_t< Type > unary_t
std::string str_quote(Args &&... args)
Convert to a string, in quotes.
out_expressionset_t ors_t
const out_expressionset_t & out_rs_
Expressionset to build the output value.
VCSN_RAT_VISIT(lweight, v)
typename super_t::tuple_t tuple_t
std::enable_if_t< std::is_same< InExpSet, OutExpSet >{}, typename OutExpSet::value_t > copy(const InExpSet &in_rs, const OutExpSet &out_rs, const typename InExpSet::value_t &v)
Copy/convert a rational expression.
typename out_expressionset_t::value_t out_expression_t
out_expression_t res_
Output value, under construction.
out_expression_t operator()(const in_expression_t &v)
Entry point: copy/convert v.