Vcsn  2.1
Be Rational
less-than.hh
Go to the documentation of this file.
1 #pragma once
2 
3 #include <stdexcept>
4 
6 
7 namespace vcsn
8 {
9 
10  /*-------------------------------------.
11  | less_than(expression, expression). |
12  `-------------------------------------*/
13 
15  template <typename ExpSet>
16  bool
17  less_than(const ExpSet& rs,
18  const typename ExpSet::value_t& lhs,
19  const typename ExpSet::value_t& rhs)
20  {
21  return rs.less(lhs, rhs);
22  }
23 
24  namespace dyn
25  {
26  namespace detail
27  {
29  template <typename ExpSet1, typename ExpSet2>
30  bool
31  less_than_expression(const expression& lhs, const expression& rhs)
32  {
33  const auto& l = lhs->as<ExpSet1>();
34  const auto& r = rhs->as<ExpSet2>();
35  auto rs = join(l.expressionset(), r.expressionset());
36  auto lr = rs.conv(l.expressionset(), l.expression());
37  auto rr = rs.conv(r.expressionset(), r.expression());
38  return ::vcsn::less_than(rs, lr, rr);
39  }
40  }
41  }
42 } // namespace vcsn
Provide a variadic mul on top of a binary mul(), and one().
Definition: fwd.hh:46
bool less_than_expression(const expression &lhs, const expression &rhs)
Bridge (less_than).
Definition: less-than.hh:31
auto rs
Definition: lift.hh:151
std::shared_ptr< detail::expression_base > expression
Definition: expression.hh:78
bool less_than(const ExpSet &rs, const typename ExpSet::value_t &lhs, const typename ExpSet::value_t &rhs)
Whether lhs precedes rhs.
Definition: less-than.hh:17
context join(const context &c1, const context &c2)
Bridge.
Definition: make-context.hh:92