Awali
Another Weighted Automata library
Public Types | Public Member Functions | Static Public Member Functions
awali::sttc::rat::ratexpset_impl< Context > Class Template Reference

A typed ratexp set. More...

#include <ratexpset.hh>

Public Types

using atom_t = ::awali::sttc::rat::atom< label_t, weight_t >
 
using complement_t = ::awali::sttc::rat::complement< label_t, weight_t >
 
using conjunction_t = ::awali::sttc::rat::conjunction< label_t, weight_t >
 
using const_visitor = rat::const_visitor< label_t, weight_t >
 
using context_t = Context
 
using identities_t = rat::identities
 
using inner_t = ::awali::sttc::rat::inner< label_t, weight_t >
 
using kind_t = labels_are_ratexps
 
using label_t = label_t_of< context_t >
 
using labelset_ptr = typename context_t::labelset_ptr
 
using labelset_t = labelset_t_of< context_t >
 
using ldiv_t = ::awali::sttc::rat::ldiv< label_t, weight_t >
 
using leaf_t = ::awali::sttc::rat::leaf< label_t, weight_t >
 
using letter_t = self_type
 
using lweight_t = ::awali::sttc::rat::lweight< label_t, weight_t >
 
using node_t = ::awali::sttc::rat::node< label_t, weight_t >
 
using one_t = ::awali::sttc::rat::one< label_t, weight_t >
 
using prod_t = ::awali::sttc::rat::prod< label_t, weight_t >
 
using ratexp_t = std::shared_ptr< const node_t >
 
using ratexps_t = typename node_t::ratexps_t
 
using rweight_t = ::awali::sttc::rat::rweight< label_t, weight_t >
 
using self_type = ratexpset< Context >
 
using shuffle_t = ::awali::sttc::rat::shuffle< label_t, weight_t >
 
using star_t = ::awali::sttc::rat::star< label_t, weight_t >
 
using sum_t = ::awali::sttc::rat::sum< label_t, weight_t >
 
using transposition_t = ::awali::sttc::rat::transposition< label_t, weight_t >
 
using type_t = typename node_t::type_t
 
template<exp::type_t Type>
using unary_t = unary< Type, label_t, weight_t >
 
using value_t = typename node_t::value_t
 The value this is a set of: typeful shared pointers. More...
 
using values_t = std::vector< value_t >
 A value sequence. More...
 
template<exp::type_t Type>
using variadic_t = variadic< Type, label_t, weight_t >
 
using weight_t = typename weightset_t::value_t
 
using weightset_ptr = typename context_t::weightset_ptr
 
using weightset_t = weightset_t_of< context_t >
 
using word_t = self_type
 
using zero_t = ::awali::sttc::rat::zero< label_t, weight_t >
 

Public Member Functions

 ratexpset_impl (const context_t &ctx, identities_t identities)
 Constructor. More...
 
value_t add (value_t l, value_t r) const
 
value_t complement (value_t e) const
 Add a complement operator. More...
 
value_t concat (value_t l, value_t r) const
 
value_t conjunction (value_t l, value_t r) const
 
const context_tcontext () const
 
value_t conv (b, typename b::value_t v) const
 
template<typename GenSet >
value_t conv (const letterset< GenSet > &ls, typename letterset< GenSet >::value_t v) const
 
template<typename GenSet >
auto conv (const letterset< GenSet > &ls, typename letterset< GenSet >::value_t v) const -> value_t
 
value_t conv (const q &ws, typename q::value_t v) const
 
value_t conv (const r &ws, typename r::value_t v) const
 
template<typename Ctx2 >
auto conv (const ratexpset_impl< Ctx2 > &rs, typename ratexpset_impl< Ctx2 >::value_t v) const -> value_t
 
template<typename Ctx2 >
value_t conv (const ratexpset_impl< Ctx2 > &ws, typename ratexpset_impl< Ctx2 >::value_t v) const
 
value_t conv (const z &ws, typename z::value_t v) const
 
value_t conv (self_type, value_t v) const
 
value_t conv (std::istream &is) const
 
std::set< value_tconvs (std::istream &) const
 
template<exp::type_t Type>
auto gather (ratexps_t &res, value_t v) const -> void
 
template<exp::type_t Type>
auto gather (value_t l, value_t r) const -> ratexps_t
 
identities_t identities () const
 
bool is_letter (value_t) const
 
bool is_series () const
 
bool is_zero (value_t v) const ATTRIBUTE_PURE
 
const labelset_ptrlabelset () const
 
value_t ldiv (value_t l, value_t r) const
 
template<typename... Args>
auto letter_class (Args &&... args) const -> value_t
 
template<typename... Args>
value_t letter_class (Args &&... chars) const
 A ratexp matching one character amongst chars. More...
 
template<typename LabelSet_ , typename... Args>
auto letter_class_ (const Args &&..., std::true_type) 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
 
value_t lmul (const weight_t &w, value_t e) const
 Left-multiplication by a weight. More...
 
value_t mul (value_t l, 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) const
 
std::ostream & print (const value_t v, 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 (value_t l, value_t r) const
 
value_t rmul (value_t e, const weight_t &w) const
 Right-multiplication by a weight. More...
 
value_t shuffle (value_t l, value_t r) const
 
value_t star (value_t e) const
 
template<unsigned version = version::fsm_json>
json::node_tto_json () const
 
std::string to_string (value_t e) const
 
value_t transpose (value_t e) const
 The transposed of this rational expression. More...
 
value_t transposition (value_t e) const
 Add a transposition operator. 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
 Dynamic description key. More...
 
const weightset_ptrweightset () const
 
word_t word (label_t l) const
 Make a ‘word’ out of a ratexp. More...
 
value_t zero () const
 

Static Public Member Functions

static auto atom (const label_t &v) -> value_t
 
static bool equals (value_t l, value_t r)
 Whether l == r. More...
 
static constexpr bool has_one ()
 
static size_t hash (const value_t &l)
 Hash l. More...
 
static constexpr bool is_commutative_semiring ()
 
static constexpr bool is_free ()
 
static bool is_one (value_t v) ATTRIBUTE_PURE
 
static constexpr bool is_ratexpset ()
 
static bool is_special (value_t v)
 When used as a LabelSet for automata. More...
 
static bool less_than (value_t l, value_t r)
 Whether l < r. More...
 
static self_type make (std::istream &is)
 Build from the description in is. More...
 
static value_t one ()
 
static constexpr bool show_one ()
 
static std::string sname ()
 Static description key. More...
 
static value_t special ()
 When used as a LabelSet for automata. More...
 
static constexpr star_status_t star_status ()
 

Detailed Description

template<typename Context>
class awali::sttc::rat::ratexpset_impl< Context >

A typed ratexp set.

Template Parameters
Contextthe LabelSet and WeightSet types.

Member Typedef Documentation

◆ atom_t

template<typename Context >
using awali::sttc::rat::ratexpset_impl< Context >::atom_t = ::awali::sttc::rat:: atom <label_t, weight_t>

◆ complement_t

template<typename Context >
using awali::sttc::rat::ratexpset_impl< Context >::complement_t = ::awali::sttc::rat:: complement <label_t, weight_t>

◆ conjunction_t

template<typename Context >
using awali::sttc::rat::ratexpset_impl< Context >::conjunction_t = ::awali::sttc::rat:: conjunction <label_t, weight_t>

◆ const_visitor

template<typename Context >
using awali::sttc::rat::ratexpset_impl< Context >::const_visitor = rat::const_visitor<label_t, weight_t>

◆ context_t

template<typename Context >
using awali::sttc::rat::ratexpset_impl< Context >::context_t = Context

◆ identities_t

template<typename Context >
using awali::sttc::rat::ratexpset_impl< Context >::identities_t = rat::identities

◆ inner_t

template<typename Context >
using awali::sttc::rat::ratexpset_impl< Context >::inner_t = ::awali::sttc::rat:: inner <label_t, weight_t>

◆ kind_t

template<typename Context >
using awali::sttc::rat::ratexpset_impl< Context >::kind_t = labels_are_ratexps

◆ label_t

template<typename Context >
using awali::sttc::rat::ratexpset_impl< Context >::label_t = label_t_of<context_t>

◆ labelset_ptr

template<typename Context >
using awali::sttc::rat::ratexpset_impl< Context >::labelset_ptr = typename context_t::labelset_ptr

◆ labelset_t

template<typename Context >
using awali::sttc::rat::ratexpset_impl< Context >::labelset_t = labelset_t_of<context_t>

◆ ldiv_t

template<typename Context >
using awali::sttc::rat::ratexpset_impl< Context >::ldiv_t = ::awali::sttc::rat:: ldiv <label_t, weight_t>

◆ leaf_t

template<typename Context >
using awali::sttc::rat::ratexpset_impl< Context >::leaf_t = ::awali::sttc::rat:: leaf <label_t, weight_t>

◆ letter_t

template<typename Context >
using awali::sttc::rat::ratexpset_impl< Context >::letter_t = self_type

◆ lweight_t

template<typename Context >
using awali::sttc::rat::ratexpset_impl< Context >::lweight_t = ::awali::sttc::rat:: lweight <label_t, weight_t>

◆ node_t

template<typename Context >
using awali::sttc::rat::ratexpset_impl< Context >::node_t = ::awali::sttc::rat:: node <label_t, weight_t>

◆ one_t

template<typename Context >
using awali::sttc::rat::ratexpset_impl< Context >::one_t = ::awali::sttc::rat:: one <label_t, weight_t>

◆ prod_t

template<typename Context >
using awali::sttc::rat::ratexpset_impl< Context >::prod_t = ::awali::sttc::rat:: prod <label_t, weight_t>

◆ ratexp_t

template<typename Context >
using awali::sttc::rat::ratexpset_impl< Context >::ratexp_t = std::shared_ptr<const node_t>

◆ ratexps_t

template<typename Context >
using awali::sttc::rat::ratexpset_impl< Context >::ratexps_t = typename node_t::ratexps_t

◆ rweight_t

template<typename Context >
using awali::sttc::rat::ratexpset_impl< Context >::rweight_t = ::awali::sttc::rat:: rweight <label_t, weight_t>

◆ self_type

template<typename Context >
using awali::sttc::rat::ratexpset_impl< Context >::self_type = ratexpset<Context>

◆ shuffle_t

template<typename Context >
using awali::sttc::rat::ratexpset_impl< Context >::shuffle_t = ::awali::sttc::rat:: shuffle <label_t, weight_t>

◆ star_t

template<typename Context >
using awali::sttc::rat::ratexpset_impl< Context >::star_t = ::awali::sttc::rat:: star <label_t, weight_t>

◆ sum_t

template<typename Context >
using awali::sttc::rat::ratexpset_impl< Context >::sum_t = ::awali::sttc::rat:: sum <label_t, weight_t>

◆ transposition_t

template<typename Context >
using awali::sttc::rat::ratexpset_impl< Context >::transposition_t = ::awali::sttc::rat:: transposition <label_t, weight_t>

◆ type_t

template<typename Context >
using awali::sttc::rat::ratexpset_impl< Context >::type_t = typename node_t::type_t

◆ unary_t

template<typename Context >
template<exp::type_t Type>
using awali::sttc::rat::ratexpset_impl< Context >::unary_t = unary<Type, label_t, weight_t>

◆ value_t

template<typename Context >
using awali::sttc::rat::ratexpset_impl< Context >::value_t = typename node_t::value_t

The value this is a set of: typeful shared pointers.

◆ values_t

template<typename Context >
using awali::sttc::rat::ratexpset_impl< Context >::values_t = std::vector<value_t>

A value sequence.

◆ variadic_t

template<typename Context >
template<exp::type_t Type>
using awali::sttc::rat::ratexpset_impl< Context >::variadic_t = variadic<Type, label_t, weight_t>

◆ weight_t

template<typename Context >
using awali::sttc::rat::ratexpset_impl< Context >::weight_t = typename weightset_t::value_t

◆ weightset_ptr

template<typename Context >
using awali::sttc::rat::ratexpset_impl< Context >::weightset_ptr = typename context_t::weightset_ptr

◆ weightset_t

template<typename Context >
using awali::sttc::rat::ratexpset_impl< Context >::weightset_t = weightset_t_of<context_t>

◆ word_t

template<typename Context >
using awali::sttc::rat::ratexpset_impl< Context >::word_t = self_type

◆ zero_t

template<typename Context >
using awali::sttc::rat::ratexpset_impl< Context >::zero_t = ::awali::sttc::rat:: zero <label_t, weight_t>

Constructor & Destructor Documentation

◆ ratexpset_impl()

template<typename Context >
awali::sttc::rat::ratexpset_impl< Context >::ratexpset_impl ( const context_t ctx,
identities_t  identities 
)

Constructor.

Parameters
ctxthe generator set for the labels, and the weight set.
identitiesthe identities to guarantee

Member Function Documentation

◆ add()

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::add ( value_t  l,
value_t  r 
) const

◆ atom()

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::atom ( const label_t v) -> value_t
static

◆ complement()

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::complement ( value_t  e) const

Add a complement operator.

◆ concat()

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::concat ( value_t  l,
value_t  r 
) const

◆ conjunction()

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::conjunction ( value_t  l,
value_t  r 
) const

◆ context()

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::context

◆ conv() [1/10]

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::conv ( b  ,
typename b::value_t  v 
) const

◆ conv() [2/10]

template<typename Context >
template<typename GenSet >
value_t awali::sttc::rat::ratexpset_impl< Context >::conv ( const letterset< GenSet > &  ls,
typename letterset< GenSet >::value_t  v 
) const

◆ conv() [3/10]

template<typename Context >
template<typename GenSet >
auto awali::sttc::rat::ratexpset_impl< Context >::conv ( const letterset< GenSet > &  ls,
typename letterset< GenSet >::value_t  v 
) const -> value_t

◆ conv() [4/10]

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::conv ( const q ws,
typename q::value_t  v 
) const

◆ conv() [5/10]

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::conv ( const r ws,
typename r::value_t  v 
) const

◆ conv() [6/10]

template<typename Context >
template<typename Ctx2 >
auto awali::sttc::rat::ratexpset_impl< Context >::conv ( const ratexpset_impl< Ctx2 > &  rs,
typename ratexpset_impl< Ctx2 >::value_t  v 
) const -> value_t

◆ conv() [7/10]

template<typename Context >
template<typename Ctx2 >
value_t awali::sttc::rat::ratexpset_impl< Context >::conv ( const ratexpset_impl< Ctx2 > &  ws,
typename ratexpset_impl< Ctx2 >::value_t  v 
) const

◆ conv() [8/10]

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::conv ( const z ws,
typename z::value_t  v 
) const

◆ conv() [9/10]

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::conv ( self_type  rs,
value_t  v 
) const

◆ conv() [10/10]

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::conv ( std::istream &  is) const

◆ convs()

template<typename Context >
std::set<value_t> awali::sttc::rat::ratexpset_impl< Context >::convs ( std::istream &  ) const

◆ equals()

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::equals ( value_t  l,
value_t  r 
)
static

Whether l == r.

◆ gather() [1/2]

template<typename Context >
template<exp::type_t Type>
auto awali::sttc::rat::ratexpset_impl< Context >::gather ( ratexps_t res,
value_t  v 
) const -> void

◆ gather() [2/2]

template<typename Context >
template<exp::type_t Type>
auto awali::sttc::rat::ratexpset_impl< Context >::gather ( value_t  l,
value_t  r 
) const -> ratexps_t

◆ has_one()

template<typename Context >
static constexpr bool awali::sttc::rat::ratexpset_impl< Context >::has_one ( )
staticconstexpr

◆ hash()

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::hash ( const value_t l)
static

Hash l.

◆ identities()

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::identities

◆ is_commutative_semiring()

template<typename Context >
static constexpr bool awali::sttc::rat::ratexpset_impl< Context >::is_commutative_semiring ( )
staticconstexpr

◆ is_free()

template<typename Context >
static constexpr bool awali::sttc::rat::ratexpset_impl< Context >::is_free ( )
staticconstexpr

◆ is_letter()

template<typename Context >
bool awali::sttc::rat::ratexpset_impl< Context >::is_letter ( value_t  ) const

◆ is_one()

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::is_one ( value_t  v)
static

◆ is_ratexpset()

template<typename Context >
static constexpr bool awali::sttc::rat::ratexpset_impl< Context >::is_ratexpset ( )
staticconstexpr

◆ is_series()

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::is_series

◆ is_special()

template<typename Context >
static bool awali::sttc::rat::ratexpset_impl< Context >::is_special ( value_t  v)
static

When used as a LabelSet for automata.

When used as WeightSet for automata.

◆ is_zero()

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::is_zero ( value_t  v) const

◆ labelset()

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::labelset

◆ ldiv()

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::ldiv ( value_t  l,
value_t  r 
) const

◆ less_than()

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::less_than ( value_t  l,
value_t  r 
)
static

Whether l < r.

◆ letter_class() [1/2]

template<typename Context >
template<typename... Args>
auto awali::sttc::rat::ratexpset_impl< Context >::letter_class ( Args &&...  args) const -> value_t

◆ letter_class() [2/2]

template<typename Context >
template<typename... Args>
value_t awali::sttc::rat::ratexpset_impl< Context >::letter_class ( Args &&...  chars) const

A ratexp matching one character amongst chars.

◆ letter_class_() [1/2]

template<typename Context >
template<typename LabelSet_ , typename... Args>
auto awali::sttc::rat::ratexpset_impl< Context >::letter_class_ ( const Args &&  ...,
std::true_type   
) const -> value_t

◆ letter_class_() [2/2]

template<typename Context >
template<typename LabelSet_ >
auto awali::sttc::rat::ratexpset_impl< Context >::letter_class_ ( std::set< std::pair< typename LabelSet_::letter_t, typename LabelSet_::letter_t >>  ccs,
bool  accept,
std::false_type   
) const -> value_t

◆ lmul()

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::lmul ( const weight_t w,
value_t  e 
) const

Left-multiplication by a weight.

◆ make()

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::make ( std::istream &  is)
static

Build from the description in is.

◆ mul()

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::mul ( value_t  l,
value_t  r 
) const

◆ one()

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::one
static

◆ open()

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::open ( bool  o) const

Whether unknown letters should be added, or rejected.

Parameters
owhether to accept unknown letters
Returns
the previous status.

◆ parse()

template<typename Context >
value_t awali::sttc::rat::ratexpset_impl< Context >::parse ( const std::string &  s,
size_t &  p 
) const

◆ print()

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::print ( const value_t  v,
std::ostream &  o,
const std::string &  format = "text" 
) const

◆ print_set()

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

◆ rdiv()

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::rdiv ( value_t  l,
value_t  r 
) const

◆ rmul()

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::rmul ( value_t  e,
const weight_t w 
) const

Right-multiplication by a weight.

◆ show_one()

template<typename Context >
static constexpr bool awali::sttc::rat::ratexpset_impl< Context >::show_one ( )
staticconstexpr

◆ shuffle()

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::shuffle ( value_t  l,
value_t  r 
) const

◆ sname()

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::sname
static

Static description key.

◆ special()

template<typename Context >
static value_t awali::sttc::rat::ratexpset_impl< Context >::special ( )
static

When used as a LabelSet for automata.

◆ star()

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::star ( value_t  e) const

◆ star_status()

template<typename Context >
static constexpr star_status_t awali::sttc::rat::ratexpset_impl< Context >::star_status ( )
staticconstexpr

◆ to_json()

template<typename Context >
template<unsigned version = version::fsm_json>
json::node_t* awali::sttc::rat::ratexpset_impl< Context >::to_json ( ) const

◆ to_string()

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::to_string ( value_t  e) const

◆ transpose()

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::transpose ( value_t  e) const

The transposed of this rational expression.

◆ transposition()

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::transposition ( value_t  e) const

Add a transposition operator.

◆ value_from_json()

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

◆ value_to_json()

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

◆ vname()

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::vname ( bool  full = true) const

Dynamic description key.

◆ weightset()

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::weightset

◆ word()

template<typename Context >
word_t awali::sttc::rat::ratexpset_impl< Context >::word ( label_t  l) const

Make a ‘word’ out of a ratexp.

◆ zero()

template<typename Context >
auto awali::sttc::rat::ratexpset_impl< Context >::zero

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