Vcsn  2.8
Be Rational
shuffle-expression.hh
Go to the documentation of this file.
1 #pragma once
2 
4 #include <vcsn/ctx/context.hh>
5 #include <vcsn/ctx/traits.hh>
6 #include <vcsn/dyn/value.hh>
7 
8 namespace vcsn
9 {
10  /*-------------------------.
11  | shuffle(value, value). |
12  `-------------------------*/
13 
15  template <typename ValueSet>
16  typename ValueSet::value_t
17  shuffle(const ValueSet& vs,
18  const typename ValueSet::value_t& lhs,
19  const typename ValueSet::value_t& rhs)
20  {
21  return vs.shuffle(lhs, rhs);
22  }
23 
24  namespace dyn
25  {
26  namespace detail
27  {
28  template <typename ValueSetLhs, typename ValueSetRhs,
29  typename Value>
30  Value
31  shuffle_value(const Value& lhs, const Value& rhs)
32  {
33  auto join_elts = join<ValueSetLhs, ValueSetRhs>(lhs, rhs);
34  return {std::get<0>(join_elts),
35  ::vcsn::shuffle(std::get<0>(join_elts),
36  std::get<1>(join_elts),
37  std::get<2>(join_elts))};
38  }
39  }
40  }
41 
42 
43 
44  /*-----------------------------------.
45  | shuffle(expression, expression). |
46  `-----------------------------------*/
47 
48  namespace dyn
49  {
50  namespace detail
51  {
53  template <typename ExpSetLhs, typename ExpSetRhs>
55  shuffle_expression(const expression& lhs, const expression& rhs)
56  {
57  return shuffle_value<ExpSetLhs, ExpSetRhs>(lhs, rhs);
58  }
59  }
60  }
61 
62  /*-----------------------------------.
63  | shuffle(polynomial, polynomial). |
64  `-----------------------------------*/
65 
66  namespace dyn
67  {
68  namespace detail
69  {
71  template <typename SetLhs, typename SetRhs>
73  shuffle_polynomial(const polynomial& lhs, const polynomial& rhs)
74  {
75  return shuffle_value<SetLhs, SetRhs>(lhs, rhs);
76  }
77  }
78  }
79 }
auto shuffle(const Auts &... as) -> tuple_automaton< decltype(join_automata(as...)), Auts... >
The (accessible part of the) shuffle product.
Definition: conjunction.hh:783
A dyn Value/ValueSet.
Definition: fwd.hh:29
Value shuffle_value(const Value &lhs, const Value &rhs)
Definition: a-star.hh:8
expression shuffle_expression(const expression &lhs, const expression &rhs)
Bridge (shuffle).
polynomial shuffle_polynomial(const polynomial &lhs, const polynomial &rhs)
Bridge (shuffle).
value_impl< detail::expression_tag > expression
Definition: fwd.hh:31