Vcsn  2.2
Be Rational
vcsn::wordset< GenSet > Class Template Reference

Implementation of labels are words. More...

#include <fwd.hh>

Inheritance diagram for vcsn::wordset< GenSet >:
Collaboration diagram for vcsn::wordset< GenSet >:

Public Types

using genset_t = GenSet
 
using super_t = detail::genset_labelset< genset_t >
 
using self_t = wordset
 
using genset_ptr = std::shared_ptr< const genset_t >
 
using letter_t = typename genset_t::letter_t
 
using word_t = typename genset_t::word_t
 
using letters_t = std::set< letter_t >
 
using value_t = word_t
 
using kind_t = labels_are_words
 
- Public Types inherited from vcsn::detail::genset_labelset< GenSet >
using genset_t = GenSet
 
using genset_ptr = std::shared_ptr< const genset_t >
 
using letter_t = typename genset_t::letter_t
 
using word_t = typename genset_t::word_t
 
using letters_t = typename genset_t::letters_t
 

Public Member Functions

 wordset (const genset_ptr &gs)
 
 wordset (const genset_t &gs={})
 
 wordset (std::initializer_list< letter_t > letters)
 
bool open (bool o) const
 Whether unknown letters should be added, or rejected. More...
 
template<typename... Args>
value_t value (Args &&...args) const
 Value constructor. More...
 
word_t word (const value_t &v) const
 Convert to a word. More...
 
bool is_valid (const value_t &v) const
 
value_t conv (self_t, const value_t &v) const
 
template<typename GenSet_ >
value_t conv (const letterset< GenSet_ > &ls, typename letterset< GenSet_ >::value_t v) const
 
template<typename LabelSet_ >
value_t conv (const nullableset< LabelSet_ > &ls, const typename nullableset< LabelSet_ >::value_t &v) const
 
value_t conv (std::istream &i, bool=true) const
 Read a word from this stream. More...
 
template<typename Fun >
void convs (std::istream &i, Fun fun) const
 Process a label class. More...
 
std::ostream & print (const value_t &l, std::ostream &o, format fmt={}) const
 
std::ostream & print_set (std::ostream &o, format fmt={}) const
 
const value_tconjunction (const value_t &l, const value_t &r) const
 
- Public Member Functions inherited from vcsn::detail::genset_labelset< GenSet >
 genset_labelset (const genset_ptr &gs)
 
 genset_labelset (const genset_t &gs={})
 
genset_ptr genset () const
 
const genset_tgenerators () const
 
template<typename Fun >
void convs_ (std::istream &i, Fun fun) const
 Read and process a class of letters. More...
 
letter_t get_letter (std::istream &i, bool quoted=true) const
 Read one letter from i. More...
 
template<typename... Args>
auto begin (Args &&...args) const -> decltype(this->genset() -> begin(std::forward< Args >(args)...))
 
template<typename... Args>
auto delimit (Args &&...args) const -> decltype(this->genset() -> delimit(std::forward< Args >(args)...))
 
template<typename... Args>
auto end (Args &&...args) const -> decltype(this->genset() -> end(std::forward< Args >(args)...))
 
template<typename... Args>
ATTRIBUTE_PURE auto equal (Args &&...args) const -> decltype(this->genset() -> equal(std::forward< Args >(args)...))
 
template<typename... Args>
auto get_word (Args &&...args) const -> decltype(this->genset() -> get_word(std::forward< Args >(args)...))
 
template<typename... Args>
ATTRIBUTE_PURE auto has (Args &&...args) const -> decltype(this->genset() -> has(std::forward< Args >(args)...))
 
template<typename... Args>
ATTRIBUTE_PURE auto is_letter (Args &&...args) const -> decltype(this->genset() -> is_letter(std::forward< Args >(args)...))
 
template<typename... Args>
ATTRIBUTE_PURE auto less (Args &&...args) const -> decltype(this->genset() -> less(std::forward< Args >(args)...))
 
template<typename... Args>
auto mul (Args &&...args) const -> decltype(this->genset() -> mul(std::forward< Args >(args)...))
 
template<typename... Args>
ATTRIBUTE_PURE auto transpose (Args &&...args) const -> decltype(this->genset() -> transpose(std::forward< Args >(args)...))
 
template<typename... Args>
auto undelimit (Args &&...args) const -> decltype(this->genset() -> undelimit(std::forward< Args >(args)...))
 

Static Public Member Functions

static symbol sname ()
 
static wordset make (std::istream &is)
 Build from the description in is. More...
 
static constexpr bool is_free ()
 
static word_t letters_of (const value_t &v)
 Prepare to iterate over the letters of v. More...
 
static word_t letters_of_padded (const value_t &v, letter_t)
 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 letter_t &l, const letter_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 constexpr bool is_expressionset ()
 
static constexpr bool has_one ()
 
static constexpr bool is_letterized ()
 
static value_t one ()
 
static bool is_one (const value_t &l) ATTRIBUTE_PURE
 
static size_t size (const value_t &v)
 
static size_t hash (const value_t &v)
 
static value_t lgcd (const value_t &w1, const value_t &w2)
 The longest common prefix. More...
 
static value_t ldiv (const value_t &w1, const value_t &w2)
 Compute w1 \ w2 = w1^{-1}w2. More...
 
static value_tldiv_here (const value_t &w1, value_t &w2)
 w2 := w1 \ w2. More...
 
- Static Public Member Functions inherited from vcsn::detail::genset_labelset< GenSet >
static symbol sname ()
 

Detailed Description

template<typename GenSet>
class vcsn::wordset< GenSet >

Implementation of labels are words.

Definition at line 36 of file fwd.hh.

Member Typedef Documentation

template<typename GenSet>
using vcsn::wordset< GenSet >::genset_ptr = std::shared_ptr<const genset_t>

Definition at line 28 of file wordset.hh.

template<typename GenSet>
using vcsn::wordset< GenSet >::genset_t = GenSet

Definition at line 25 of file wordset.hh.

template<typename GenSet>
using vcsn::wordset< GenSet >::kind_t = labels_are_words

Definition at line 36 of file wordset.hh.

template<typename GenSet>
using vcsn::wordset< GenSet >::letter_t = typename genset_t::letter_t

Definition at line 30 of file wordset.hh.

template<typename GenSet>
using vcsn::wordset< GenSet >::letters_t = std::set<letter_t>

Definition at line 32 of file wordset.hh.

template<typename GenSet>
using vcsn::wordset< GenSet >::self_t = wordset

Definition at line 27 of file wordset.hh.

template<typename GenSet>
using vcsn::wordset< GenSet >::super_t = detail::genset_labelset<genset_t>

Definition at line 26 of file wordset.hh.

template<typename GenSet>
using vcsn::wordset< GenSet >::value_t = word_t

Definition at line 34 of file wordset.hh.

template<typename GenSet>
using vcsn::wordset< GenSet >::word_t = typename genset_t::word_t

Definition at line 31 of file wordset.hh.

Constructor & Destructor Documentation

template<typename GenSet>
vcsn::wordset< GenSet >::wordset ( const genset_ptr gs)
inline

Definition at line 38 of file wordset.hh.

template<typename GenSet>
vcsn::wordset< GenSet >::wordset ( const genset_t gs = {})
inline

Definition at line 42 of file wordset.hh.

template<typename GenSet>
vcsn::wordset< GenSet >::wordset ( std::initializer_list< letter_t letters)
inline

Definition at line 46 of file wordset.hh.

Member Function Documentation

template<typename GenSet>
const value_t& vcsn::wordset< GenSet >::conjunction ( const value_t l,
const value_t r 
) const
inline

Definition at line 315 of file wordset.hh.

template<typename GenSet>
value_t vcsn::wordset< GenSet >::conv ( self_t  ,
const value_t v 
) const
inline

Definition at line 200 of file wordset.hh.

References vcsn::detail::v.

Referenced by vcsn::wordset< GenSet >::conv().

template<typename GenSet>
template<typename GenSet_ >
value_t vcsn::wordset< GenSet >::conv ( const letterset< GenSet_ > &  ls,
typename letterset< GenSet_ >::value_t  v 
) const
inline

Definition at line 207 of file wordset.hh.

References vcsn::letterset< GenSet >::is_special(), vcsn::wordset< GenSet >::is_valid(), vcsn::wordset< GenSet >::special(), vcsn::str_escape(), vcsn::wordset< GenSet >::value(), and VCSN_REQUIRE.

Here is the call graph for this function:

template<typename GenSet>
template<typename LabelSet_ >
value_t vcsn::wordset< GenSet >::conv ( const nullableset< LabelSet_ > &  ls,
const typename nullableset< LabelSet_ >::value_t v 
) const
inline

Definition at line 223 of file wordset.hh.

References vcsn::wordset< GenSet >::conv(), vcsn::nullableset< LabelSet >::get_value(), vcsn::nullableset< LabelSet >::is_one(), vcsn::nullableset< LabelSet >::labelset(), and vcsn::wordset< GenSet >::one().

Here is the call graph for this function:

template<typename GenSet>
value_t vcsn::wordset< GenSet >::conv ( std::istream &  i,
bool  = true 
) const
inline

Read a word from this stream.

Definition at line 234 of file wordset.hh.

References vcsn::detail::genset_labelset< GenSet >::genset().

Here is the call graph for this function:

template<typename GenSet>
template<typename Fun >
void vcsn::wordset< GenSet >::convs ( std::istream &  i,
Fun  fun 
) const
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_]".

Parameters
ithe input stream.
funa (label_t) -> void function.

Definition at line 249 of file wordset.hh.

References vcsn::detail::genset_labelset< GenSet >::convs_(), and vcsn::wordset< GenSet >::value().

Here is the call graph for this function:

template<typename GenSet>
static bool vcsn::wordset< GenSet >::equal ( const value_t l,
const value_t r 
)
inlinestatic

Whether l == r.

Definition at line 111 of file wordset.hh.

template<typename GenSet>
static constexpr bool vcsn::wordset< GenSet >::has_one ( )
inlinestatic

Definition at line 164 of file wordset.hh.

template<typename GenSet>
static size_t vcsn::wordset< GenSet >::hash ( const value_t v)
inlinestatic

Definition at line 194 of file wordset.hh.

References vcsn::detail::hash_value().

Here is the call graph for this function:

template<typename GenSet>
static constexpr bool vcsn::wordset< GenSet >::is_expressionset ( )
inlinestatic

Definition at line 158 of file wordset.hh.

template<typename GenSet>
static constexpr bool vcsn::wordset< GenSet >::is_free ( )
inlinestatic

Definition at line 76 of file wordset.hh.

template<typename GenSet>
static constexpr bool vcsn::wordset< GenSet >::is_letterized ( )
inlinestatic

Definition at line 170 of file wordset.hh.

template<typename GenSet>
static bool vcsn::wordset< GenSet >::is_one ( const value_t l)
inlinestatic

Definition at line 182 of file wordset.hh.

template<typename GenSet>
static bool vcsn::wordset< GenSet >::is_special ( const value_t v)
inlinestatic

Definition at line 143 of file wordset.hh.

References vcsn::wordset< GenSet >::special().

Here is the call graph for this function:

template<typename GenSet>
bool vcsn::wordset< GenSet >::is_valid ( const value_t v) const
inline

Definition at line 149 of file wordset.hh.

References vcsn::detail::genset_labelset< GenSet >::has().

Referenced by vcsn::wordset< GenSet >::conv().

Here is the call graph for this function:

template<typename GenSet>
static value_t vcsn::wordset< GenSet >::ldiv ( const value_t w1,
const value_t w2 
)
inlinestatic

Compute w1 \ w2 = w1^{-1}w2.

Precondition: w1 is prefix of w2.

Definition at line 299 of file wordset.hh.

template<typename GenSet>
static value_t& vcsn::wordset< GenSet >::ldiv_here ( const value_t w1,
value_t w2 
)
inlinestatic

w2 := w1 \ w2.

Definition at line 309 of file wordset.hh.

template<typename GenSet>
static bool vcsn::wordset< GenSet >::less ( const letter_t l,
const letter_t r 
)
inlinestatic

Whether l < r.

Definition at line 117 of file wordset.hh.

template<typename GenSet>
static bool vcsn::wordset< GenSet >::less ( const value_t l,
const value_t r 
)
inlinestatic

Whether l < r.

Definition at line 123 of file wordset.hh.

References vcsn::wordset< GenSet >::size().

Here is the call graph for this function:

template<typename GenSet>
static word_t vcsn::wordset< GenSet >::letters_of ( const value_t v)
inlinestatic

Prepare to iterate over the letters of v.

Definition at line 96 of file wordset.hh.

References vcsn::detail::v.

template<typename GenSet>
static word_t vcsn::wordset< GenSet >::letters_of_padded ( const value_t v,
letter_t   
)
inlinestatic

Prepare to iterate over the letters of v.

This is for the padded case

Definition at line 104 of file wordset.hh.

References vcsn::detail::v.

template<typename GenSet>
static value_t vcsn::wordset< GenSet >::lgcd ( const value_t w1,
const value_t w2 
)
inlinestatic

The longest common prefix.

Definition at line 292 of file wordset.hh.

template<typename GenSet>
static wordset vcsn::wordset< GenSet >::make ( std::istream &  is)
inlinestatic

Build from the description in is.

Definition at line 57 of file wordset.hh.

References vcsn::eat().

Here is the call graph for this function:

template<typename GenSet>
static value_t vcsn::wordset< GenSet >::one ( )
inlinestatic

Definition at line 176 of file wordset.hh.

Referenced by vcsn::wordset< GenSet >::conv(), and vcsn::random_label().

template<typename GenSet>
bool vcsn::wordset< GenSet >::open ( bool  o) const
inline

Whether unknown letters should be added, or rejected.

Parameters
owhether to accept
Returns
the previous status.

Definition at line 71 of file wordset.hh.

References vcsn::detail::genset_labelset< GenSet >::genset().

Here is the call graph for this function:

template<typename GenSet>
std::ostream& vcsn::wordset< GenSet >::print ( const value_t l,
std::ostream &  o,
format  fmt = {} 
) const
inline

Definition at line 255 of file wordset.hh.

template<typename GenSet>
std::ostream& vcsn::wordset< GenSet >::print_set ( std::ostream &  o,
format  fmt = {} 
) const
inline

Definition at line 266 of file wordset.hh.

template<typename GenSet>
static size_t vcsn::wordset< GenSet >::size ( const value_t v)
inlinestatic

Definition at line 187 of file wordset.hh.

Referenced by vcsn::wordset< GenSet >::less().

template<typename GenSet>
static symbol vcsn::wordset< GenSet >::sname ( )
inlinestatic

Definition at line 50 of file wordset.hh.

References vcsn::detail::genset_labelset< GenSet >::sname().

Here is the call graph for this function:

template<typename GenSet>
static value_t vcsn::wordset< GenSet >::special ( )
inlinestatic
template<typename GenSet>
template<typename... Args>
value_t vcsn::wordset< GenSet >::value ( Args &&...  args) const
inline

Value constructor.

Definition at line 83 of file wordset.hh.

Referenced by vcsn::wordset< GenSet >::conv(), vcsn::wordset< GenSet >::convs(), and vcsn::random_label().

template<typename GenSet>
word_t vcsn::wordset< GenSet >::word ( const value_t v) const
inline

Convert to a word.

Definition at line 89 of file wordset.hh.

References vcsn::detail::v.


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