Vcsn  2.8
Be Rational
conjunction-expression.hh
Go to the documentation of this file.
1 #pragma once
2 
3 #include <vcsn/ctx/context.hh>
4 #include <vcsn/ctx/traits.hh>
5 #include <vcsn/dyn/value.hh>
6 
7 namespace vcsn
8 {
9  /*-----------------------------.
10  | conjunction(value, value). |
11  `-----------------------------*/
12 
14  template <typename ValueSet>
15  typename ValueSet::value_t
16  conjunction(const ValueSet& rs,
17  const typename ValueSet::value_t& lhs,
18  const typename ValueSet::value_t& rhs)
19  {
20  return rs.conjunction(lhs, rhs);
21  }
22 
23 
24  namespace dyn
25  {
26  namespace detail
27  {
28  template <typename ValueSetLhs, typename ValueSetRhs,
29  typename Value>
30  Value
31  conjunction_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::conjunction(std::get<0>(join_elts),
36  std::get<1>(join_elts),
37  std::get<2>(join_elts))};
38  }
39  }
40  }
41 
42  /*-------------------------------------.
43  | conjunction(expansion, expansion). |
44  `-------------------------------------*/
45 
46  namespace dyn
47  {
48  namespace detail
49  {
51  template <typename ExpSetLhs, typename ExpSetRhs>
52  expansion
53  conjunction_expansion(const expansion& lhs, const expansion& rhs)
54  {
55  return conjunction_value<ExpSetLhs, ExpSetRhs>(lhs, rhs);
56  }
57  }
58  }
59 
60  /*---------------------------------------.
61  | conjunction(expression, expression). |
62  `---------------------------------------*/
63 
64  namespace dyn
65  {
66  namespace detail
67  {
69  template <typename ExpSetLhs, typename ExpSetRhs>
72  {
73  return conjunction_value<ExpSetLhs, ExpSetRhs>(lhs, rhs);
74  }
75  }
76  }
77 
78  /*---------------------------------------.
79  | conjunction(polynomial, polynomial). |
80  `---------------------------------------*/
81 
82  namespace dyn
83  {
84  namespace detail
85  {
87  template <typename PolynomialSetLhs, typename PolynomialSetRhs>
90  {
91  return conjunction_value<PolynomialSetLhs, PolynomialSetRhs>(lhs, rhs);
92  }
93  }
94  }
95 }
Value conjunction_value(const Value &lhs, const Value &rhs)
expansion conjunction_expansion(const expansion &lhs, const expansion &rhs)
Bridge (conjunction).
ValueSet::value_t conjunction(const ValueSet &rs, const typename ValueSet::value_t &lhs, const typename ValueSet::value_t &rhs)
Intersection/Hadamard product of values.
A dyn Value/ValueSet.
Definition: fwd.hh:29
Definition: a-star.hh:8
polynomial conjunction_polynomial(const polynomial &lhs, const polynomial &rhs)
Bridge (conjunction).
value_impl< detail::expression_tag > expression
Definition: fwd.hh:31
expression conjunction_expression(const expression &lhs, const expression &rhs)
Bridge (conjunction).