3 #include <boost/range/algorithm/lexicographical_compare.hpp>
20 template <
typename ExpSet>
22 :
public ExpSet::const_visitor
31 using super_t =
typename expressionset_t::const_visitor;
32 using node_t =
typename super_t::node_t;
33 using inner_t =
typename super_t::inner_t;
34 template <rat::exp::type_t Type>
36 template <rat::exp::type_t Type>
38 template <rat::exp::type_t Type>
53 size_t lhss = size<ExpSet>(lhs);
54 size_t rhss = size<ExpSet>(rhs);
60 else if (lhs->type() < rhs->type())
62 else if (lhs->type() > rhs->type())
78 #define DEFINE(Type) \
79 VCSN_RAT_VISIT(Type, lhs) \
81 res_ = less_(lhs, *down_pointer_cast<const Type ## _t>(rhs_)); \
103 template <
bool = context_t::is_lat,
104 typename Dummy =
void>
107 using tupleset_t =
typename expressionset_t::template as_tupleset_t<>;
118 return tupleset_t::less(lhs.sub(), rhs.sub());
124 template <
typename Dummy>
143 bool less_(
const zero_t&,
const zero_t&)
153 bool less_(
const atom_t& lhs,
const atom_t& rhs)
155 return labelset_t::less(lhs.value(), rhs.value());
158 template <rat::exp::type_t Type>
159 bool less_(
const variadic_t<Type>& lhs,
const variadic_t<Type>& rhs)
161 using boost::range::lexicographical_compare;
162 auto ls = lhs.size();
163 auto rs = rhs.size();
169 return lexicographical_compare(lhs, rhs,
173 template <rat::exp::type_t Type>
174 bool less_(
const unary_t<Type>& lhs,
const unary_t<Type>& rhs)
176 return expressionset_t::less(lhs.sub(), rhs.sub());
179 template <rat::exp::type_t Type>
180 bool less_(
const weight_node_t<Type>& lhs,
const weight_node_t<Type>& rhs)
183 if (expressionset_t::less(lhs.sub(), rhs.sub()))
185 else if (expressionset_t::less(rhs.sub(), lhs.sub()))
188 return weightset_t::less(lhs.weight(), rhs.weight());
bool operator()(const tuple_t &)
bool less_(const one_t &, const one_t &)
typename detail::weight_t_of_impl< base_t< ValueSet >>::type weight_t_of
bool operator()(expression_t lhs, expression_t rhs)
Whether lhs < rhs.
typename super_t::template weight_node_t< Type > weight_node_t
#define BUILTIN_UNREACHABLE()
weightset_t_of< context_t > weightset_t
typename super_t::template unary_t< Type > unary_t
bool less_(const variadic_t< Type > &lhs, const variadic_t< Type > &rhs)
typename expressionset_t::const_visitor super_t
bool operator()(const tuple_t &lhs)
Entry point: down_cast rhs_ and bounce to binary operator().
typename detail::labelset_t_of_impl< base_t< ValueSet >>::type labelset_t_of
typename detail::context_t_of_impl< base_t< ValueSet >>::type context_t_of
A functor to check whether one rational expression is (strictly) less than another one...
An inner node implementing a weight.
typename super_t::template variadic_t< Type > variadic_t
expression_t rhs_
The right-hand side expression with which the current node is compared.
bool res_
The current result.
typename super_t::inner_t inner_t
bool less_(const atom_t &lhs, const atom_t &rhs)
void visit(const tuple_t &v, std::true_type) override
Functor to compare Values of ValueSets.
typename super_t::tuple_t tuple_t
bool less_(const zero_t &, const zero_t &)
decltype(std::declval< LabelSet >().one()) one_t
typename super_t::node_t node_t
typename expressionset_t::value_t expression_t
typename detail::weightset_t_of_impl< base_t< ValueSet >>::type weightset_t_of
An inner node with multiple children.
typename expressionset_t::template as_tupleset_t<> tupleset_t
weight_t_of< context_t > weight_t
bool less_(const unary_t< Type > &lhs, const unary_t< Type > &rhs)
bool operator()(const tuple_t &lhs, const tuple_t &rhs)
Binary operator().
labelset_t_of< context_t > labelset_t
bool less_(const weight_node_t< Type > &lhs, const weight_node_t< Type > &rhs)
context_t_of< expressionset_t > context_t