5 #include <boost/range.hpp> 23 virtual ~exp() =
default;
79 template <
typename Context>
81 :
public std::enable_shared_from_this<node<Context>>
88 using value_t = std::shared_ptr<const node_t>;
100 template <
typename Context>
102 :
public node<Context>
117 template <exp::type_t Type,
typename Context>
119 :
public inner<Context>
142 const value_t operator[](
size_t n)
const;
150 auto tail()
const -> decltype(boost::make_iterator_range(*
this, 1, 0));
154 template <
typename... Vs>
156 : sub_{std::forward<Vs>(vs)...}
172 template <
typename Context,
bool Enable>
174 :
public inner<Context>
177 static_assert(Context::is_lat,
178 "tuple: requires a tupleset labelset");
184 template <
unsigned Tape>
186 = std::shared_ptr<const rat::node<detail::project_context<Tape, context_t>>>;
188 template <
typename Sequence>
191 template <
size_t... I>
194 using type = std::tuple<value_t_of<I>...>;
199 template <
typename... Args>
201 : sub_{std::forward<Args>(args)...}
216 template <
typename Context>
218 :
public inner<Context>
225 template <exp::type_t Type,
typename Context>
227 :
public inner<Context>
230 static_assert(
is_unary(Type),
"invalid type");
254 template <exp::type_t Type,
typename Context>
256 :
public inner<Context>
288 template <
typename Context>
290 :
public node<Context>
297 template <exp::type_t Type,
typename Context>
299 :
public leaf<Context>
313 template <
typename Context>
315 :
public leaf<Context>
constexpr bool is_unary(type_t t)
Whether star, complement.
std::shared_ptr< const node_t > value_t
An expression usable with value semantics.
bool is_unary() const
Whether star, complement.
Implementation of nodes of tuple of rational expressions.
The abstract parameterized, root for all rational expression types.
constexpr bool is_variadic(type_t t)
Whether one of the variadic types.
std::vector< value_t > values_t
std::shared_ptr< const rat::node< detail::project_context< Tape, context_t > >> value_t_of
Given a tape, its corresponding expression type.
typename super_t::value_t value_t
value_impl< detail::weight_tag > weight
bool is_leaf() const
Whether a leaf of the expression tree.
typename detail::labelset_t_of_impl< base_t< ValueSet > >::type labelset_t_of
typename detail::weight_t_of_impl< base_t< ValueSet > >::type weight_t_of
constexpr bool is_constant(type_t t)
Whether is a constant (\\z or \\e).
virtual type_t type() const =0
The type of this node.
void visit(const tuple< context_t > &v)
const values_t sub() const
virtual type_t type() const
The type of this node.
typename labelset_t_of< context_t >::indices_t indices_t
The root from which to derive the final node types.
An inner node with multiple children.
std::tuple< value_t_of< I >... > type
An inner node implementing a weight.
virtual type_t type() const
The type of this node.
Container::value_type back(const Container &container)
The last member of this Container.
label_t_of< Context > label_t
typename values_t::const_iterator const_iterator
The abstract, non-parameterized, root for all rational expression node types.
virtual void accept(typename super_t::const_visitor &v) const
virtual type_t type() const
The type of this node.
virtual type_t type() const
The type of this node.
type_t
The possible types of expressions.
size_t size(const ExpSet &rs, const typename ExpSet::value_t &r)
weight_t_of< Context > weight_t
virtual type_t type() const
The type of this node.
virtual type_t type() const
The type of this node.
typename detail::label_t_of_impl< base_t< ValueSet > >::type label_t_of