Vcsn
2.0
Be Rational
|
A typed ratexp set. More...
#include <fwd.hh>
Public Member Functions | |
std::string | vname (bool full=true) const |
Dynamic description key. More... | |
ratexpset_impl (const context_t &ctx, identities_t identities) | |
Constructor. More... | |
bool | open (bool o) const |
Whether unknown letters should be added, or rejected. More... | |
const context_t & | context () const |
Accessor to the context. More... | |
identities_t | identities () const |
Accessor to the identities set. More... | |
bool | is_series () const |
const labelset_ptr & | labelset () const |
Accessor to the labelset. More... | |
const weightset_ptr & | weightset () const |
Accessor to the weightset. More... | |
bool | is_letter (value_t) const |
When used as a LabelSet. More... | |
bool | is_zero (value_t v) const ATTRIBUTE_PURE |
When used as WeightSet. More... | |
template<typename GenSet > | |
value_t | conv (const letterset< GenSet > &ls, typename letterset< GenSet >::value_t v) const |
value_t | conv (b, typename b::value_t v) const |
value_t | conv (const z &ws, typename z::value_t v) const |
value_t | conv (const q &ws, typename q::value_t v) const |
value_t | conv (const r &ws, typename r::value_t v) const |
value_t | conv (const zmin &ws, typename zmin::value_t v) const |
template<typename Ctx2 > | |
value_t | conv (const ratexpset_impl< Ctx2 > &ws, typename ratexpset_impl< Ctx2 >::value_t v) const |
value_t | zero () const |
value_t | add (value_t l, value_t r) const |
value_t | mul (value_t l, value_t r) const |
value_t | concat (value_t l, value_t r) const |
value_t | conjunction (value_t l, value_t r) const |
value_t | shuffle (value_t l, value_t r) const |
value_t | ldiv (value_t l, value_t r) const |
value_t | rdiv (value_t l, value_t r) const |
value_t | star (value_t e) const |
value_t | complement (value_t e) const |
Add a complement operator. More... | |
value_t | transposition (value_t e) const |
Add a transposition operator. More... | |
value_t | rmul (value_t e, const weight_t &w) const |
Right-multiplication by a weight. More... | |
value_t | lmul (const weight_t &w, value_t e) const |
Left-multiplication by a weight. More... | |
value_t | transpose (value_t e) const |
The transposed of this rational expression. More... | |
word_t | word (label_t l) const |
Make a `word' out of a ratexp. More... | |
template<typename... Args> | |
value_t | letter_class (Args &&...chars) const |
A ratexp matching one character amongst chars. More... | |
value_t | conv (std::istream &is) const |
Parsing a ratexp in a stream. More... | |
value_t | conv (self_type, value_t v) const |
Converting from ourself: identity. More... | |
std::set< value_t > | convs (std::istream &) const |
Read a range of ratexps. More... | |
std::ostream & | print (const value_t v, std::ostream &o, symbol format=symbol{"text"}) const |
std::ostream & | print_set (std::ostream &o, symbol format=symbol{"text"}) const |
template<typename ratexpset_impl< Context >::type_t Type> | |
auto | gather_ (values_t &res, value_t v) const -> void |
template<typename ratexpset_impl< Context >::type_t Type> | |
auto | gather_ (value_t l, value_t r) const -> values_t |
template<typename GenSet > | |
auto | conv (const letterset< GenSet > &ls, typename letterset< GenSet >::value_t v) const -> value_t |
template<typename Ctx2 > | |
auto | conv (const ratexpset_impl< Ctx2 > &rs, typename ratexpset_impl< Ctx2 >::value_t r) const -> value_t |
template<typename... Args> | |
auto | letter_class (Args &&...args) const -> value_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 std::string | sname () |
Static description key. More... | |
static self_type | 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 (value_t v) |
When used as a LabelSet. More... | |
static bool | is_one (value_t v) ATTRIBUTE_PURE |
When used as WeightSet. 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_one () |
When used as WeightSet. More... | |
static constexpr bool | is_ratexpset () |
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 bool | less_than (value_t l, value_t r) |
Whether l < r. More... | |
static bool | equals (value_t l, value_t r) |
Whether l == r. More... | |
static size_t | hash (const value_t &l) |
Hash l. More... | |
static auto | atom (const label_t &v) -> value_t |
Build a label. More... | |
static value_t | one () |
Private Member Functions | |
void | require_weightset_commutativity () const |
bool | less_than_ignoring_weight_ (value_t l, value_t r) const |
value_t | remove_from_sum_series_ (values_t addends, typename values_t::iterator i) const |
value_t | insert_in_sum_series_ (const sum_t &addends, value_t r) const |
value_t | merge_sum_series_ (const sum_t &addends1, value_t aa2) const |
value_t | add_nonzero_series_ (value_t l, value_t r) const |
type_t | type_ignoring_lweight_ (value_t e) const |
weight_t | possibly_implicit_lweight_ (value_t e) const |
value_t | unwrap_possible_lweight_ (value_t e) const |
value_t | mul_expressions_ (value_t l, value_t r) const |
value_t | mul_series_ (value_t l, value_t r) const |
value_t | mul_ (value_t l, value_t r, bool series) const |
bool | is_unweighted_nonsum_ (value_t v) const |
bool | is_nonsum_ (value_t v) const |
value_t | mul_atoms_ (const label_t &l, const label_t &r) const |
value_t | mul_atoms_ (const label_t &l, const label_t &r, std::true_type) const |
If labelset is wordset. More... | |
value_t | mul_atoms_ (const label_t &l, const label_t &r, std::false_type) const |
If labelset is not wordset. More... | |
value_t | mul_unweighted_nontrivial_products_ (value_t a, value_t b) const |
value_t | mul_products_ (value_t a, value_t b) const |
value_t | nontrivial_mul_expressions_ (value_t l, value_t r) const |
value_t | nontrivial_mul_series_ (value_t l, value_t r) const |
template<type_t Type> | |
void | gather_ (values_t &res, value_t v) const |
Push v in res, applying associativity if possible. More... | |
template<type_t Type> | |
values_t | gather_ (value_t l, value_t r) const |
A list denoting the gathering of l and r, applying associativity if possible. More... | |
value_t | concat_ (value_t l, value_t r, std::true_type) const |
If labelset is wordset. More... | |
value_t | concat_ (value_t l, value_t r, std::false_type) const |
If labelset is not wordset. More... | |
template<typename LabelSet_ , typename... Args> | |
value_t | letter_class_ (const Args &&...chars, std::true_type) const |
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... | |
Private Attributes | |
context_t | ctx_ |
const identities_t | identities_ |
A typed ratexp set.
Context | the LabelSet and WeightSet types. |
using vcsn::rat::ratexpset_impl< Context >::atom_t = vcsn::rat:: atom <context_t> |
Definition at line 50 of file ratexpset.hh.
using vcsn::rat::ratexpset_impl< Context >::complement_t = vcsn::rat:: complement <context_t> |
Definition at line 51 of file ratexpset.hh.
using vcsn::rat::ratexpset_impl< Context >::conjunction_t = vcsn::rat:: conjunction <context_t> |
Definition at line 53 of file ratexpset.hh.
using vcsn::rat::ratexpset_impl< Context >::const_visitor = rat::const_visitor<context_t> |
Definition at line 42 of file ratexpset.hh.
using vcsn::rat::ratexpset_impl< Context >::context_t = Context |
Definition at line 33 of file ratexpset.hh.
using vcsn::rat::ratexpset_impl< Context >::identities_t = rat::identities |
Definition at line 41 of file ratexpset.hh.
using vcsn::rat::ratexpset_impl< Context >::inner_t = vcsn::rat:: inner <context_t> |
Definition at line 52 of file ratexpset.hh.
using vcsn::rat::ratexpset_impl< Context >::kind_t = labels_are_ratexps |
Definition at line 36 of file ratexpset.hh.
using vcsn::rat::ratexpset_impl< Context >::label_t = label_t_of<context_t> |
Definition at line 39 of file ratexpset.hh.
using vcsn::rat::ratexpset_impl< Context >::labelset_ptr = typename context_t::labelset_ptr |
Definition at line 37 of file ratexpset.hh.
using vcsn::rat::ratexpset_impl< Context >::labelset_t = labelset_t_of<context_t> |
Definition at line 34 of file ratexpset.hh.
using vcsn::rat::ratexpset_impl< Context >::ldiv_t = vcsn::rat:: ldiv <context_t> |
Definition at line 55 of file ratexpset.hh.
using vcsn::rat::ratexpset_impl< Context >::leaf_t = vcsn::rat:: leaf <context_t> |
Definition at line 54 of file ratexpset.hh.
using vcsn::rat::ratexpset_impl< Context >::letter_t = self_type |
Definition at line 81 of file ratexpset.hh.
using vcsn::rat::ratexpset_impl< Context >::lweight_t = vcsn::rat:: lweight <context_t> |
Definition at line 56 of file ratexpset.hh.
using vcsn::rat::ratexpset_impl< Context >::node_t = vcsn::rat:: node <context_t> |
Definition at line 57 of file ratexpset.hh.
using vcsn::rat::ratexpset_impl< Context >::one_t = vcsn::rat:: one <context_t> |
Definition at line 58 of file ratexpset.hh.
using vcsn::rat::ratexpset_impl< Context >::prod_t = vcsn::rat:: prod <context_t> |
Definition at line 59 of file ratexpset.hh.
using vcsn::rat::ratexpset_impl< Context >::rweight_t = vcsn::rat:: rweight <context_t> |
Definition at line 60 of file ratexpset.hh.
using vcsn::rat::ratexpset_impl< Context >::self_type = ratexpset<Context> |
Definition at line 32 of file ratexpset.hh.
using vcsn::rat::ratexpset_impl< Context >::shuffle_t = vcsn::rat:: shuffle <context_t> |
Definition at line 61 of file ratexpset.hh.
using vcsn::rat::ratexpset_impl< Context >::star_t = vcsn::rat:: star <context_t> |
Definition at line 62 of file ratexpset.hh.
using vcsn::rat::ratexpset_impl< Context >::sum_t = vcsn::rat:: sum <context_t> |
Definition at line 63 of file ratexpset.hh.
using vcsn::rat::ratexpset_impl< Context >::transposition_t = vcsn::rat:: transposition <context_t> |
Definition at line 64 of file ratexpset.hh.
using vcsn::rat::ratexpset_impl< Context >::type_t = typename node_t::type_t |
Type tag for AST classes.
Definition at line 71 of file ratexpset.hh.
using vcsn::rat::ratexpset_impl< Context >::unary_t = unary<Type, context_t> |
Definition at line 76 of file ratexpset.hh.
using vcsn::rat::ratexpset_impl< Context >::value_t = typename node_t::value_t |
A ratexp (a shared pointer to a tree).
Definition at line 69 of file ratexpset.hh.
using vcsn::rat::ratexpset_impl< Context >::values_t = typename node_t::values_t |
A list (vector) of ratexps.
Definition at line 73 of file ratexpset.hh.
using vcsn::rat::ratexpset_impl< Context >::variadic_t = variadic<Type, context_t> |
Definition at line 78 of file ratexpset.hh.
using vcsn::rat::ratexpset_impl< Context >::weight_t = typename weightset_t::value_t |
Definition at line 40 of file ratexpset.hh.
using vcsn::rat::ratexpset_impl< Context >::weightset_ptr = typename context_t::weightset_ptr |
Definition at line 38 of file ratexpset.hh.
using vcsn::rat::ratexpset_impl< Context >::weightset_t = weightset_t_of<context_t> |
Definition at line 35 of file ratexpset.hh.
using vcsn::rat::ratexpset_impl< Context >::word_t = self_type |
Definition at line 80 of file ratexpset.hh.
using vcsn::rat::ratexpset_impl< Context >::zero_t = vcsn::rat:: zero <context_t> |
Definition at line 65 of file ratexpset.hh.
vcsn::rat::ratexpset_impl< Context >::ratexpset_impl | ( | const context_t & | ctx, |
identities_t | identities | ||
) |
Constructor.
ctx | the generator set for the labels, and the weight set. |
identities | the identities to guarantee |
Definition at line 27 of file ratexpset.hxx.
References vcsn::rat::ratexpset_impl< Context >::require_weightset_commutativity().
|
inline |
Definition at line 173 of file ratexpset.hxx.
References vcsn::rat::zero.
|
inlineprivate |
Definition at line 260 of file ratexpset.hxx.
References down_pointer_cast, and vcsn::rat::sum.
|
inlinestatic |
Build a label.
Definition at line 125 of file ratexpset.hxx.
Referenced by vcsn::rat::ratexpset_impl< Context >::special().
|
inline |
Add a complement operator.
Definition at line 618 of file ratexpset.hxx.
|
inline |
Definition at line 551 of file ratexpset.hxx.
|
inlineprivate |
If labelset is wordset.
Definition at line 565 of file ratexpset.hxx.
References vcsn::rat::atom, and vcsn::rat::prod.
|
inlineprivate |
If labelset is not wordset.
Definition at line 558 of file ratexpset.hxx.
|
inline |
Definition at line 464 of file ratexpset.hxx.
References vcsn::rat::atom, down_pointer_cast, vcsn::rat::one, and vcsn::rat::zero.
|
inline |
Accessor to the context.
Definition at line 100 of file ratexpset.hxx.
value_t vcsn::rat::ratexpset_impl< Context >::conv | ( | const letterset< GenSet > & | ls, |
typename letterset< GenSet >::value_t | v | ||
) | const |
|
inline |
Definition at line 784 of file ratexpset.hxx.
|
inline |
Definition at line 790 of file ratexpset.hxx.
References vcsn::conv().
|
inline |
Definition at line 796 of file ratexpset.hxx.
References vcsn::conv().
|
inline |
Definition at line 802 of file ratexpset.hxx.
References vcsn::conv().
|
inline |
Definition at line 808 of file ratexpset.hxx.
References vcsn::conv().
value_t vcsn::rat::ratexpset_impl< Context >::conv | ( | const ratexpset_impl< Ctx2 > & | ws, |
typename ratexpset_impl< Ctx2 >::value_t | v | ||
) | const |
|
inline |
Parsing a ratexp in a stream.
Definition at line 825 of file ratexpset.hxx.
References is, vcsn::dyn::make_ratexpset(), and vcsn::dyn::read_ratexp().
|
inline |
Converting from ourself: identity.
Definition at line 764 of file ratexpset.hxx.
References vcsn::rat::copy().
|
inline |
Definition at line 777 of file ratexpset.hxx.
References vcsn::conv().
|
inline |
Definition at line 818 of file ratexpset.hxx.
References vcsn::rat::copy().
|
inline |
Read a range of ratexps.
Definition at line 246 of file ratexpset.hh.
References vcsn::rat::ratexpset_impl< Context >::vname().
|
inlinestatic |
Whether l == r.
Definition at line 751 of file ratexpset.hxx.
References vcsn::less_than().
Referenced by vcsn::rat::ratexpset_impl< Context >::is_special().
|
inline |
Definition at line 149 of file ratexpset.hxx.
|
inline |
Definition at line 164 of file ratexpset.hxx.
|
private |
Push v in res, applying associativity if possible.
Type | the kind of ratexps on which to apply associativity. Must be sum, conjunction, shuffle, or prod. |
|
private |
A list denoting the gathering of l and r, applying associativity if possible.
Type | the kind of ratexps on which to apply associativity. Must be SUM or PROD. |
|
inlinestatic |
When used as WeightSet.
Definition at line 159 of file ratexpset.hh.
|
inlinestatic |
Hash l.
Definition at line 757 of file ratexpset.hxx.
|
inline |
Accessor to the identities set.
Definition at line 105 of file ratexpset.hxx.
|
inlineprivate |
Definition at line 216 of file ratexpset.hxx.
References vcsn::rat::copy().
|
inlinestatic |
When used as WeightSet.
Definition at line 139 of file ratexpset.hh.
|
inlinestatic |
When used as WeightSet.
Definition at line 171 of file ratexpset.hh.
|
inlinestatic |
When used as WeightSet.
Definition at line 145 of file ratexpset.hh.
|
inline |
When used as a LabelSet.
Definition at line 127 of file ratexpset.hh.
|
inlineprivate |
Definition at line 367 of file ratexpset.hxx.
|
inlinestatic |
|
inlinestatic |
When used as WeightSet.
Definition at line 165 of file ratexpset.hh.
|
inline |
Definition at line 110 of file ratexpset.hxx.
References vcsn::rat::series.
|
inlinestatic |
When used as a LabelSet.
Definition at line 121 of file ratexpset.hh.
References vcsn::rat::ratexpset_impl< Context >::equals(), and vcsn::rat::ratexpset_impl< Context >::special().
|
inlineprivate |
Definition at line 352 of file ratexpset.hxx.
References vcsn::rat::lweight, and vcsn::rat::sum.
|
inline |
|
inline |
Accessor to the labelset.
Definition at line 115 of file ratexpset.hxx.
|
inline |
Definition at line 505 of file ratexpset.hxx.
References vcsn::rat::one, and vcsn::rat::zero.
|
inlinestatic |
Whether l < r.
Definition at line 733 of file ratexpset.hxx.
|
inlineprivate |
Definition at line 191 of file ratexpset.hxx.
References vcsn::less_than().
value_t vcsn::rat::ratexpset_impl< Context >::letter_class | ( | Args &&... | chars | ) | const |
A ratexp matching one character amongst chars.
|
inline |
Definition at line 854 of file ratexpset.hxx.
|
private |
If labelset is oneset.
|
private |
If labelset is not oneset.
|
inline |
Definition at line 866 of file ratexpset.hxx.
References vcsn::find(), vcsn::has(), vcsn::require(), and vcsn::rat::to_string().
|
inline |
Definition at line 926 of file ratexpset.hxx.
|
inline |
Left-multiplication by a weight.
Definition at line 655 of file ratexpset.hxx.
References down_pointer_cast, vcsn::rat::sum, and vcsn::rat::zero.
|
inlinestatic |
Build from the description in is.
Definition at line 77 of file ratexpset.hxx.
References vcsn::eat(), is, and vcsn::rat::trivial.
|
inlineprivate |
Definition at line 251 of file ratexpset.hxx.
|
inline |
Definition at line 307 of file ratexpset.hxx.
|
inlineprivate |
Definition at line 328 of file ratexpset.hxx.
References vcsn::rat::one, vcsn::rat::series, and vcsn::rat::zero.
|
inlineprivate |
Definition at line 373 of file ratexpset.hxx.
|
inlineprivate |
If labelset is wordset.
Definition at line 379 of file ratexpset.hxx.
|
inlineprivate |
If labelset is not wordset.
Definition at line 385 of file ratexpset.hxx.
|
inlineprivate |
Definition at line 316 of file ratexpset.hxx.
|
inlineprivate |
Definition at line 408 of file ratexpset.hxx.
References vcsn::rat::one.
|
inlineprivate |
Definition at line 322 of file ratexpset.hxx.
|
inlineprivate |
Definition at line 391 of file ratexpset.hxx.
|
inlineprivate |
Definition at line 427 of file ratexpset.hxx.
|
inlineprivate |
Definition at line 433 of file ratexpset.hxx.
References vcsn::rat::sum.
|
inlinestatic |
Definition at line 139 of file ratexpset.hxx.
|
inline |
Whether unknown letters should be added, or rejected.
o | whether to accept unknown letters |
Definition at line 94 of file ratexpset.hxx.
|
inlineprivate |
Definition at line 289 of file ratexpset.hxx.
|
inline |
Definition at line 833 of file ratexpset.hxx.
References vcsn::print().
|
inline |
Definition at line 255 of file ratexpset.hh.
|
inline |
Definition at line 523 of file ratexpset.hxx.
|
inlineprivate |
Definition at line 197 of file ratexpset.hxx.
|
private |
Definition at line 36 of file ratexpset.hxx.
References vcsn::require(), and vcsn::rat::series.
Referenced by vcsn::rat::ratexpset_impl< Context >::ratexpset_impl().
|
inline |
Right-multiplication by a weight.
Definition at line 682 of file ratexpset.hxx.
References down_pointer_cast, and vcsn::rat::sum.
|
inlinestatic |
When used as WeightSet.
Definition at line 153 of file ratexpset.hh.
|
inline |
Definition at line 530 of file ratexpset.hxx.
References vcsn::rat::one, and vcsn::rat::zero.
|
inlinestatic |
Static description key.
Definition at line 49 of file ratexpset.hxx.
References vcsn::sname().
|
inlinestatic |
When used as a LabelSet.
Definition at line 115 of file ratexpset.hh.
References vcsn::rat::ratexpset_impl< Context >::atom().
Referenced by vcsn::rat::ratexpset_impl< Context >::is_special().
|
inline |
Definition at line 602 of file ratexpset.hxx.
References vcsn::is_valid(), vcsn::require(), and vcsn::rat::zero.
|
inlinestatic |
|
inline |
The transposed of this rational expression.
Definition at line 843 of file ratexpset.hxx.
|
inline |
Add a transposition operator.
Definition at line 631 of file ratexpset.hxx.
References vcsn::rat::one, and vcsn::rat::zero.
|
inlineprivate |
Definition at line 283 of file ratexpset.hxx.
|
inlineprivate |
Definition at line 298 of file ratexpset.hxx.
|
inline |
Dynamic description key.
Definition at line 55 of file ratexpset.hxx.
References vcsn::rat::series, and vcsn::rat::trivial.
Referenced by vcsn::rat::ratexpset_impl< Context >::convs().
|
inline |
Accessor to the weightset.
Definition at line 120 of file ratexpset.hxx.
|
inline |
Make a `word' out of a ratexp.
Definition at line 230 of file ratexpset.hh.
|
inline |
Definition at line 133 of file ratexpset.hxx.
|
private |
Definition at line 341 of file ratexpset.hh.
|
private |
Definition at line 342 of file ratexpset.hh.