![]() |
Vcsn
2.4
Be Rational
|
Implementation of labels are nullables (letter or empty). More...
#include <fwd.hh>
Public Types | |
| using | labelset_t = LabelSet |
| using | labelset_ptr = std::shared_ptr< const labelset_t > |
| using | self_t = nullableset |
| using | helper_t = detail::nullable_helper< labelset_t > |
| using | kind_t = labels_are_nullable |
| using | value_t = typename helper_t::value_t |
| using | letter_t = typename labelset_t::letter_t |
| using | word_t = typename labelset_t::word_t |
| using | genset_ptr = decltype(ls_->genset()) |
| using | genset_t = decltype(ls_->generators()) |
Public Member Functions | |
| nullableset (const labelset_ptr &ls) | |
| nullableset (const labelset_t &ls={}) | |
| bool | open (bool o) const |
| Whether unknown letters should be added, or rejected. More... | |
| bool | is_valid (value_t v) const |
| genset_ptr | genset () const |
| decltype(auto) | generators () const |
| The generators. Meaningful for labelsets only. More... | |
| value_t | conv (self_t, value_t v) const |
| value_t | conv (oneset, typename oneset::value_t) const |
| template<typename LabelSet_ > | |
| value_t | conv (const LabelSet_ &ls, typename LabelSet_::value_t v) const |
| Conversion from another type: first by the wrapped labelset, and then by our wrappers (in case the wrapped labelset does not support "one"). More... | |
| const labelset_ptr | labelset () const |
| template<typename... Args> | |
| value_t | value (Args &&...args) const |
| word_t | word (const value_t &l) const |
| auto | letters_of_padded (const word_t &v, letter_t l) const -> decltype(ls_->letters_of_padded(v, l)) |
| Prepare to iterate over the letters of v. More... | |
| auto | letters_of_padded (value_t v, letter_t l) const -> decltype(this->letters_of_padded(this->word(v), l)) |
| value_t | mul (const value_t &l, const value_t &r) const |
| The concatenation. More... | |
| value_t | lgcd (const value_t &l, const value_t &r) const |
| The longest common prefix. More... | |
| value_t | ldivide (const value_t &l, const value_t &r) const |
| Compute l \ r = l^{-1}r. More... | |
| boost::optional< value_t > | maybe_ldivide (const value_t &l, const value_t &r) const |
| value_t | rdivide (const value_t &l, const value_t &r) const |
| Compute l / r. More... | |
| boost::optional< value_t > | maybe_rdivide (const value_t &l, const value_t &r) const |
| letter_t | get_letter (std::istream &i, bool quoted=true) const |
| value_t | conv (std::istream &i, bool quoted=true) const |
| Read a label from a stream. More... | |
| template<typename Fun > | |
| void | convs (std::istream &i, Fun &&fun) const |
| Process a label class. More... | |
| value_t | conjunction (const value_t &l, const value_t &r) const |
| std::ostream & | print (const value_t &l, std::ostream &o=std::cout, format fmt={}) const |
| Print label to stream. More... | |
| value_t | zero () const |
| bool | is_zero (const value_t &v) const |
| bool | is_letter (const value_t &v) const |
| template<typename Value > | |
| Value | transpose (const Value &l) const |
| Mirror label. More... | |
| std::ostream & | print_set (std::ostream &o, format fmt={}) const |
| Print labelset description. More... | |
Static Public Member Functions | |
| static symbol | sname () |
| static nullableset | make (std::istream &is) |
| Build from the description in is. More... | |
| static constexpr bool | has_one () |
| static constexpr bool | is_expressionset () |
| static constexpr bool | is_letterized () |
| static constexpr bool | is_free () |
| static ATTRIBUTE_PURE constexpr value_t | one () |
| static ATTRIBUTE_PURE bool | is_one (value_t l) |
| static auto | letters_of (const word_t &v) -> decltype(labelset_t::letters_of(v)) |
| Prepare to iterate over the letters of v. More... | |
| static bool | equal (const value_t &l, const value_t &r) |
| Whether l == r. More... | |
| static bool | less (const value_t &l, const value_t &r) |
| Whether l < r. More... | |
| static value_t | special () |
| static bool | is_special (const value_t &v) |
| static size_t | size (const value_t &v) |
| static size_t | hash (const value_t &v) |
| static labelset_t::value_t | get_value (const value_t &v) |
| The (inner) value when it (the outer value) is not one. More... | |
Private Attributes | |
| labelset_ptr | ls_ |
| The wrapped LabelSet. More... | |
Implementation of labels are nullables (letter or empty).
| using vcsn::nullableset< LabelSet >::genset_ptr = decltype(ls_->genset()) |
Definition at line 177 of file nullableset.hh.
| using vcsn::nullableset< LabelSet >::genset_t = decltype(ls_->generators()) |
Definition at line 178 of file nullableset.hh.
| using vcsn::nullableset< LabelSet >::helper_t = detail::nullable_helper<labelset_t> |
Definition at line 164 of file nullableset.hh.
| using vcsn::nullableset< LabelSet >::kind_t = labels_are_nullable |
Definition at line 165 of file nullableset.hh.
| using vcsn::nullableset< LabelSet >::labelset_ptr = std::shared_ptr<const labelset_t> |
Definition at line 162 of file nullableset.hh.
| using vcsn::nullableset< LabelSet >::labelset_t = LabelSet |
Definition at line 161 of file nullableset.hh.
| using vcsn::nullableset< LabelSet >::letter_t = typename labelset_t::letter_t |
Definition at line 168 of file nullableset.hh.
| using vcsn::nullableset< LabelSet >::self_t = nullableset |
Definition at line 163 of file nullableset.hh.
| using vcsn::nullableset< LabelSet >::value_t = typename helper_t::value_t |
Definition at line 167 of file nullableset.hh.
| using vcsn::nullableset< LabelSet >::word_t = typename labelset_t::word_t |
Definition at line 169 of file nullableset.hh.
|
inline |
Definition at line 181 of file nullableset.hh.
|
inline |
Definition at line 185 of file nullableset.hh.
|
inline |
Definition at line 500 of file nullableset.hh.
References vcsn::nullableset< LabelSet >::get_value(), vcsn::nullableset< LabelSet >::is_one(), and vcsn::to_string().
|
inline |
Definition at line 272 of file nullableset.hh.
References vcsn::v.
|
inline |
Definition at line 278 of file nullableset.hh.
References vcsn::nullableset< LabelSet >::one().
|
inline |
Conversion from another type: first by the wrapped labelset, and then by our wrappers (in case the wrapped labelset does not support "one").
Definition at line 288 of file nullableset.hh.
References vcsn::nullableset< LabelSet >::value().
|
inline |
Read a label from a stream.
Definition at line 463 of file nullableset.hh.
References vcsn::nullableset< LabelSet >::value().
|
inline |
Process a label class.
Stream i is right on a [. Read up to the closing ], and process the labels.
For instance "[a-d0-9_]".
| i | the input stream. |
| fun | a (label_t) -> void function. |
Definition at line 491 of file nullableset.hh.
References vcsn::nullableset< LabelSet >::value().
|
inlinestatic |
Whether l == r.
Definition at line 339 of file nullableset.hh.
References vcsn::nullableset< LabelSet >::get_value(), and vcsn::nullableset< LabelSet >::is_one().
Referenced by vcsn::nullableset< LabelSet >::lgcd(), vcsn::nullableset< LabelSet >::maybe_ldivide(), and vcsn::nullableset< LabelSet >::maybe_rdivide().
|
inline |
The generators. Meaningful for labelsets only.
Definition at line 266 of file nullableset.hh.
|
inline |
Definition at line 259 of file nullableset.hh.
|
inline |
Definition at line 456 of file nullableset.hh.
|
inlinestatic |
The (inner) value when it (the outer value) is not one.
Definition at line 586 of file nullableset.hh.
Referenced by vcsn::nullableset< LabelSet >::conjunction(), vcsn::letterset< GenSet >::conv(), vcsn::wordset< GenSet >::conv(), vcsn::nullableset< LabelSet >::equal(), vcsn::nullableset< LabelSet >::hash(), vcsn::nullableset< LabelSet >::is_letter(), vcsn::nullableset< LabelSet >::is_special(), vcsn::nullableset< LabelSet >::is_valid(), vcsn::nullableset< LabelSet >::is_zero(), vcsn::nullableset< LabelSet >::less(), vcsn::nullableset< LabelSet >::lgcd(), vcsn::nullableset< LabelSet >::maybe_ldivide(), vcsn::nullableset< LabelSet >::maybe_rdivide(), vcsn::nullableset< LabelSet >::size(), and vcsn::nullableset< LabelSet >::word().
|
inlinestatic |
Definition at line 216 of file nullableset.hh.
|
inlinestatic |
Definition at line 449 of file nullableset.hh.
References vcsn::nullableset< LabelSet >::get_value(), and vcsn::nullableset< LabelSet >::is_one().
|
inlinestatic |
Definition at line 222 of file nullableset.hh.
|
inlinestatic |
Definition at line 233 of file nullableset.hh.
|
inline |
Definition at line 539 of file nullableset.hh.
References vcsn::nullableset< LabelSet >::get_value(), and vcsn::nullableset< LabelSet >::is_one().
|
inlinestatic |
Definition at line 228 of file nullableset.hh.
References vcsn::detail::is_letterized().
|
inlinestatic |
Definition at line 247 of file nullableset.hh.
References vcsn::detail::nullable_helper< LabelSet >::is_one().
Referenced by vcsn::nullableset< LabelSet >::conjunction(), vcsn::letterset< GenSet >::conv(), vcsn::wordset< GenSet >::conv(), vcsn::nullableset< LabelSet >::equal(), vcsn::nullableset< LabelSet >::hash(), vcsn::nullableset< LabelSet >::is_letter(), vcsn::nullableset< LabelSet >::is_special(), vcsn::nullableset< LabelSet >::is_valid(), vcsn::nullableset< LabelSet >::is_zero(), vcsn::nullableset< LabelSet >::less(), vcsn::nullableset< LabelSet >::lgcd(), vcsn::nullableset< LabelSet >::maybe_ldivide(), vcsn::nullableset< LabelSet >::maybe_rdivide(), vcsn::nullableset< LabelSet >::mul(), vcsn::nullableset< LabelSet >::size(), and vcsn::nullableset< LabelSet >::word().
|
inlinestatic |
Definition at line 438 of file nullableset.hh.
References vcsn::nullableset< LabelSet >::get_value(), vcsn::nullableset< LabelSet >::is_one(), and vcsn::detail::is_special().
|
inline |
Definition at line 253 of file nullableset.hh.
References vcsn::nullableset< LabelSet >::get_value(), and vcsn::nullableset< LabelSet >::is_one().
|
inline |
Definition at line 533 of file nullableset.hh.
References vcsn::nullableset< LabelSet >::get_value(), and vcsn::nullableset< LabelSet >::is_one().
|
inline |
Definition at line 293 of file nullableset.hh.
References vcsn::nullableset< LabelSet >::ls_.
Referenced by vcsn::letterset< GenSet >::conv(), vcsn::wordset< GenSet >::conv(), and vcsn::nullableset< LabelSet >::word().
|
inline |
Compute l \ r = l^{-1}r.
Definition at line 382 of file nullableset.hh.
References vcsn::nullableset< LabelSet >::maybe_ldivide(), vcsn::res, and vcsn::to_string().
|
inlinestatic |
Whether l < r.
Definition at line 348 of file nullableset.hh.
References vcsn::nullableset< LabelSet >::get_value(), and vcsn::nullableset< LabelSet >::is_one().
|
inlinestatic |
Prepare to iterate over the letters of v.
Definition at line 316 of file nullableset.hh.
References vcsn::v.
|
inline |
Prepare to iterate over the letters of v.
This is for the padded case
Definition at line 325 of file nullableset.hh.
References vcsn::v.
Referenced by vcsn::nullableset< LabelSet >::letters_of_padded().
|
inline |
Definition at line 332 of file nullableset.hh.
References vcsn::nullableset< LabelSet >::letters_of_padded(), vcsn::v, and vcsn::nullableset< LabelSet >::word().
|
inline |
The longest common prefix.
Definition at line 371 of file nullableset.hh.
References vcsn::nullableset< LabelSet >::equal(), vcsn::nullableset< LabelSet >::get_value(), vcsn::nullableset< LabelSet >::is_one(), vcsn::nullableset< LabelSet >::one(), and vcsn::nullableset< LabelSet >::value().
|
inlinestatic |
Build from the description in is.
Definition at line 196 of file nullableset.hh.
References vcsn::eat().
|
inline |
Definition at line 392 of file nullableset.hh.
References vcsn::nullableset< LabelSet >::equal(), vcsn::nullableset< LabelSet >::get_value(), vcsn::nullableset< LabelSet >::is_one(), vcsn::nullableset< LabelSet >::one(), vcsn::res, and vcsn::nullableset< LabelSet >::value().
Referenced by vcsn::nullableset< LabelSet >::ldivide().
|
inline |
Definition at line 417 of file nullableset.hh.
References vcsn::nullableset< LabelSet >::equal(), vcsn::nullableset< LabelSet >::get_value(), vcsn::nullableset< LabelSet >::is_one(), vcsn::nullableset< LabelSet >::one(), vcsn::res, and vcsn::nullableset< LabelSet >::value().
Referenced by vcsn::nullableset< LabelSet >::rdivide().
|
inline |
The concatenation.
Definition at line 359 of file nullableset.hh.
References vcsn::nullableset< LabelSet >::is_one(), and vcsn::to_string().
|
inlinestatic |
Definition at line 240 of file nullableset.hh.
References vcsn::detail::nullable_helper< LabelSet >::one().
Referenced by vcsn::nullableset< LabelSet >::conv(), vcsn::nullableset< LabelSet >::lgcd(), vcsn::nullableset< LabelSet >::maybe_ldivide(), and vcsn::nullableset< LabelSet >::maybe_rdivide().
|
inline |
Whether unknown letters should be added, or rejected.
| o | whether to accept unknown letters |
Definition at line 210 of file nullableset.hh.
|
inline |
Print label to stream.
Definition at line 514 of file nullableset.hh.
|
inline |
Print labelset description.
Definition at line 554 of file nullableset.hh.
|
inline |
Compute l / r.
Definition at line 407 of file nullableset.hh.
References vcsn::nullableset< LabelSet >::maybe_rdivide(), vcsn::res, and vcsn::to_string().
|
inlinestatic |
Definition at line 443 of file nullableset.hh.
References vcsn::nullableset< LabelSet >::get_value(), vcsn::nullableset< LabelSet >::is_one(), and vcsn::rat::size().
|
inlinestatic |
Definition at line 189 of file nullableset.hh.
References vcsn::res, and vcsn::sname().
|
inlinestatic |
Definition at line 432 of file nullableset.hh.
References vcsn::detail::nullable_helper< LabelSet >::special().
|
inline |
Mirror label.
Definition at line 547 of file nullableset.hh.
References vcsn::detail::nullable_helper< LabelSet >::transpose().
|
inline |
Definition at line 300 of file nullableset.hh.
References vcsn::detail::nullable_helper< LabelSet >::value().
Referenced by vcsn::nullableset< LabelSet >::conv(), vcsn::nullableset< LabelSet >::convs(), vcsn::nullableset< LabelSet >::lgcd(), vcsn::nullableset< LabelSet >::maybe_ldivide(), vcsn::nullableset< LabelSet >::maybe_rdivide(), and vcsn::nullableset< LabelSet >::zero().
|
inline |
Definition at line 306 of file nullableset.hh.
References vcsn::nullableset< LabelSet >::get_value(), vcsn::nullableset< LabelSet >::is_one(), vcsn::nullableset< LabelSet >::labelset(), and vcsn::detail::make_wordset().
Referenced by vcsn::nullableset< LabelSet >::letters_of_padded().
|
inline |
Definition at line 527 of file nullableset.hh.
References vcsn::nullableset< LabelSet >::value().
|
private |
The wrapped LabelSet.
Declared early to please decltype.
Definition at line 174 of file nullableset.hh.
Referenced by vcsn::nullableset< LabelSet >::labelset().