Vcsn  2.8
Be Rational
vcsn::rat::expressionset_impl< Context > Class Template Reference

A typed expression set. More...

#include <expressionset.hh>

Collaboration diagram for vcsn::rat::expressionset_impl< Context >:

Classes

struct  as_tupleset_impl
 
struct  as_tupleset_impl< detail::index_sequence< I... > >
 
struct  tuple_of_label
 Turn a tuple of expressions that are labels into a multi-tape label. More...
 

Public Types

using self_t = expressionset< Context >
 
using context_t = Context
 
using labelset_t = labelset_t_of< context_t >
 
using weightset_t = weightset_t_of< context_t >
 
using kind_t = labels_are_expressions
 
using labelset_ptr = typename context_t::labelset_ptr
 
using weightset_ptr = typename context_t::weightset_ptr
 
using label_t = label_t_of< context_t >
 
using weight_t = typename weightset_t::value_t
 
using identities_t = rat::identities
 
using const_visitor = rat::const_visitor< context_t >
 
using add_t = vcsn::rat::add< context_t >
 
using atom_t = vcsn::rat::atom< context_t >
 
using complement_t = vcsn::rat::complement< context_t >
 
using compose_t = vcsn::rat::compose< context_t >
 
using conjunction_t = vcsn::rat::conjunction< context_t >
 
using infiltrate_t = vcsn::rat::infiltrate< context_t >
 
using inner_t = vcsn::rat::inner< context_t >
 
using ldivide_t = vcsn::rat::ldivide< context_t >
 
using leaf_t = vcsn::rat::leaf< context_t >
 
using lweight_t = vcsn::rat::lweight< context_t >
 
using name_t = vcsn::rat::name< context_t >
 
using node_t = vcsn::rat::node< context_t >
 
using one_t = vcsn::rat::one< context_t >
 
using mul_t = vcsn::rat::mul< context_t >
 
using rweight_t = vcsn::rat::rweight< context_t >
 
using shuffle_t = vcsn::rat::shuffle< context_t >
 
using star_t = vcsn::rat::star< context_t >
 
using transposition_t = vcsn::rat::transposition< context_t >
 
using tuple_t = vcsn::rat::tuple< context_t >
 
using zero_t = vcsn::rat::zero< context_t >
 
using value_t = typename node_t::value_t
 An expression (a shared pointer to a tree). More...
 
using type_t = typename node_t::type_t
 Type tag for AST classes. More...
 
using values_t = typename node_t::values_t
 A list (vector) of expressions. More...
 
template<type_t Type>
using unary_t = unary< Type, context_t >
 
template<type_t Type>
using variadic_t = variadic< Type, context_t >
 
using word_t = value_t
 
using letter_t = value_t
 
template<unsigned Tape, typename Ctx = context_t>
using project_t = expressionset< detail::project_context< Tape, Ctx > >
 The type of the expressionset for the Tape-th tape. More...
 
template<typename Ctx = context_t>
using as_tupleset_t = typename as_tupleset_impl< typename labelset_t_of< Ctx >::indices_t::type >::type
 If we are multitape, our type as a tupleset. More...
 

Public Member Functions

 expressionset_impl (const context_t &ctx, identities_t ids={})
 Constructor. More...
 
bool open (bool o) const
 Whether unknown letters should be added, or rejected. More...
 
const context_tcontext () const
 Accessor to the context. More...
 
identities_t identities () const
 Accessor to the identities set. More...
 
const labelset_ptrlabelset () const
 Accessor to the labelset. More...
 
const weightset_ptrweightset () const
 Accessor to the weightset. More...
 
bool is_letter (value_t) const
 When used as a LabelSet. More...
 
bool is_zero (const value_t &v) const ATTRIBUTE_PURE
 Whether v is the \\z. More...
 
bool is_universal (const value_t &v) const ATTRIBUTE_PURE
 Whether v is the 0{c}. More...
 
template<typename GenSet >
auto conv (const letterset< GenSet > &ls, typename letterset< GenSet >::value_t v) const -> value_t
 
auto conv (b, typename b::value_t v) const -> value_t
 
auto conv (const z &ws, typename z::value_t v) const -> value_t
 
auto conv (const q &ws, typename q::value_t v) const -> value_t
 
auto conv (const r &ws, typename r::value_t v) const -> value_t
 
auto conv (const nmin &ws, typename nmin::value_t v) const -> value_t
 
auto conv (const zmin &ws, typename zmin::value_t v) const -> value_t
 
template<typename Ctx2 >
auto conv (const expressionset< Ctx2 > &ws, typename expressionset< Ctx2 >::value_t v) const -> value_t
 
auto name (const value_t &v, symbol name) const -> value_t
 Build a named expression. More...
 
auto add (const value_t &l, const value_t &r) const -> value_t
 
auto mul (const value_t &l, const value_t &r) const -> value_t
 
auto concat (const value_t &l, const value_t &r) const -> value_t
 Similar to mul, but in the case of LAW, merge the labels. More...
 
auto compose (const value_t &l, const value_t &r) const -> value_t
 Build a composition: l @ r. More...
 
auto conjunction (const value_t &l, const value_t &r) const -> value_t
 Build an conjunction product: l & r. More...
 
auto infiltrate (const value_t &l, const value_t &r) const -> value_t
 Build an infiltration product: l &: r. More...
 
auto shuffle (const value_t &l, const value_t &r) const -> value_t
 Build a shuffle product: l : r. More...
 
template<typename... Value>
auto tuple (Value &&... v) const -> value_t
 Build a tuple: e | f | .... More...
 
auto power (const value_t &e, unsigned n) const -> value_t
 Add a power operator: e{n}. More...
 
auto ldivide (const value_t &l, const value_t &r) const -> value_t
 r`. More...
 
auto rdivide (const value_t &l, const value_t &r) const -> value_t
 Build a right division: l {/} r. More...
 
auto star (const value_t &e) const -> value_t
 Add a star operator: e*. More...
 
auto complement (const value_t &e) const -> value_t
 Add a complement operator: e{c}. More...
 
auto transposition (const value_t &e) const -> value_t
 Add a transposition operator. More...
 
auto rweight (const value_t &e, const weight_t &w) const -> value_t
 Right-multiplication by a weight. More...
 
auto lweight (const weight_t &w, const value_t &e) const -> value_t
 Left-multiplication by a weight. More...
 
auto transpose (const value_t &e) const -> value_t
 The transposed of this rational expression. More...
 
auto word (label_t l) const -> word_t
 Make a `word' out of an expression. More...
 
template<typename... Args>
auto letter_class (Args &&... chars) const -> value_t
 An expression matching one character amongst chars. More...
 
auto conv (std::istream &is, bool=true) const -> value_t
 The next expression in a stream. More...
 
auto conv (const self_t &, const value_t &v) const -> value_t
 Convert from ourself: identity. More...
 
template<typename Fun >
void convs (std::istream &, Fun) const
 Read a range of expressions. More...
 
auto print (const value_t &v, std::ostream &o=std::cout, format fmt={}) const -> std::ostream &
 
auto print_set (std::ostream &o, format fmt={}) const -> std::ostream &
 Format the description of this expressionset. More...
 
template<unsigned Tape>
auto project () const -> project_t< Tape >
 The expressionset for the Tape-th tape. More...
 
template<size_t Tape>
auto project (const value_t &v) const -> decltype(::vcsn::rat::project< Tape >(this->self(), v))
 Project a multitape expression. More...
 
template<typename Ctx = context_t>
auto as_tupleset () const -> std::enable_if_t< Ctx::is_lat, as_tupleset_t< Ctx >>
 If we are multitape, ourself as a tupleset. More...
 
template<typename expressionset_impl< Context >::type_t Type>
auto gather_ (values_t &res, const value_t &v) const -> void
 
template<typename expressionset_impl< Context >::type_t Type>
auto gather_ (const value_t &l, const value_t &r) const -> values_t
 
template<typename LabelSet_ >
auto letter_class_ (std::set< std::pair< typename LabelSet_::letter_t, typename LabelSet_::letter_t >> ccs, bool accept, std::false_type) const -> value_t
 
template<typename LabelSet_ , typename... Args>
auto letter_class_ (const Args &&..., std::true_type) const -> value_t
 

Static Public Member Functions

static symbol sname ()
 Static description key. More...
 
static self_t make (std::istream &is)
 Build from the description in is. More...
 
static value_t special ()
 When used as a LabelSet. More...
 
static bool is_special (const value_t &v)
 When used as a LabelSet. More...
 
static bool is_one (const value_t &v) ATTRIBUTE_PURE
 Whether v is the \\e. More...
 
static constexpr bool is_letterized ()
 When used as a labelset. More...
 
static constexpr bool is_commutative ()
 When used as WeightSet. More...
 
static constexpr bool is_idempotent ()
 When used as WeightSet. More...
 
static constexpr bool show_one ()
 When used as WeightSet. More...
 
static constexpr bool has_lightening_weights ()
 When used as WeightSet. More...
 
static constexpr bool has_one ()
 When used as WeightSet. More...
 
static constexpr bool is_expressionset ()
 When used as WeightSet. More...
 
static constexpr bool is_free ()
 When used as WeightSet. More...
 
static constexpr star_status_t star_status ()
 When used as WeightSet. More...
 
static auto size (const value_t &v) -> size_t
 The size of v. More...
 
static auto compare (const value_t &l, const value_t &r) -> int
 Three-way comparison. More...
 
static auto less (const value_t &l, const value_t &r) -> bool
 Whether l < r. More...
 
static bool less_linear (const value_t &l, const value_t &r)
 Whether l < r, ignoring lweight. More...
 
static auto equal (const value_t &l, const value_t &r) -> bool
 Whether l == r. More...
 
static auto hash (const value_t &v) -> size_t
 Hash v. More...
 
static auto atom (const label_t &v) -> value_t
 Build a label. More...
 
static auto zero () -> value_t
 
static auto one () -> value_t
 

Private Member Functions

const self_tself () const
 Ourself, but after the application of weightset_mixin. More...
 
auto add_ (values_t &&vs) const -> value_t
 From a list of values, build a sum, taking care of the empty and singleton cases. More...
 
auto add_linear_ (const add_t &addends, const value_t &r) const -> value_t
 
auto add_linear_ (const add_t &s1, const add_t &s2) const -> value_t
 
auto add_linear_ (const value_t &l, const value_t &r) const -> value_t
 The sum of two non-zero series. More...
 
template<type_t Type>
void gather_ (values_t &res, const value_t &v) const
 Push v in res, applying associativity if possible. More...
 
template<type_t Type>
values_t gather_ (const value_t &l, const value_t &r) const
 A list denoting the gathering of l and r, applying associativity if possible. More...
 
auto concat_ (const value_t &l, const value_t &r, std::true_type) const -> value_t
 If labelset is wordset. More...
 
auto concat_ (const value_t &l, const value_t &r, std::false_type) const -> value_t
 If labelset is not wordset. More...
 
template<typename LabelSet_ , typename... Args>
auto letter_class_ (const Args &&... chars, std::true_type) const -> value_t
 If labelset is oneset. More...
 
template<typename LabelSet_ >
value_t letter_class_ (std::set< std::pair< typename LabelSet_::letter_t, typename LabelSet_::letter_t >> chars, bool accept, std::false_type) const
 If labelset is not oneset. More...
 

Static Private Member Functions

static auto unwrap_possible_lweight_ (const value_t &e) -> value_t
 If e is an lweight, then its child, otherwise e. More...
 
static type_t type_ignoring_lweight_ (const value_t &e)
 The type of e, or the type of its child if e is a lweight. More...
 
static weight_t possibly_implicit_lweight_ (const value_t &e)
 The weight of e if it's an lweight, otherwise the weight one(). More...
 

Private Attributes

context_t ctx_
 The context of the expressions. More...
 
const identities_t ids_
 The set of rewriting rules to apply. More...
 

Detailed Description

template<typename Context>
class vcsn::rat::expressionset_impl< Context >

A typed expression set.

Template Parameters
Contextthe LabelSet and WeightSet types.

Definition at line 32 of file expressionset.hh.

Member Typedef Documentation

◆ add_t

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::add_t = vcsn::rat:: add <context_t>

Definition at line 68 of file expressionset.hh.

◆ as_tupleset_t

template<typename Context >
template<typename Ctx = context_t>
using vcsn::rat::expressionset_impl< Context >::as_tupleset_t = typename as_tupleset_impl<typename labelset_t_of<Ctx>::indices_t::type>::type

If we are multitape, our type as a tupleset.

Definition at line 384 of file expressionset.hh.

◆ atom_t

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::atom_t = vcsn::rat:: atom <context_t>

Definition at line 69 of file expressionset.hh.

◆ complement_t

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::complement_t = vcsn::rat:: complement <context_t>

Definition at line 70 of file expressionset.hh.

◆ compose_t

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::compose_t = vcsn::rat:: compose <context_t>

Definition at line 71 of file expressionset.hh.

◆ conjunction_t

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::conjunction_t = vcsn::rat:: conjunction <context_t>

Definition at line 72 of file expressionset.hh.

◆ const_visitor

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::const_visitor = rat::const_visitor<context_t>

Definition at line 45 of file expressionset.hh.

◆ context_t

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::context_t = Context

Definition at line 36 of file expressionset.hh.

◆ identities_t

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::identities_t = rat::identities

Definition at line 44 of file expressionset.hh.

◆ infiltrate_t

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::infiltrate_t = vcsn::rat:: infiltrate <context_t>

Definition at line 73 of file expressionset.hh.

◆ inner_t

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::inner_t = vcsn::rat:: inner <context_t>

Definition at line 74 of file expressionset.hh.

◆ kind_t

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::kind_t = labels_are_expressions

Definition at line 39 of file expressionset.hh.

◆ label_t

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::label_t = label_t_of<context_t>

Definition at line 42 of file expressionset.hh.

◆ labelset_ptr

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::labelset_ptr = typename context_t::labelset_ptr

Definition at line 40 of file expressionset.hh.

◆ labelset_t

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::labelset_t = labelset_t_of<context_t>

Definition at line 37 of file expressionset.hh.

◆ ldivide_t

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::ldivide_t = vcsn::rat:: ldivide <context_t>

Definition at line 75 of file expressionset.hh.

◆ leaf_t

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::leaf_t = vcsn::rat:: leaf <context_t>

Definition at line 76 of file expressionset.hh.

◆ letter_t

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::letter_t = value_t

Definition at line 103 of file expressionset.hh.

◆ lweight_t

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::lweight_t = vcsn::rat:: lweight <context_t>

Definition at line 77 of file expressionset.hh.

◆ mul_t

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::mul_t = vcsn::rat:: mul <context_t>

Definition at line 81 of file expressionset.hh.

◆ name_t

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::name_t = vcsn::rat:: name <context_t>

Definition at line 78 of file expressionset.hh.

◆ node_t

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::node_t = vcsn::rat:: node <context_t>

Definition at line 79 of file expressionset.hh.

◆ one_t

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::one_t = vcsn::rat:: one <context_t>

Definition at line 80 of file expressionset.hh.

◆ project_t

template<typename Context >
template<unsigned Tape, typename Ctx = context_t>
using vcsn::rat::expressionset_impl< Context >::project_t = expressionset<detail::project_context<Tape, Ctx> >

The type of the expressionset for the Tape-th tape.

Definition at line 348 of file expressionset.hh.

◆ rweight_t

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::rweight_t = vcsn::rat:: rweight <context_t>

Definition at line 82 of file expressionset.hh.

◆ self_t

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::self_t = expressionset<Context>

Definition at line 35 of file expressionset.hh.

◆ shuffle_t

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::shuffle_t = vcsn::rat:: shuffle <context_t>

Definition at line 83 of file expressionset.hh.

◆ star_t

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::star_t = vcsn::rat:: star <context_t>

Definition at line 84 of file expressionset.hh.

◆ transposition_t

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::transposition_t = vcsn::rat:: transposition <context_t>

Definition at line 85 of file expressionset.hh.

◆ tuple_t

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::tuple_t = vcsn::rat:: tuple <context_t>

Definition at line 86 of file expressionset.hh.

◆ type_t

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::type_t = typename node_t::type_t

Type tag for AST classes.

Definition at line 93 of file expressionset.hh.

◆ unary_t

template<typename Context >
template<type_t Type>
using vcsn::rat::expressionset_impl< Context >::unary_t = unary<Type, context_t>

Definition at line 98 of file expressionset.hh.

◆ value_t

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::value_t = typename node_t::value_t

An expression (a shared pointer to a tree).

Definition at line 91 of file expressionset.hh.

◆ values_t

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::values_t = typename node_t::values_t

A list (vector) of expressions.

Definition at line 95 of file expressionset.hh.

◆ variadic_t

template<typename Context >
template<type_t Type>
using vcsn::rat::expressionset_impl< Context >::variadic_t = variadic<Type, context_t>

Definition at line 100 of file expressionset.hh.

◆ weight_t

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::weight_t = typename weightset_t::value_t

Definition at line 43 of file expressionset.hh.

◆ weightset_ptr

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::weightset_ptr = typename context_t::weightset_ptr

Definition at line 41 of file expressionset.hh.

◆ weightset_t

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::weightset_t = weightset_t_of<context_t>

Definition at line 38 of file expressionset.hh.

◆ word_t

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::word_t = value_t

Definition at line 102 of file expressionset.hh.

◆ zero_t

template<typename Context >
using vcsn::rat::expressionset_impl< Context >::zero_t = vcsn::rat:: zero <context_t>

Definition at line 87 of file expressionset.hh.

Constructor & Destructor Documentation

◆ expressionset_impl()

template<typename Context >
vcsn::rat::expressionset_impl< Context >::expressionset_impl ( const context_t ctx,
identities_t  ids = {} 
)

Constructor.

Parameters
ctxthe generator set for the labels, and the weight set.
idsthe identities to guarantee

Definition at line 31 of file expressionset.hxx.

References vcsn::rat::expressionset_impl< Context >::ids_, vcsn::rat::identities::is_distributive(), vcsn::require(), and vcsn::rat::expressionset_impl< Context >::weightset().

Here is the call graph for this function:

Member Function Documentation

◆ add()

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::add ( const value_t l,
const value_t r 
) const -> value_t

◆ add_()

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::add_ ( values_t &&  vs) const -> value_t
private

From a list of values, build a sum, taking care of the empty and singleton cases.

Definition at line 254 of file expressionset.hxx.

Referenced by vcsn::rat::expressionset_impl< Context >::as_tupleset().

◆ add_linear_() [1/3]

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::add_linear_ ( const add_t addends,
const value_t r 
) const -> value_t
private

◆ add_linear_() [2/3]

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::add_linear_ ( const add_t s1,
const add_t s2 
) const -> value_t
private

Definition at line 265 of file expressionset.hxx.

◆ add_linear_() [3/3]

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::add_linear_ ( const value_t l,
const value_t r 
) const -> value_t
private

The sum of two non-zero series.

Precondition
!is_zero(l)
!is_zero(r)

Definition at line 307 of file expressionset.hxx.

◆ as_tupleset()

template<typename Context >
template<typename Ctx = context_t>
auto vcsn::rat::expressionset_impl< Context >::as_tupleset ( ) const -> std::enable_if_t<Ctx::is_lat, as_tupleset_t<Ctx>>
inline

◆ atom()

◆ compare()

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::compare ( const value_t l,
const value_t r 
) -> int
static

◆ complement()

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::complement ( const value_t e) const -> value_t

Add a complement operator: e{c}.

Definition at line 856 of file expressionset.hxx.

References vcsn::rat::complement, down_pointer_cast, vcsn::rat::expressionset_impl< Context >::ids_, vcsn::rat::identities::is_trivial(), vcsn::rat::lweight, vcsn::res, and vcsn::rat::rweight.

Referenced by vcsn::rat::expressionset_impl< Context >::star_status().

Here is the call graph for this function:

◆ compose()

◆ concat()

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::concat ( const value_t l,
const value_t r 
) const -> value_t

Similar to mul, but in the case of LAW, merge the labels.

Mul(word(a),word(b)) -> mul(word(a), word(b))

but

Concat(word(a),word(b)) -> word(ab)

In other cases, synonym for mul.

Definition at line 762 of file expressionset.hxx.

References vcsn::rat::expressionset_impl< Context >::concat_().

Referenced by vcsn::rat::expressionset_impl< Context >::star_status().

Here is the call graph for this function:

◆ concat_() [1/2]

◆ concat_() [2/2]

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::concat_ ( const value_t l,
const value_t r,
std::false_type   
) const -> value_t
private

If labelset is not wordset.

Definition at line 771 of file expressionset.hxx.

References vcsn::rat::expressionset_impl< Context >::mul().

Here is the call graph for this function:

◆ conjunction()

◆ context()

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::context ( ) const

◆ conv() [1/10]

template<typename Context >
template<typename GenSet >
auto vcsn::rat::expressionset_impl< Context >::conv ( const letterset< GenSet > &  ls,
typename letterset< GenSet >::value_t  v 
) const -> value_t

Definition at line 1084 of file expressionset.hxx.

References vcsn::rat::expressionset_impl< Context >::atom(), vcsn::rat::expressionset_impl< Context >::labelset(), and vcsn::v.

Referenced by vcsn::rat::expressionset_impl< Context >::conv(), vcsn::rat::expressionset_impl< Context >::star_status(), and vcsn::rat::expressionset_impl< Context >::word().

Here is the call graph for this function:

◆ conv() [2/10]

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::conv ( b  ,
typename b::value_t  v 
) const -> value_t

Definition at line 1091 of file expressionset.hxx.

References vcsn::rat::expressionset_impl< Context >::one(), vcsn::v, and vcsn::rat::expressionset_impl< Context >::zero().

Here is the call graph for this function:

◆ conv() [3/10]

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::conv ( const z ws,
typename z::value_t  v 
) const -> value_t

Definition at line 1097 of file expressionset.hxx.

References vcsn::rat::expressionset_impl< Context >::conv(), vcsn::rat::expressionset_impl< Context >::lweight(), vcsn::rat::expressionset_impl< Context >::one(), vcsn::v, and vcsn::rat::expressionset_impl< Context >::weightset().

Here is the call graph for this function:

◆ conv() [4/10]

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::conv ( const q ws,
typename q::value_t  v 
) const -> value_t

Definition at line 1103 of file expressionset.hxx.

References vcsn::rat::expressionset_impl< Context >::conv(), vcsn::rat::expressionset_impl< Context >::lweight(), vcsn::rat::expressionset_impl< Context >::one(), vcsn::v, and vcsn::rat::expressionset_impl< Context >::weightset().

Here is the call graph for this function:

◆ conv() [5/10]

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::conv ( const r ws,
typename r::value_t  v 
) const -> value_t

Definition at line 1109 of file expressionset.hxx.

References vcsn::rat::expressionset_impl< Context >::conv(), vcsn::rat::expressionset_impl< Context >::lweight(), vcsn::rat::expressionset_impl< Context >::one(), vcsn::v, and vcsn::rat::expressionset_impl< Context >::weightset().

Here is the call graph for this function:

◆ conv() [6/10]

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::conv ( const nmin ws,
typename nmin::value_t  v 
) const -> value_t

◆ conv() [7/10]

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::conv ( const zmin ws,
typename zmin::value_t  v 
) const -> value_t

Definition at line 1115 of file expressionset.hxx.

References vcsn::rat::expressionset_impl< Context >::conv(), vcsn::rat::expressionset_impl< Context >::lweight(), vcsn::rat::expressionset_impl< Context >::one(), vcsn::v, and vcsn::rat::expressionset_impl< Context >::weightset().

Here is the call graph for this function:

◆ conv() [8/10]

template<typename Context >
template<typename Ctx2 >
auto vcsn::rat::expressionset_impl< Context >::conv ( const expressionset< Ctx2 > &  ws,
typename expressionset< Ctx2 >::value_t  v 
) const -> value_t

Definition at line 1124 of file expressionset.hxx.

References vcsn::rat::copy().

Here is the call graph for this function:

◆ conv() [9/10]

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::conv ( std::istream &  is,
bool  = true 
) const -> value_t

The next expression in a stream.

Definition at line 1132 of file expressionset.hxx.

References vcsn::rat::expressionset_impl< Context >::context(), vcsn::rat::expressionset_impl< Context >::identities(), vcsn::dyn::read_expression(), and vcsn::res.

Here is the call graph for this function:

◆ conv() [10/10]

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::conv ( const self_t rs,
const value_t v 
) const -> value_t

Convert from ourself: identity.

Definition at line 1072 of file expressionset.hxx.

References vcsn::rat::copy(), vcsn::rat::identities::ids_, vcsn::rat::expressionset_impl< Context >::ids_, and vcsn::v.

Here is the call graph for this function:

◆ convs()

template<typename Context >
template<typename Fun >
void vcsn::rat::expressionset_impl< Context >::convs ( std::istream &  ,
Fun   
) const
inline

Read a range of expressions.

Definition at line 332 of file expressionset.hh.

References vcsn::rat::expressionset_impl< Context >::print(), and vcsn::rat::expressionset_impl< Context >::print_set().

Here is the call graph for this function:

◆ equal()

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::equal ( const value_t l,
const value_t r 
) -> bool
static

Whether l == r.

Definition at line 1059 of file expressionset.hxx.

References vcsn::rat::expressionset_impl< Context >::compare().

Referenced by vcsn::rat::expressionset_impl< Context >::conjunction(), vcsn::rat::expressionset_impl< Context >::is_special(), and vcsn::rat::expressionset_impl< Context >::star_status().

Here is the call graph for this function:

◆ gather_() [1/4]

template<typename Context >
template<typename expressionset_impl< Context >::type_t Type>
auto vcsn::rat::expressionset_impl< Context >::gather_ ( values_t res,
const value_t v 
) const -> void

Definition at line 169 of file expressionset.hxx.

◆ gather_() [2/4]

template<typename Context >
template<typename expressionset_impl< Context >::type_t Type>
auto vcsn::rat::expressionset_impl< Context >::gather_ ( const value_t l,
const value_t r 
) const -> values_t

Definition at line 182 of file expressionset.hxx.

◆ gather_() [3/4]

template<typename Context >
template<type_t Type>
void vcsn::rat::expressionset_impl< Context >::gather_ ( values_t res,
const value_t v 
) const
private

Push v in res, applying associativity if possible.

Template Parameters
Typethe kind of expressions on which to apply associativity. Must be one of the variadic types.

Referenced by vcsn::rat::expressionset_impl< Context >::as_tupleset().

◆ gather_() [4/4]

template<typename Context >
template<type_t Type>
values_t vcsn::rat::expressionset_impl< Context >::gather_ ( const value_t l,
const value_t r 
) const
private

A list denoting the gathering of l and r, applying associativity if possible.

Template Parameters
Typethe kind of expressions on which to apply associativity. Must be one of the variadic types.

◆ has_lightening_weights()

template<typename Context >
static constexpr bool vcsn::rat::expressionset_impl< Context >::has_lightening_weights ( )
inlinestatic

When used as WeightSet.

Definition at line 189 of file expressionset.hh.

◆ has_one()

template<typename Context >
static constexpr bool vcsn::rat::expressionset_impl< Context >::has_one ( )
inlinestatic

When used as WeightSet.

Definition at line 195 of file expressionset.hh.

◆ hash()

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::hash ( const value_t v) -> size_t
static

Hash v.

Definition at line 1065 of file expressionset.hxx.

References vcsn::detail::hasher(), and vcsn::v.

Referenced by vcsn::rat::expressionset_impl< Context >::star_status().

Here is the call graph for this function:

◆ identities()

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::identities ( ) const

Accessor to the identities set.

Definition at line 124 of file expressionset.hxx.

Referenced by vcsn::rat::expressionset_impl< Context >::conv(), and vcsn::rat::expressionset_impl< Context >::print_set().

◆ infiltrate()

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::infiltrate ( const value_t l,
const value_t r 
) const -> value_t

Build an infiltration product: l &: r.

Definition at line 643 of file expressionset.hxx.

References vcsn::rat::expressionset_impl< Context >::ids_, vcsn::rat::expressionset_impl< Context >::is_one(), vcsn::rat::identities::is_trivial(), vcsn::rat::expressionset_impl< Context >::is_zero(), and vcsn::res.

Referenced by vcsn::rat::expressionset_impl< Context >::star_status().

Here is the call graph for this function:

◆ is_commutative()

template<typename Context >
static constexpr bool vcsn::rat::expressionset_impl< Context >::is_commutative ( )
inlinestatic

When used as WeightSet.

Definition at line 169 of file expressionset.hh.

◆ is_expressionset()

template<typename Context >
static constexpr bool vcsn::rat::expressionset_impl< Context >::is_expressionset ( )
inlinestatic

When used as WeightSet.

Definition at line 201 of file expressionset.hh.

◆ is_free()

template<typename Context >
static constexpr bool vcsn::rat::expressionset_impl< Context >::is_free ( )
inlinestatic

When used as WeightSet.

Definition at line 207 of file expressionset.hh.

◆ is_idempotent()

template<typename Context >
static constexpr bool vcsn::rat::expressionset_impl< Context >::is_idempotent ( )
inlinestatic

When used as WeightSet.

Definition at line 175 of file expressionset.hh.

◆ is_letter()

template<typename Context >
bool vcsn::rat::expressionset_impl< Context >::is_letter ( value_t  ) const
inline

When used as a LabelSet.

Definition at line 144 of file expressionset.hh.

References vcsn::rat::expressionset_impl< Context >::is_one(), vcsn::rat::expressionset_impl< Context >::is_universal(), vcsn::rat::expressionset_impl< Context >::is_zero(), and vcsn::v.

Here is the call graph for this function:

◆ is_letterized()

template<typename Context >
static constexpr bool vcsn::rat::expressionset_impl< Context >::is_letterized ( )
inlinestatic

When used as a labelset.

Definition at line 163 of file expressionset.hh.

◆ is_one()

◆ is_special()

template<typename Context >
static bool vcsn::rat::expressionset_impl< Context >::is_special ( const value_t v)
inlinestatic

When used as a LabelSet.

Definition at line 138 of file expressionset.hh.

References vcsn::rat::expressionset_impl< Context >::equal(), and vcsn::rat::expressionset_impl< Context >::special().

Here is the call graph for this function:

◆ is_universal()

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::is_universal ( const value_t v) const

Whether v is the 0{c}.

Definition at line 1026 of file expressionset.hxx.

References vcsn::rat::complement, vcsn::rat::expressionset_impl< Context >::is_zero(), and vcsn::v.

Referenced by vcsn::rat::expressionset_impl< Context >::conjunction(), and vcsn::rat::expressionset_impl< Context >::is_letter().

Here is the call graph for this function:

◆ is_zero()

◆ labelset()

◆ ldivide()

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::ldivide ( const value_t l,
const value_t r 
) const -> value_t

r`.

Definition at line 570 of file expressionset.hxx.

References vcsn::rat::expressionset_impl< Context >::ids_, vcsn::rat::expressionset_impl< Context >::is_one(), vcsn::rat::identities::is_trivial(), vcsn::rat::expressionset_impl< Context >::is_zero(), and vcsn::res.

Referenced by vcsn::rat::expressionset_impl< Context >::rdivide(), and vcsn::rat::expressionset_impl< Context >::star_status().

Here is the call graph for this function:

◆ less()

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::less ( const value_t l,
const value_t r 
) -> bool
static

Whether l < r.

Definition at line 1046 of file expressionset.hxx.

References vcsn::rat::expressionset_impl< Context >::compare().

Referenced by vcsn::rat::expressionset_impl< Context >::less_linear(), and vcsn::rat::expressionset_impl< Context >::star_status().

Here is the call graph for this function:

◆ less_linear()

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::less_linear ( const value_t l,
const value_t r 
)
static

Whether l < r, ignoring lweight.

Typically used for linear identities, where <2>a and <3>a are "equal" and should be merged into <5>a.

Definition at line 1052 of file expressionset.hxx.

References vcsn::rat::expressionset_impl< Context >::less(), and vcsn::rat::expressionset_impl< Context >::unwrap_possible_lweight_().

Referenced by vcsn::rat::expressionset_impl< Context >::star_status().

Here is the call graph for this function:

◆ letter_class()

template<typename Context >
template<typename... Args>
auto vcsn::rat::expressionset_impl< Context >::letter_class ( Args &&...  chars) const -> value_t

An expression matching one character amongst chars.

Definition at line 1160 of file expressionset.hxx.

References vcsn::rat::expressionset_impl< Context >::letter_class_().

Referenced by vcsn::rat::expressionset_impl< Context >::word().

Here is the call graph for this function:

◆ letter_class_() [1/4]

template<typename Context >
template<typename LabelSet_ , typename... Args>
auto vcsn::rat::expressionset_impl< Context >::letter_class_ ( const Args &&...  chars,
std::true_type   
) const -> value_t
private

◆ letter_class_() [2/4]

template<typename Context >
template<typename LabelSet_ >
value_t vcsn::rat::expressionset_impl< Context >::letter_class_ ( std::set< std::pair< typename LabelSet_::letter_t, typename LabelSet_::letter_t >>  chars,
bool  accept,
std::false_type   
) const
private

If labelset is not oneset.

◆ letter_class_() [3/4]

template<typename Context >
template<typename LabelSet_ >
auto vcsn::rat::expressionset_impl< Context >::letter_class_ ( std::set< std::pair< typename LabelSet_::letter_t, typename LabelSet_::letter_t >>  ccs,
bool  accept,
std::false_type   
) const -> value_t

◆ letter_class_() [4/4]

template<typename Context >
template<typename LabelSet_ , typename... Args>
auto vcsn::rat::expressionset_impl< Context >::letter_class_ ( const Args &&  ...,
std::true_type   
) const -> value_t

Definition at line 1238 of file expressionset.hxx.

References vcsn::rat::expressionset_impl< Context >::one().

Here is the call graph for this function:

◆ lweight()

◆ make()

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::make ( std::istream &  is)
static

Build from the description in is.

Definition at line 53 of file expressionset.hxx.

References vcsn::rat::ctx(), vcsn::eat(), and vcsn::rat::ids().

Here is the call graph for this function:

◆ mul()

◆ name()

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::name ( const value_t v,
symbol  name 
) const -> value_t

Build a named expression.

Definition at line 148 of file expressionset.hxx.

Referenced by vcsn::rat::expressionset_impl< Context >::star_status().

◆ one()

◆ open()

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::open ( bool  o) const

Whether unknown letters should be added, or rejected.

Parameters
owhether to accept unknown letters
Returns
the previous status.

Definition at line 113 of file expressionset.hxx.

◆ possibly_implicit_lweight_()

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::possibly_implicit_lweight_ ( const value_t e)
staticprivate

◆ power()

◆ print()

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::print ( const value_t v,
std::ostream &  o = std::cout,
format  fmt = {} 
) const -> std::ostream&

Definition at line 1142 of file expressionset.hxx.

References vcsn::rat::make_printer(), and vcsn::v.

Referenced by vcsn::rat::expressionset_impl< Context >::convs().

Here is the call graph for this function:

◆ print_set()

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::print_set ( std::ostream &  o,
format  fmt = {} 
) const -> std::ostream&

Format the description of this expressionset.

Definition at line 70 of file expressionset.hxx.

References vcsn::rat::expressionset_impl< Context >::context(), vcsn::rat::expressionset_impl< Context >::identities(), vcsn::rat::identities::is_distributive(), vcsn::format::latex, and vcsn::format::sname.

Referenced by vcsn::rat::expressionset_impl< Context >::convs().

Here is the call graph for this function:

◆ project() [1/2]

template<typename Context >
template<unsigned Tape>
auto vcsn::rat::expressionset_impl< Context >::project ( ) const -> project_t<Tape>
inline

The expressionset for the Tape-th tape.

Definition at line 352 of file expressionset.hh.

◆ project() [2/2]

template<typename Context >
template<size_t Tape>
auto vcsn::rat::expressionset_impl< Context >::project ( const value_t v) const -> decltype(::vcsn::rat::project<Tape>(this->self(), v))
inline

Project a multitape expression.

Definition at line 360 of file expressionset.hh.

◆ rdivide()

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::rdivide ( const value_t l,
const value_t r 
) const -> value_t

Build a right division: l {/} r.

Definition at line 592 of file expressionset.hxx.

References vcsn::rat::expressionset_impl< Context >::ldivide(), and vcsn::rat::expressionset_impl< Context >::transposition().

Referenced by vcsn::rat::expressionset_impl< Context >::star_status().

Here is the call graph for this function:

◆ rweight()

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::rweight ( const value_t e,
const weight_t w 
) const -> value_t

◆ self()

template<typename Context >
const self_t& vcsn::rat::expressionset_impl< Context >::self ( ) const
inlineprivate

Ourself, but after the application of weightset_mixin.

FIXME: this is ugly. It is due to the fact that instead of the CRTP, we used a mixin approach to add features to expressionset as opposed to expressionset_impl. Except that here, we have an expression_impl, and we need the expression. So after all, maybe the CRTP is a better approach.

Cannot be a reference member, as we do support assignments, in which case the copied self would point to the original this.

Definition at line 58 of file expressionset.hh.

◆ show_one()

template<typename Context >
static constexpr bool vcsn::rat::expressionset_impl< Context >::show_one ( )
inlinestatic

When used as WeightSet.

Definition at line 183 of file expressionset.hh.

◆ shuffle()

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::shuffle ( const value_t l,
const value_t r 
) const -> value_t

Build a shuffle product: l : r.

Definition at line 670 of file expressionset.hxx.

References vcsn::rat::expressionset_impl< Context >::ids_, vcsn::rat::expressionset_impl< Context >::is_one(), vcsn::rat::identities::is_trivial(), vcsn::rat::expressionset_impl< Context >::is_zero(), and vcsn::res.

Referenced by vcsn::rat::expressionset_impl< Context >::star_status().

Here is the call graph for this function:

◆ size()

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::size ( const value_t v) -> size_t
static

The size of v.

Definition at line 1033 of file expressionset.hxx.

References vcsn::v.

Referenced by vcsn::rat::expressionset_impl< Context >::star_status().

◆ sname()

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::sname ( )
static

Static description key.

Definition at line 45 of file expressionset.hxx.

References vcsn::res, and vcsn::sname().

Here is the call graph for this function:

◆ special()

template<typename Context >
static value_t vcsn::rat::expressionset_impl< Context >::special ( )
inlinestatic

When used as a LabelSet.

Definition at line 132 of file expressionset.hh.

References vcsn::rat::expressionset_impl< Context >::atom().

Referenced by vcsn::rat::expressionset_impl< Context >::is_special().

Here is the call graph for this function:

◆ star()

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::star ( const value_t e) const -> value_t

◆ star_status()

template<typename Context >
static constexpr star_status_t vcsn::rat::expressionset_impl< Context >::star_status ( )
inlinestatic

When used as WeightSet.

Definition at line 213 of file expressionset.hh.

References vcsn::rat::expressionset_impl< Context >::add(), vcsn::rat::expressionset_impl< Context >::atom(), vcsn::rat::expressionset_impl< Context >::compare(), vcsn::rat::expressionset_impl< Context >::complement(), vcsn::rat::expressionset_impl< Context >::compose(), vcsn::rat::expressionset_impl< Context >::concat(), vcsn::rat::expressionset_impl< Context >::conjunction(), vcsn::rat::expressionset_impl< Context >::conv(), vcsn::rat::expressionset_impl< Context >::equal(), vcsn::rat::expressionset_impl< Context >::hash(), vcsn::rat::expressionset_impl< Context >::infiltrate(), vcsn::rat::expressionset_impl< Context >::ldivide(), vcsn::rat::expressionset_impl< Context >::less(), vcsn::rat::expressionset_impl< Context >::less_linear(), vcsn::rat::expressionset_impl< Context >::lweight(), vcsn::rat::expressionset_impl< Context >::mul(), vcsn::rat::expressionset_impl< Context >::name(), vcsn::rat::expressionset_impl< Context >::one(), vcsn::rat::expressionset_impl< Context >::power(), vcsn::rat::expressionset_impl< Context >::rdivide(), vcsn::rat::expressionset_impl< Context >::rweight(), vcsn::rat::expressionset_impl< Context >::shuffle(), vcsn::rat::expressionset_impl< Context >::size(), vcsn::rat::expressionset_impl< Context >::star(), vcsn::STARRABLE, vcsn::rat::expressionset_impl< Context >::transpose(), vcsn::rat::expressionset_impl< Context >::transposition(), vcsn::rat::expressionset_impl< Context >::tuple(), vcsn::weightset_mixin< WeightSet >::value_t, and vcsn::rat::expressionset_impl< Context >::zero().

Here is the call graph for this function:

◆ transpose()

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::transpose ( const value_t e) const -> value_t

The transposed of this rational expression.

Definition at line 1151 of file expressionset.hxx.

References vcsn::transpose(), and vcsn::v.

Referenced by vcsn::rat::expressionset_impl< Context >::star_status(), and vcsn::rat::expressionset_impl< Context >::transposition().

Here is the call graph for this function:

◆ transposition()

◆ tuple()

template<typename Context >
template<typename... Value>
auto vcsn::rat::expressionset_impl< Context >::tuple ( Value &&...  v) const -> value_t

◆ type_ignoring_lweight_()

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::type_ignoring_lweight_ ( const value_t e)
staticprivate

◆ unwrap_possible_lweight_()

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::unwrap_possible_lweight_ ( const value_t e) -> value_t
staticprivate

◆ weightset()

◆ word()

template<typename Context >
auto vcsn::rat::expressionset_impl< Context >::word ( label_t  l) const -> word_t
inline

Make a `word' out of an expression.

Definition at line 315 of file expressionset.hh.

References vcsn::rat::expressionset_impl< Context >::conv(), and vcsn::rat::expressionset_impl< Context >::letter_class().

Here is the call graph for this function:

◆ zero()

Member Data Documentation

◆ ctx_

template<typename Context >
context_t vcsn::rat::expressionset_impl< Context >::ctx_
private

The context of the expressions.

Definition at line 500 of file expressionset.hh.

◆ ids_


The documentation for this class was generated from the following files: