Awali
Another Weighted Automata library
Public Types | Public Member Functions | Static Public Member Functions
awali::sttc::letterset< GenSet > Class Template Reference

Implementation of labels are letters. More...

#include <letterset.hh>

Public Types

using genset_ptr = std::shared_ptr< const genset_t >
 
using genset_t = GenSet
 
using kind_t = labels_are_letters
 
using letter_t = typename genset_t::letter_t
 
using letters_t = std::set< letter_t >
 
using self_type = letterset
 
using value_t = letter_t
 
using word_t = typename wordset< genset_t >::word_t
 

Public Member Functions

 letterset (const genset_t &gs={})
 
 letterset (const letters_t &letters)
 
 letterset (const std::initializer_list< letter_t > &letters)
 
value_t conv (std::istream &i) const
 Read one letter from i, return the corresponding label. More...
 
std::set< value_tconvs (std::istream &i) const
 
const genset_tgenset () const
 
bool is_valid (value_t v) const
 
bool open (bool o) const
 Whether unknown letters should be added, or rejected. More...
 
value_t parse (const std::string &s, size_t &p, bool fixed_domain=true) const
 
std::ostream & print (const value_t &l, std::ostream &o, const std::string &="text") const
 
std::ostream & print_set (std::ostream &o, const std::string &format="text") const
 
template<unsigned version = version::fsm_json>
json::node_tto_json () const
 
value_t transpose (const value_t &v) const
 
template<typename... Args>
value_t value (Args &&... args) const
 Value constructor. More...
 
template<unsigned version = version::fsm_json>
value_t value_from_json (json::node_t const *p) const
 
template<unsigned version = version::fsm_json>
json::node_tvalue_to_json (value_t v) const
 
std::string vname (bool full=true) const
 
word_t word (value_t v) const
 Convert to a word. More...
 

Static Public Member Functions

static value_t conv (self_type, value_t v)
 
static bool equals (const value_t l, const value_t r)
 Whether l == r. More...
 
static constexpr bool has_one ()
 
static size_t hash (value_t v)
 
static constexpr bool is_free ()
 
static constexpr bool is_letterized ()
 
static constexpr bool is_one (value_t)
 
static constexpr bool is_ratexpset ()
 
static bool is_special (value_t v) ATTRIBUTE_PURE
 
static bool less_than (const value_t l, const value_t r)
 Whether l < r. More...
 
static word_t letters_of (word_t v)
 Prepare to iterate over the letters of v. More...
 
static letterset make (std::istream &is)
 Build from the description in is. More...
 
static size_t size (value_t)
 
static std::string sname ()
 
static value_t special () ATTRIBUTE_PURE
 

Detailed Description

template<typename GenSet>
class awali::sttc::letterset< GenSet >

Implementation of labels are letters.

Member Typedef Documentation

◆ genset_ptr

template<typename GenSet >
using awali::sttc::letterset< GenSet >::genset_ptr = std::shared_ptr<const genset_t>

◆ genset_t

template<typename GenSet >
using awali::sttc::letterset< GenSet >::genset_t = GenSet

◆ kind_t

template<typename GenSet >
using awali::sttc::letterset< GenSet >::kind_t = labels_are_letters

◆ letter_t

template<typename GenSet >
using awali::sttc::letterset< GenSet >::letter_t = typename genset_t::letter_t

◆ letters_t

template<typename GenSet >
using awali::sttc::letterset< GenSet >::letters_t = std::set<letter_t>

◆ self_type

template<typename GenSet >
using awali::sttc::letterset< GenSet >::self_type = letterset

◆ value_t

template<typename GenSet >
using awali::sttc::letterset< GenSet >::value_t = letter_t

◆ word_t

template<typename GenSet >
using awali::sttc::letterset< GenSet >::word_t = typename wordset<genset_t>::word_t

Constructor & Destructor Documentation

◆ letterset() [1/3]

template<typename GenSet >
awali::sttc::letterset< GenSet >::letterset ( const genset_t gs = {})

◆ letterset() [2/3]

template<typename GenSet >
awali::sttc::letterset< GenSet >::letterset ( const std::initializer_list< letter_t > &  letters)

◆ letterset() [3/3]

template<typename GenSet >
awali::sttc::letterset< GenSet >::letterset ( const letters_t letters)

Member Function Documentation

◆ conv() [1/2]

template<typename GenSet >
static value_t awali::sttc::letterset< GenSet >::conv ( self_type  ,
value_t  v 
)
static

◆ conv() [2/2]

template<typename GenSet >
value_t awali::sttc::letterset< GenSet >::conv ( std::istream &  i) const

Read one letter from i, return the corresponding label.

◆ convs()

template<typename GenSet >
std::set<value_t> awali::sttc::letterset< GenSet >::convs ( std::istream &  i) const

◆ equals()

template<typename GenSet >
static bool awali::sttc::letterset< GenSet >::equals ( const value_t  l,
const value_t  r 
)
static

Whether l == r.

◆ genset()

template<typename GenSet >
const genset_t& awali::sttc::letterset< GenSet >::genset ( ) const

◆ has_one()

template<typename GenSet >
static constexpr bool awali::sttc::letterset< GenSet >::has_one ( )
staticconstexpr

◆ hash()

template<typename GenSet >
static size_t awali::sttc::letterset< GenSet >::hash ( value_t  v)
static

◆ is_free()

template<typename GenSet >
static constexpr bool awali::sttc::letterset< GenSet >::is_free ( )
staticconstexpr

◆ is_letterized()

template<typename GenSet >
static constexpr bool awali::sttc::letterset< GenSet >::is_letterized ( )
staticconstexpr

◆ is_one()

template<typename GenSet >
static constexpr bool awali::sttc::letterset< GenSet >::is_one ( value_t  )
staticconstexpr

◆ is_ratexpset()

template<typename GenSet >
static constexpr bool awali::sttc::letterset< GenSet >::is_ratexpset ( )
staticconstexpr

◆ is_special()

template<typename GenSet >
static bool awali::sttc::letterset< GenSet >::is_special ( value_t  v)
static

◆ is_valid()

template<typename GenSet >
bool awali::sttc::letterset< GenSet >::is_valid ( value_t  v) const

◆ less_than()

template<typename GenSet >
static bool awali::sttc::letterset< GenSet >::less_than ( const value_t  l,
const value_t  r 
)
static

Whether l < r.

◆ letters_of()

template<typename GenSet >
static word_t awali::sttc::letterset< GenSet >::letters_of ( word_t  v)
static

Prepare to iterate over the letters of v.

◆ make()

template<typename GenSet >
static letterset awali::sttc::letterset< GenSet >::make ( std::istream &  is)
static

Build from the description in is.

◆ open()

template<typename GenSet >
bool awali::sttc::letterset< GenSet >::open ( bool  o) const

Whether unknown letters should be added, or rejected.

Parameters
owhether to accept
Returns
the previous status.

◆ parse()

template<typename GenSet >
value_t awali::sttc::letterset< GenSet >::parse ( const std::string &  s,
size_t &  p,
bool  fixed_domain = true 
) const

◆ print()

template<typename GenSet >
std::ostream& awali::sttc::letterset< GenSet >::print ( const value_t l,
std::ostream &  o,
const std::string &  = "text" 
) const

◆ print_set()

template<typename GenSet >
std::ostream& awali::sttc::letterset< GenSet >::print_set ( std::ostream &  o,
const std::string &  format = "text" 
) const

◆ size()

template<typename GenSet >
static size_t awali::sttc::letterset< GenSet >::size ( value_t  )
static

◆ sname()

template<typename GenSet >
static std::string awali::sttc::letterset< GenSet >::sname ( )
static

◆ special()

template<typename GenSet >
static value_t awali::sttc::letterset< GenSet >::special ( )
static

◆ to_json()

template<typename GenSet >
template<unsigned version = version::fsm_json>
json::node_t* awali::sttc::letterset< GenSet >::to_json ( ) const

◆ transpose()

template<typename GenSet >
value_t awali::sttc::letterset< GenSet >::transpose ( const value_t v) const

◆ value()

template<typename GenSet >
template<typename... Args>
value_t awali::sttc::letterset< GenSet >::value ( Args &&...  args) const

Value constructor.

◆ value_from_json()

template<typename GenSet >
template<unsigned version = version::fsm_json>
value_t awali::sttc::letterset< GenSet >::value_from_json ( json::node_t const *  p) const

◆ value_to_json()

template<typename GenSet >
template<unsigned version = version::fsm_json>
json::node_t* awali::sttc::letterset< GenSet >::value_to_json ( value_t  v) const

◆ vname()

template<typename GenSet >
std::string awali::sttc::letterset< GenSet >::vname ( bool  full = true) const

◆ word()

template<typename GenSet >
word_t awali::sttc::letterset< GenSet >::word ( value_t  v) const

Convert to a word.


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