Awali
Another Weighted Automata library
|
A ValueSet which is a Cartesian product of ValueSets. More...
#include <tupleset.hh>
Public Types | |
using | genset_t = typename labelset_types< ValueSets... >::genset_t |
A tuple of gensets if meaningful, void otherwise. More... | |
using | indices_t = awali::internal::make_index_sequence< sizeof...(ValueSets)> |
using | is_tupleset_t = bool |
using | kind_t = labels_are_tuples |
using | letter_t = typename labelset_types< ValueSets... >::letter_t |
A tuple of letters if meaningful, void otherwise. More... | |
using | self_type = tupleset |
template<std::size_t... I> | |
using | seq = awali::internal::index_sequence< I... > |
using | value_t = std::tuple< typename ValueSets::value_t... > |
A tuple of values. More... | |
using | value_type = letter_t |
To be iterable. More... | |
template<std::size_t I> | |
using | valueset_t = typename std::tuple_element< I, valuesets_t >::type |
The Ith valueset type. More... | |
using | valuesets_t = std::tuple< ValueSets... > |
using | word_t = typename labelset_types< ValueSets... >::word_t |
A tuple of words if meaningful, void otherwise. More... | |
Public Member Functions | |
tupleset (ValueSets... ls) | |
tupleset (valuesets_t vs) | |
value_t | add (const value_t &l, const value_t &r) const |
template<std::size_t... I> | |
void | comma (const std::string &s, size_t &p, char &c) const |
template<typename LhsValue , typename RhsValue > | |
word_t | concat (const LhsValue &l, const RhsValue &r) const |
value_t | conv (b, b::value_t v) const |
template<typename T > | |
value_t | conv (const T &tset, typename T::value_t v) const |
value_t | conv (std::istream &i) const |
Read one letter from i, return the corresponding value. More... | |
std::set< value_t > | convs (std::istream &) const |
template<typename Value > | |
Value | delimit (const Value &l) const |
Add the special character first and last. More... | |
genset_t | genset () const |
The generators. Meaningful for labelsets only. More... | |
bool | is_letter (const value_t &) const |
bool | is_zero (const value_t &l) const |
value_t | ldiv (const value_t &l, const value_t &r) const |
value_t | mul (const value_t &l, const value_t &r) 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 |
template<std::size_t... I> | |
value_t | parse_ (const std::string &s, size_t &p, bool fixed_domain, seq< I... >) const |
std::ostream & | print (const value_t &l, std::ostream &o, const std::string &format="text") const |
std::ostream & | print_set (std::ostream &o, const std::string &format="text") const |
value_t | rdiv (const value_t &l, const value_t &r) const |
template<size_t I> | |
const valueset_t< I > & | set () const |
The Ith component valueset. More... | |
const valuesets_t & | sets () const |
The componants valuesets, as a tuple. More... | |
value_t | star (const value_t &l) const |
template<unsigned version = version::fsm_json> | |
json::node_t * | to_json () const |
value_t | transpose (const value_t &l) const |
template<typename Value > | |
Value | undelimit (const Value &l) const |
Remove first and last characters, that must be "special". More... | |
template<typename... Args> | |
value_t | value (const std::tuple< Args... > &args) const |
Construct a value. 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_t * | value_to_json (value_t v) const |
std::string | vname (bool full=true) const |
template<typename... Args> | |
auto | word (const std::tuple< Args... > &v) const -> word_t |
Convert to a word. More... | |
value_t | zero () const |
Static Public Member Functions | |
static value_t | conv (self_type, value_t v) |
static bool | equals (const value_t &l, const value_t &r) |
static constexpr bool | has_one () |
static size_t | hash (const value_t &v) |
template<std::size_t... I> | |
static constexpr bool | is_commutative_semiring () |
static constexpr bool | is_free () |
static constexpr bool | is_letterized () |
static bool | is_one (const value_t &l) |
static constexpr bool | is_ratexpset () |
static bool | is_special (const value_t &l) |
static bool | less_than (const value_t &l, const value_t &r) |
Whether l < r. More... | |
template<typename Value > | |
static auto | letters_of (const Value &v) -> decltype(letters_of_(v, indices)) |
Iterate over the letters of v. More... | |
static tupleset | make (std::istream &is) |
Build from the description in is. More... | |
static value_t | one () |
static bool | show_one () |
static constexpr std::size_t | size () |
static std::string | sname () |
static value_t | special () |
static constexpr star_status_t | star_status () |
Static Public Attributes | |
static constexpr indices_t | indices {} |
A ValueSet which is a Cartesian product of ValueSets.
Exposes a LabelSet interface for products of LabelSets, and similarly for WeightSets.
using awali::sttc::tupleset< ValueSets >::genset_t = typename labelset_types<ValueSets...>::genset_t |
A tuple of gensets if meaningful, void otherwise.
using awali::sttc::tupleset< ValueSets >::indices_t = awali::internal::make_index_sequence<sizeof...(ValueSets)> |
using awali::sttc::tupleset< ValueSets >::is_tupleset_t = bool |
using awali::sttc::tupleset< ValueSets >::kind_t = labels_are_tuples |
using awali::sttc::tupleset< ValueSets >::letter_t = typename labelset_types<ValueSets...>::letter_t |
A tuple of letters if meaningful, void otherwise.
using awali::sttc::tupleset< ValueSets >::self_type = tupleset |
using awali::sttc::tupleset< ValueSets >::seq = awali::internal::index_sequence<I...> |
using awali::sttc::tupleset< ValueSets >::value_t = std::tuple<typename ValueSets::value_t...> |
A tuple of values.
using awali::sttc::tupleset< ValueSets >::value_type = letter_t |
To be iterable.
using awali::sttc::tupleset< ValueSets >::valueset_t = typename std::tuple_element<I, valuesets_t>::type |
The Ith valueset type.
using awali::sttc::tupleset< ValueSets >::valuesets_t = std::tuple<ValueSets...> |
using awali::sttc::tupleset< ValueSets >::word_t = typename labelset_types<ValueSets...>::word_t |
A tuple of words if meaningful, void otherwise.
awali::sttc::tupleset< ValueSets >::tupleset | ( | valuesets_t | vs | ) |
awali::sttc::tupleset< ValueSets >::tupleset | ( | ValueSets... | ls | ) |
value_t awali::sttc::tupleset< ValueSets >::add | ( | const value_t & | l, |
const value_t & | r | ||
) | const |
void awali::sttc::tupleset< ValueSets >::comma | ( | const std::string & | s, |
size_t & | p, | ||
char & | c | ||
) | const |
word_t awali::sttc::tupleset< ValueSets >::concat | ( | const LhsValue & | l, |
const RhsValue & | r | ||
) | const |
value_t awali::sttc::tupleset< ValueSets >::conv | ( | b | , |
b::value_t | v | ||
) | const |
value_t awali::sttc::tupleset< ValueSets >::conv | ( | const T & | tset, |
typename T::value_t | v | ||
) | const |
|
static |
value_t awali::sttc::tupleset< ValueSets >::conv | ( | std::istream & | i | ) | const |
Read one letter from i, return the corresponding value.
std::set<value_t> awali::sttc::tupleset< ValueSets >::convs | ( | std::istream & | ) | const |
Value awali::sttc::tupleset< ValueSets >::delimit | ( | const Value & | l | ) | const |
Add the special character first and last.
Templated by Value so that we work for both word_t and label_t. Besides, avoids the problem of instantiation with weighset that do not provide a word_t type.
|
static |
genset_t awali::sttc::tupleset< ValueSets >::genset | ( | ) | const |
The generators. Meaningful for labelsets only.
|
staticconstexpr |
|
static |
|
staticconstexpr |
|
staticconstexpr |
bool awali::sttc::tupleset< ValueSets >::is_letter | ( | const value_t & | ) | const |
|
staticconstexpr |
|
static |
|
staticconstexpr |
|
static |
bool awali::sttc::tupleset< ValueSets >::is_zero | ( | const value_t & | l | ) | const |
value_t awali::sttc::tupleset< ValueSets >::ldiv | ( | const value_t & | l, |
const value_t & | r | ||
) | const |
|
static |
Whether l < r.
|
static |
Iterate over the letters of v.
Templated by Value so that we work for both word_t and label_t. Besides, avoids the problem of instantiation with weighset that do not provide a word_t type.
|
static |
Build from the description in is.
value_t awali::sttc::tupleset< ValueSets >::mul | ( | const value_t & | l, |
const value_t & | r | ||
) | const |
|
static |
bool awali::sttc::tupleset< ValueSets >::open | ( | bool | o | ) | const |
Whether unknown letters should be added, or rejected.
o | whether to accept |
value_t awali::sttc::tupleset< ValueSets >::parse | ( | const std::string & | s, |
size_t & | p, | ||
bool | fixed_domain = true |
||
) | const |
value_t awali::sttc::tupleset< ValueSets >::parse_ | ( | const std::string & | s, |
size_t & | p, | ||
bool | fixed_domain, | ||
seq< I... > | |||
) | const |
std::ostream& awali::sttc::tupleset< ValueSets >::print | ( | const value_t & | l, |
std::ostream & | o, | ||
const std::string & | format = "text" |
||
) | const |
std::ostream& awali::sttc::tupleset< ValueSets >::print_set | ( | std::ostream & | o, |
const std::string & | format = "text" |
||
) | const |
value_t awali::sttc::tupleset< ValueSets >::rdiv | ( | const value_t & | l, |
const value_t & | r | ||
) | const |
const valueset_t<I>& awali::sttc::tupleset< ValueSets >::set | ( | ) | const |
The Ith component valueset.
const valuesets_t& awali::sttc::tupleset< ValueSets >::sets | ( | ) | const |
The componants valuesets, as a tuple.
|
static |
|
staticconstexpr |
|
static |
|
static |
value_t awali::sttc::tupleset< ValueSets >::star | ( | const value_t & | l | ) | const |
|
staticconstexpr |
json::node_t* awali::sttc::tupleset< ValueSets >::to_json | ( | ) | const |
value_t awali::sttc::tupleset< ValueSets >::transpose | ( | const value_t & | l | ) | const |
Value awali::sttc::tupleset< ValueSets >::undelimit | ( | const Value & | l | ) | const |
Remove first and last characters, that must be "special".
value_t awali::sttc::tupleset< ValueSets >::value | ( | const std::tuple< Args... > & | args | ) | const |
Construct a value.
value_t awali::sttc::tupleset< ValueSets >::value_from_json | ( | json::node_t const * | p | ) | const |
json::node_t* awali::sttc::tupleset< ValueSets >::value_to_json | ( | value_t | v | ) | const |
std::string awali::sttc::tupleset< ValueSets >::vname | ( | bool | full = true | ) | const |
auto awali::sttc::tupleset< ValueSets >::word | ( | const std::tuple< Args... > & | v | ) | const -> word_t |
Convert to a word.
value_t awali::sttc::tupleset< ValueSets >::zero | ( | ) | const |
|
staticconstexpr |