Awali
Another Weighted Automata library
Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Static Public Attributes
awali::sttc::internal::tuple_automaton_impl< Aut, Auts > Class Template Reference

An automaton whose states are tuples of states of automata. More...

#include <tuple_automaton.hh>

Inheritance diagram for awali::sttc::internal::tuple_automaton_impl< Aut, Auts >:
awali::sttc::internal::automaton_decorator< Aut, Context >

Public Types

using automata_t = std::tuple< Auts... >
 The type of input automata. More...
 
using context_t = context_t_of< Aut >
 The type of context of the result. More...
 
using indices_t = awali::internal::make_index_sequence< sizeof...(Auts)>
 The list of automaton indices as a static list. More...
 
template<size_t I>
using input_automaton_t = internal::base_t< typename std::tuple_element< I, automata_t >::type >
 The type of the Ith input automaton, unqualified. More...
 
using label_t = typename labelset_t::value_t
 
using labelset_t = labelset_t_of< context_t >
 
using map = std::map< pair_t, state_t >
 Map state-tuple -> result-state. More...
 
using origins_t = std::map< state_t, pair_t >
 A map from result state to tuple of original states. More...
 
using pair_t = std::tuple< state_t_of< Auts >... >
 Tuple of states of input automata. More...
 
template<std::size_t... I>
using seq = awali::internal::index_sequence< I... >
 A static list of integers. More...
 
using weight_t = typename weightset_t::value_t
 
using weightset_t = weightset_t_of< context_t >
 
- Public Types inherited from awali::sttc::internal::automaton_decorator< Aut, Context >
using automaton_nocv_t = typename automaton_t::element_type::automaton_nocv_t
 The (shared pointer) type to use it we have to create an automaton of the same (underlying) type. More...
 
using automaton_t = Aut
 The type of automaton to wrap. More...
 
using context_t = Context
 
using kind_t = typename context_t::kind_t
 
using label_t = typename labelset_t::value_t
 
using labelset_ptr = typename context_t::labelset_ptr
 
using labelset_t = typename context_t::labelset_t
 
using weight_t = typename weightset_t::value_t
 
using weightset_ptr = typename context_t::weightset_ptr
 
using weightset_t = typename context_t::weightset_t
 

Public Member Functions

 tuple_automaton_impl (const automaton_t &aut, const Auts &... auts)
 
const origins_torigins () const
 A map from result state to tuple of original states. More...
 
pair_t post_ () const
 The name of the post of the output automaton. More...
 
template<size_t... I>
pair_t post_ (seq< I... >) const
 
pair_t pre_ () const
 The name of the pre of the output automaton. More...
 
template<size_t... I>
pair_t pre_ (seq< I... >) const
 
std::ostream & print_state_name (typename super_t::state_t s, std::ostream &o, const std::string &fmt="text") const
 
template<size_t... I>
std::ostream & print_state_name_ (typename super_t::state_t s, std::ostream &o, const std::string &fmt, seq< I... >) const
 
state_t state (pair_t state)
 The state in the product corresponding to a pair of states of operands. More...
 
state_t state (state_t_of< Auts >... ss)
 
std::string vname (bool full=true) const
 
template<size_t... I>
std::string vname_ (bool full, seq< I... >) const
 
std::string vname_ (bool full=true) const
 The vname of the sub automata. More...
 
- Public Member Functions inherited from awali::sttc::internal::automaton_decorator< Aut, Context >
 automaton_decorator (automaton_decorator &&aut)
 
 automaton_decorator (automaton_t aut)
 
 automaton_decorator (const automaton_decorator &aut)
 
 automaton_decorator (const context_t &ctx)
 
template<typename... Args>
auto add_final (Args &&... args) -> decltype(aut_-> add_ final(std
 
template<typename... Args>
auto add_initial (Args &&... args) -> decltype(aut_-> add_initial(std::forward< Args >(args)...))
 
template<typename... Args>
auto add_state (Args &&... args) -> decltype(aut_-> add_state(std::forward< Args >(args)...))
 
template<typename... Args>
auto add_transition (Args &&... args) -> decltype(aut_-> add_transition(std::forward< Args >(args)...))
 
template<typename... Args>
auto add_transition_copy (Args &&... args) -> decltype(aut_-> add_transition_copy(std::forward< Args >(args)...))
 
template<typename... Args>
auto add_weight (Args &&... args) -> decltype(aut_-> add_weight(std::forward< Args >(args)...))
 
template<typename... Args>
auto all_in (Args &&... args) const -> decltype(aut_-> all_in(std::forward< Args >(args)...))
 
template<typename... Args>
auto all_out (Args &&... args) const -> decltype(aut_-> all_out(std::forward< Args >(args)...))
 
template<typename... Args>
auto all_states (Args &&... args) const -> decltype(aut_-> all_states(std::forward< Args >(args)...))
 
template<typename... Args>
auto all_transitions (Args &&... args) const -> decltype(aut_-> all_transitions(std::forward< Args >(args)...))
 
template<typename... Args>
auto context (Args &&... args) const -> decltype(aut_-> context(std::forward< Args >(args)...))
 
template<typename... Args>
auto del_state (Args &&... args) -> decltype(aut_-> del_state(std::forward< Args >(args)...))
 
template<typename... Args>
auto del_transition (Args &&... args) -> decltype(aut_-> del_transition(std::forward< Args >(args)...))
 
template<typename... Args>
auto dst_of (Args &&... args) const -> decltype(aut_-> dst_of(std::forward< Args >(args)...))
 
template<typename... Args>
auto final_transitions (Args &&... args) const -> decltype(aut_-> final _transitions(std
 
template<typename... Args>
auto get_final_weight (Args &&... args) const -> decltype(aut_-> get_ final _weight(std
 
template<typename... Args>
auto get_initial_weight (Args &&... args) const -> decltype(aut_-> get_initial_weight(std::forward< Args >(args)...))
 
template<typename... Args>
auto get_transition (Args &&... args) const -> decltype(aut_-> get_transition(std::forward< Args >(args)...))
 
template<typename... Args>
auto has_state (Args &&... args) const -> decltype(aut_-> has_state(std::forward< Args >(args)...))
 
template<typename... Args>
auto has_transition (Args &&... args) const -> decltype(aut_-> has_transition(std::forward< Args >(args)...))
 
template<typename... Args>
auto in (Args &&... args) const -> decltype(aut_-> in(std::forward< Args >(args)...))
 
template<typename... Args>
auto initial_transitions (Args &&... args) const -> decltype(aut_-> initial_transitions(std::forward< Args >(args)...))
 
template<typename... Args>
auto is_final (Args &&... args) const -> decltype(aut_-> is_ final(std
 
template<typename... Args>
auto is_initial (Args &&... args) const -> decltype(aut_-> is_initial(std::forward< Args >(args)...))
 
template<typename... Args>
auto label_of (Args &&... args) const -> decltype(aut_-> label_of(std::forward< Args >(args)...))
 
template<typename... Args>
auto labelset (Args &&... args) const -> decltype(aut_-> labelset(std::forward< Args >(args)...))
 
template<typename... Args>
auto lmul_weight (Args &&... args) -> decltype(aut_-> lmul_weight(std::forward< Args >(args)...))
 
template<typename... Args>
auto new_transition (Args &&... args) -> decltype(aut_-> new_transition(std::forward< Args >(args)...))
 
template<typename... Args>
auto new_transition_copy (Args &&... args) -> decltype(aut_-> new_transition_copy(std::forward< Args >(args)...))
 
template<typename... Args>
auto num_all_states (Args &&... args) const -> decltype(aut_-> num_all_states(std::forward< Args >(args)...))
 
template<typename... Args>
auto num_finals (Args &&... args) const -> decltype(aut_-> num_ final s(std
 
template<typename... Args>
auto num_initials (Args &&... args) const -> decltype(aut_-> num_initials(std::forward< Args >(args)...))
 
template<typename... Args>
auto num_states (Args &&... args) const -> decltype(aut_-> num_states(std::forward< Args >(args)...))
 
template<typename... Args>
auto num_transitions (Args &&... args) const -> decltype(aut_-> num_transitions(std::forward< Args >(args)...))
 
automaton_decoratoroperator= (automaton_decorator &&that)
 
template<typename... Args>
auto out (Args &&... args) const -> decltype(aut_-> out(std::forward< Args >(args)...))
 
template<typename... Args>
auto outin (Args &&... args) const -> decltype(aut_-> outin(std::forward< Args >(args)...))
 
template<typename... Args>
auto print_state (Args &&... args) const -> decltype(aut_-> print_state(std::forward< Args >(args)...))
 
template<typename... Args>
auto print_state_name (Args &&... args) const -> decltype(aut_-> print_state_name(std::forward< Args >(args)...))
 
template<typename... Args>
auto rmul_weight (Args &&... args) -> decltype(aut_-> rmul_weight(std::forward< Args >(args)...))
 
template<typename... Args>
auto set_final (Args &&... args) -> decltype(aut_-> set_ final(std
 
template<typename... Args>
auto set_initial (Args &&... args) -> decltype(aut_-> set_initial(std::forward< Args >(args)...))
 
template<typename... Args>
auto set_transition (Args &&... args) -> decltype(aut_-> set_transition(std::forward< Args >(args)...))
 
template<typename... Args>
auto set_weight (Args &&... args) -> decltype(aut_-> set_weight(std::forward< Args >(args)...))
 
template<typename... Args>
auto src_of (Args &&... args) const -> decltype(aut_-> src_of(std::forward< Args >(args)...))
 
template<typename... Args>
auto states (Args &&... args) const -> decltype(aut_-> states(std::forward< Args >(args)...))
 
automaton_t strip_history ()
 
template<typename... Args>
auto transitions (Args &&... args) const -> decltype(aut_-> transitions(std::forward< Args >(args)...))
 
template<typename... Args>
auto unset_final (Args &&... args) -> decltype(aut_-> unset_ final(std
 
template<typename... Args>
auto unset_initial (Args &&... args) -> decltype(aut_-> unset_initial(std::forward< Args >(args)...))
 
template<typename... Args>
auto vname (Args &&... args) const -> decltype(aut_-> vname(std::forward< Args >(args)...))
 
template<typename... Args>
auto weight_of (Args &&... args) const -> decltype(aut_-> weight_of(std::forward< Args >(args)...))
 
template<typename... Args>
auto weightset (Args &&... args) const -> decltype(aut_-> weightset(std::forward< Args >(args)...))
 

Static Public Member Functions

static std::string sname ()
 
static std::string sname_ ()
 The sname of the sub automata. More...
 
- Static Public Member Functions inherited from awali::sttc::internal::automaton_decorator< Aut, Context >
template<typename... Args>
static constexpr auto null_state (Args &&... args) -> decltype(automaton_t::element_type::null_state(std::forward< Args >(args)...))
 
template<typename... Args>
static constexpr auto null_transition (Args &&... args) -> decltype(automaton_t::element_type::null_transition(std::forward< Args >(args)...))
 
template<typename... Args>
static constexpr auto post (Args &&... args) -> decltype(automaton_t::element_type::post(std::forward< Args >(args)...))
 
template<typename... Args>
static constexpr auto pre (Args &&... args) -> decltype(automaton_t::element_type::pre(std::forward< Args >(args)...))
 
template<typename... Args>
static constexpr auto sname (Args &&... args) -> decltype(automaton_t::element_type::sname(std::forward< Args >(args)...))
 

Data Fields

automaton_t aut_
 The wrapped automaton, possibly const. More...
 
automata_t auts_
 Input automata, supplied at construction time. More...
 
origins_t origins_
 
map pmap_
 
std::deque< pair_ttodo_
 Worklist of state tuples. More...
 

Static Public Attributes

static constexpr indices_t indices {}
 

Additional Inherited Members

- Protected Attributes inherited from awali::sttc::internal::automaton_decorator< Aut, Context >
automaton_t aut_
 The wrapped automaton, possibly const. More...
 

Detailed Description

template<typename Aut, typename... Auts>
class awali::sttc::internal::tuple_automaton_impl< Aut, Auts >

An automaton whose states are tuples of states of automata.

Corresponds to the Cartesian product of states.

Template Parameters
Autthe output automaton type
Autsthe input automaton types

Member Typedef Documentation

◆ automata_t

template<typename Aut , typename... Auts>
using awali::sttc::internal::tuple_automaton_impl< Aut, Auts >::automata_t = std::tuple<Auts...>

The type of input automata.

◆ context_t

template<typename Aut , typename... Auts>
using awali::sttc::internal::tuple_automaton_impl< Aut, Auts >::context_t = context_t_of<Aut>

The type of context of the result.

The type is the "join" of the contexts, independently of the algorithm. However, its value differs: in the case of the product, the labelset is the meet of the labelsets, it is its join for shuffle and infiltration.

◆ indices_t

template<typename Aut , typename... Auts>
using awali::sttc::internal::tuple_automaton_impl< Aut, Auts >::indices_t = awali::internal::make_index_sequence<sizeof...(Auts)>

The list of automaton indices as a static list.

◆ input_automaton_t

template<typename Aut , typename... Auts>
template<size_t I>
using awali::sttc::internal::tuple_automaton_impl< Aut, Auts >::input_automaton_t = internal::base_t<typename std::tuple_element<I, automata_t>::type>

The type of the Ith input automaton, unqualified.

◆ label_t

template<typename Aut , typename... Auts>
using awali::sttc::internal::tuple_automaton_impl< Aut, Auts >::label_t = typename labelset_t::value_t

◆ labelset_t

template<typename Aut , typename... Auts>
using awali::sttc::internal::tuple_automaton_impl< Aut, Auts >::labelset_t = labelset_t_of<context_t>

◆ map

template<typename Aut , typename... Auts>
using awali::sttc::internal::tuple_automaton_impl< Aut, Auts >::map = std::map<pair_t, state_t>

Map state-tuple -> result-state.

◆ origins_t

template<typename Aut , typename... Auts>
using awali::sttc::internal::tuple_automaton_impl< Aut, Auts >::origins_t = std::map<state_t, pair_t>

A map from result state to tuple of original states.

◆ pair_t

template<typename Aut , typename... Auts>
using awali::sttc::internal::tuple_automaton_impl< Aut, Auts >::pair_t = std::tuple<state_t_of<Auts>...>

Tuple of states of input automata.

◆ seq

template<typename Aut , typename... Auts>
template<std::size_t... I>
using awali::sttc::internal::tuple_automaton_impl< Aut, Auts >::seq = awali::internal::index_sequence<I...>

A static list of integers.

◆ weight_t

template<typename Aut , typename... Auts>
using awali::sttc::internal::tuple_automaton_impl< Aut, Auts >::weight_t = typename weightset_t::value_t

◆ weightset_t

template<typename Aut , typename... Auts>
using awali::sttc::internal::tuple_automaton_impl< Aut, Auts >::weightset_t = weightset_t_of<context_t>

Constructor & Destructor Documentation

◆ tuple_automaton_impl()

template<typename Aut , typename... Auts>
awali::sttc::internal::tuple_automaton_impl< Aut, Auts >::tuple_automaton_impl ( const automaton_t aut,
const Auts &...  auts 
)

Member Function Documentation

◆ origins()

template<typename Aut , typename... Auts>
const origins_t& awali::sttc::internal::tuple_automaton_impl< Aut, Auts >::origins ( ) const

A map from result state to tuple of original states.

◆ post_() [1/2]

template<typename Aut , typename... Auts>
pair_t awali::sttc::internal::tuple_automaton_impl< Aut, Auts >::post_ ( ) const

The name of the post of the output automaton.

◆ post_() [2/2]

template<typename Aut , typename... Auts>
template<size_t... I>
pair_t awali::sttc::internal::tuple_automaton_impl< Aut, Auts >::post_ ( seq< I... >  ) const

◆ pre_() [1/2]

template<typename Aut , typename... Auts>
pair_t awali::sttc::internal::tuple_automaton_impl< Aut, Auts >::pre_ ( ) const

The name of the pre of the output automaton.

◆ pre_() [2/2]

template<typename Aut , typename... Auts>
template<size_t... I>
pair_t awali::sttc::internal::tuple_automaton_impl< Aut, Auts >::pre_ ( seq< I... >  ) const

◆ print_state_name()

template<typename Aut , typename... Auts>
std::ostream& awali::sttc::internal::tuple_automaton_impl< Aut, Auts >::print_state_name ( typename super_t::state_t  s,
std::ostream &  o,
const std::string &  fmt = "text" 
) const

◆ print_state_name_()

template<typename Aut , typename... Auts>
template<size_t... I>
std::ostream& awali::sttc::internal::tuple_automaton_impl< Aut, Auts >::print_state_name_ ( typename super_t::state_t  s,
std::ostream &  o,
const std::string &  fmt,
seq< I... >   
) const

◆ sname()

template<typename Aut , typename... Auts>
static std::string awali::sttc::internal::tuple_automaton_impl< Aut, Auts >::sname ( )
static

◆ sname_()

template<typename Aut , typename... Auts>
static std::string awali::sttc::internal::tuple_automaton_impl< Aut, Auts >::sname_ ( )
static

The sname of the sub automata.

◆ state() [1/2]

template<typename Aut , typename... Auts>
state_t awali::sttc::internal::tuple_automaton_impl< Aut, Auts >::state ( pair_t  state)

The state in the product corresponding to a pair of states of operands.

Add the given two source-automaton states to the worklist for the given result automaton if they aren't already there, updating the map; in any case return.

◆ state() [2/2]

template<typename Aut , typename... Auts>
state_t awali::sttc::internal::tuple_automaton_impl< Aut, Auts >::state ( state_t_of< Auts >...  ss)

◆ vname()

template<typename Aut , typename... Auts>
std::string awali::sttc::internal::tuple_automaton_impl< Aut, Auts >::vname ( bool  full = true) const

◆ vname_() [1/2]

template<typename Aut , typename... Auts>
template<size_t... I>
std::string awali::sttc::internal::tuple_automaton_impl< Aut, Auts >::vname_ ( bool  full,
seq< I... >   
) const

◆ vname_() [2/2]

template<typename Aut , typename... Auts>
std::string awali::sttc::internal::tuple_automaton_impl< Aut, Auts >::vname_ ( bool  full = true) const

The vname of the sub automata.

Field Documentation

◆ aut_

template<typename Aut , typename... Auts>
automaton_t awali::sttc::internal::automaton_decorator< Aut, Context >::aut_

The wrapped automaton, possibly const.

◆ auts_

template<typename Aut , typename... Auts>
automata_t awali::sttc::internal::tuple_automaton_impl< Aut, Auts >::auts_

Input automata, supplied at construction time.

◆ indices

template<typename Aut , typename... Auts>
constexpr indices_t awali::sttc::internal::tuple_automaton_impl< Aut, Auts >::indices {}
staticconstexpr

◆ origins_

template<typename Aut , typename... Auts>
origins_t awali::sttc::internal::tuple_automaton_impl< Aut, Auts >::origins_
mutable

◆ pmap_

template<typename Aut , typename... Auts>
map awali::sttc::internal::tuple_automaton_impl< Aut, Auts >::pmap_

◆ todo_

template<typename Aut , typename... Auts>
std::deque<pair_t> awali::sttc::internal::tuple_automaton_impl< Aut, Auts >::todo_

Worklist of state tuples.


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