Vcsn  2.3
Be Rational
compose-expression.hh
Go to the documentation of this file.
1 #pragma once
2 
3 #include <vcsn/dyn/value.hh>
4 
5 namespace vcsn
6 {
7  /*-------------------------.
8  | compose(Value, Value). |
9  `-------------------------*/
10 
12  template <typename ValueSet>
13  typename ValueSet::value_t
14  compose(const ValueSet& vs,
15  const typename ValueSet::value_t& lhs,
16  const typename ValueSet::value_t& rhs)
17  {
18  return vs.compose(lhs, rhs);
19  }
20 
21 
22  /*---------------------------------.
23  | compose(expansion, expansion). |
24  `---------------------------------*/
25 
26  namespace dyn
27  {
28  namespace detail
29  {
31  template <typename ExpSetLhs, typename ExpSetRhs>
32  expansion
33  compose_expansion(const expansion& lhs, const expansion& rhs)
34  {
35  auto join_elts = join<ExpSetLhs, ExpSetRhs>(lhs, rhs);
36  return {std::get<0>(join_elts),
37  ::vcsn::compose(std::get<0>(join_elts),
38  std::get<1>(join_elts),
39  std::get<2>(join_elts))};
40  }
41  }
42  }
43 
44  /*-----------------------------------.
45  | compose(expression, expression). |
46  `-----------------------------------*/
47 
48  namespace dyn
49  {
50  namespace detail
51  {
53  template <typename ExpSetLhs, typename ExpSetRhs>
55  compose_expression(const expression& lhs, const expression& rhs)
56  {
57  auto join_elts = join<ExpSetLhs, ExpSetRhs>(lhs, rhs);
58  return {std::get<0>(join_elts),
59  ::vcsn::compose(std::get<0>(join_elts),
60  std::get<1>(join_elts),
61  std::get<2>(join_elts))};
62  }
63  }
64  }
65 
66  /*-----------------------------------.
67  | compose(polynomial, polynomial). |
68  `-----------------------------------*/
69 
70  namespace dyn
71  {
72  namespace detail
73  {
75  template <typename PolSetLhs, typename PolSetRhs>
77  compose_polynomial(const polynomial& lhs, const polynomial& rhs)
78  {
79  auto join_elts = join<PolSetLhs, PolSetRhs>(lhs, rhs);
80  return {std::get<0>(join_elts),
81  ::vcsn::compose(std::get<0>(join_elts),
82  std::get<1>(join_elts),
83  std::get<2>(join_elts))};
84  }
85  }
86  }
87 }
polynomial compose_polynomial(const polynomial &lhs, const polynomial &rhs)
Bridge (compose).
A dyn Value/ValueSet.
Definition: fwd.hh:23
expression compose_expression(const expression &lhs, const expression &rhs)
Bridge (compose).
Definition: a-star.hh:8
value_impl< detail::polynomial_tag > polynomial
Definition: fwd.hh:27
value_impl< detail::expansion_tag > expansion
Definition: fwd.hh:24
ValueSet::value_t compose(const ValueSet &vs, const typename ValueSet::value_t &lhs, const typename ValueSet::value_t &rhs)
Composition of values.
expansion compose_expansion(const expansion &lhs, const expansion &rhs)
Bridge (compose).
value_impl< detail::expression_tag > expression
Definition: fwd.hh:25