5 #include <boost/range.hpp> 24 virtual ~exp() =
default;
80 template <
typename Context>
82 :
public std::enable_shared_from_this<node<Context>>
89 using value_t = std::shared_ptr<const node_t>;
101 template <
typename Context>
103 :
public node<Context>
118 template <exp::type_t Type,
typename Context>
120 :
public inner<Context>
143 const value_t operator[](
size_t n)
const;
151 auto tail()
const -> decltype(boost::make_iterator_range(*
this, 1, 0));
155 template <
typename... Vs>
157 : sub_{std::forward<Vs>(vs)...}
173 template <
typename Context,
bool Enable>
175 :
public inner<Context>
178 static_assert(Context::is_lat,
179 "tuple: requires a tupleset labelset");
185 template <
unsigned Tape>
187 = std::shared_ptr<const rat::node<detail::project_context<Tape, context_t>>>;
189 template <
typename Sequence>
192 template <
size_t... I>
195 using type = std::tuple<value_t_of<I>...>;
200 template <
typename... Args>
202 : sub_{std::forward<Args>(args)...}
217 template <
typename Context>
219 :
public inner<Context>
226 template <exp::type_t Type,
typename Context>
228 :
public inner<Context>
231 static_assert(
is_unary(Type),
"invalid type");
255 template <exp::type_t Type,
typename Context>
257 :
public inner<Context>
289 template <
typename Context>
291 :
public inner<Context>
316 template <
typename Context>
318 :
public node<Context>
325 template <exp::type_t Type,
typename Context>
327 :
public leaf<Context>
341 template <
typename Context>
343 :
public leaf<Context>
void visit(const tuple< context_t > &v)
virtual type_t type() const
The type of this node.
size_t size(const ExpSet &rs, const typename ExpSet::value_t &r)
constexpr bool is_constant(type_t t)
Whether is a constant (\\z or \\e).
virtual type_t type() const
The type of this node.
std::vector< value_t > values_t
An inner node with multiple children.
typename labelset_t_of< context_t >::indices_t indices_t
The abstract, non-parameterized, root for all rational expression node types.
typename super_t::value_t value_t
virtual type_t type() const
The type of this node.
boost::flyweight< std::string, boost::flyweights::no_tracking, boost::flyweights::intermodule_holder > symbol
An internalized string.
bool is_leaf() const
Whether a leaf of the expression tree.
An inner node to name the subexpression.
Container::value_type back(const Container &container)
The last member of this Container.
label_t_of< Context > label_t
std::shared_ptr< const rat::node< detail::project_context< Tape, context_t > >> value_t_of
Given a tape, its corresponding expression type.
constexpr bool is_unary(type_t t)
Whether star, complement.
const values_t sub() const
bool is_unary() const
Whether star, complement.
typename detail::labelset_t_of_impl< base_t< ValueSet > >::type labelset_t_of
type_t
The possible types of expressions.
virtual type_t type() const
The type of this node.
constexpr bool is_variadic(type_t t)
Whether one of the variadic types.
std::shared_ptr< const node_t > value_t
An expression usable with value semantics.
Implementation of nodes of tuple of rational expressions.
typename detail::label_t_of_impl< base_t< ValueSet > >::type label_t_of
The abstract parameterized, root for all rational expression types.
An inner node implementing a weight.
virtual type_t type() const
The type of this node.
weight_t_of< Context > weight_t
std::tuple< value_t_of< I >... > type
virtual void accept(typename super_t::const_visitor &v) const
virtual type_t type() const =0
The type of this node.
The root from which to derive the final node types.
virtual type_t type() const
The type of this node.
typename detail::weight_t_of_impl< base_t< ValueSet > >::type weight_t_of
typename values_t::const_iterator const_iterator
value_impl< detail::weight_tag > weight
virtual type_t type() const
The type of this node.