Vcsn
2.0
Be Rational
|
Build the (accessible part of the) product. More...
#include <product.hh>
Public Types | |
template<size_t... I> | |
using | seq = typename super_t::template seq< I...> |
using | context_t = context_t_of< Aut > |
The context of the result. More... | |
using | labelset_t = labelset_t_of< context_t > |
using | weightset_t = weightset_t_of< context_t > |
using | label_t = typename labelset_t::value_t |
using | weight_t = typename weightset_t::value_t |
using | automata_t = std::tuple< Auts...> |
The type of input automata. More... | |
template<size_t I> | |
using | input_automaton_t = base_t< typename std::tuple_element< I, automata_t >::type > |
The type of the Ith input automaton, unqualified. More... | |
using | state_name_t = std::tuple< state_t_of< Auts >...> |
State names: Tuple of states of input automata. More... | |
using | state_t = state_t_of< automaton_t > |
Result state type. More... | |
Public Types inherited from vcsn::detail::tuple_automaton_impl< Aut, Auts...> | |
using | context_t = context_t_of< Aut > |
The type of context of the result. More... | |
using | labelset_t = labelset_t_of< context_t > |
using | weightset_t = weightset_t_of< context_t > |
using | label_t = typename labelset_t::value_t |
using | weight_t = typename weightset_t::value_t |
using | automata_t = std::tuple< Auts...> |
The type of input automata. More... | |
using | input_automaton_t = base_t< typename std::tuple_element< I, automata_t >::type > |
The type of the Ith input automaton, unqualified. More... | |
using | state_t = state_t_of< automaton_t > |
Result state type. More... | |
using | state_name_t = std::tuple< state_t_of< Auts >...> |
State names: Tuple of states of input automata. More... | |
using | origins_t = std::map< state_t, state_name_t > |
A map from result state to tuple of original states. More... | |
using | seq = vcsn::detail::index_sequence< I...> |
A static list of integers. More... | |
using | indices_t = vcsn::detail::make_index_sequence< sizeof...(Auts)> |
The list of automaton indices as a static list. More... | |
using | map = std::map< state_name_t, state_t > |
Map state-tuple -> result-state. More... | |
Public Types inherited from vcsn::detail::automaton_decorator< Aut > | |
using | automaton_t = Aut |
The type of automaton to wrap. More... | |
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 | context_t = Context |
using | kind_t = typename context_t::kind_t |
using | labelset_t = typename context_t::labelset_t |
using | labelset_ptr = typename context_t::labelset_ptr |
using | label_t = typename labelset_t::value_t |
using | weightset_t = typename context_t::weightset_t |
using | weightset_ptr = typename context_t::weightset_ptr |
using | weight_t = typename weightset_t::value_t |
using | state_t = state_t_of< automaton_t > |
using | transition_t = transition_t_of< automaton_t > |
using | transitions_output_t = typename Aut::element_type::transitions_output_t |
Public Member Functions | |
std::string | vname (bool full=true) const |
product_automaton_impl (Aut aut, const Auts &...auts) | |
std::tuple< typename transition_map_t< Auts > ::map_t &...> | out_ (const state_name_t &ss) |
The outgoing tuple of transitions from state tuple ss. More... | |
template<size_t... I> | |
std::tuple< typename transition_map_t< Auts > ::map_t &...> | out_ (const state_name_t &ss, seq< I...>) |
void | add_product_transitions (const state_t src, const state_name_t &psrc) |
Add transitions to the given result automaton, starting from the given result input state, which must correspond to the given pair of input state automata. More... | |
template<std::size_t... I> | |
void | add_one_transitions_ (const state_t src, const state_name_t &psrc, seq< I...>) |
Add the spontaneous transitions leaving state src, if it is relevant (i.e. More... | |
template<std::size_t I, typename L > | |
std::enable_if<!L::has_one(), void >::type | maybe_add_one_transitions_ (const L &, const state_t, const state_name_t &) |
In the case where the labelset doesn't have one, do nothing. More... | |
template<std::size_t I, typename L > | |
std::enable_if< L::has_one(), void >::type | maybe_add_one_transitions_ (const L &ls, const state_t src, const state_name_t &psrc) |
If the labelset has one, add the relevant spontaneous-transitions leaving the state. More... | |
template<std::size_t... I> | |
bool | has_one_in (const state_name_t &psrc, std::size_t i, seq< I...>) const |
Check if all the tapes after the Ith have only incoming spontaneous transitions. More... | |
template<std::size_t... I> | |
bool | has_only_one_out (const state_name_t &psrc, std::size_t i, seq< I...>) |
Check if all the tapes before the Ith have only outgoing spontaneous transitions. More... | |
template<typename Aut_ > | |
std::enable_if< labelset_t_of < Aut_ >::has_one(), bool > ::type | is_one (const Aut_ &aut, transition_t_of< Aut_ > tr) const |
Check if the transition is spontaneous (in the case of a labelset with one). More... | |
template<typename Aut_ > | |
constexpr std::enable_if <!labelset_t_of< Aut_ > ::has_one(), bool >::type | is_one (const Aut_ &, transition_t_of< Aut_ >) const |
Same as above, but for labelsets without one, so it's always false. More... | |
template<typename Aut_ > | |
constexpr std::enable_if <!labelset_t_of< Aut_ > ::has_one(), bool >::type | has_only_ones_in (const Aut_ &, state_t_of< Aut_ >) const |
Check if the state has only incoming spontaneous transitions. More... | |
template<typename Aut_ > | |
std::enable_if< labelset_t_of < Aut_ >::has_one(), bool > ::type | has_only_ones_in (const Aut_ &rhs, state_t_of< Aut_ > rst) const |
Whether the state has only incoming spontaneous transitions. More... | |
template<size_t I> | |
bool | has_only_ones_out (const state_name_t &psrc) |
Whether the Ith state of psrc in the Ith input automaton has no non-spontaneous outgoing transitions. More... | |
void | add_shuffle_transitions (const state_t src, const state_name_t &psrc) |
Add transitions to the given result automaton, starting from the given result input state, which must correspond to the given tuple of input state automata. More... | |
template<size_t... I> | |
weight_t | add_shuffle_transitions_ (const state_t src, const state_name_t &psrc, seq< I...>) |
Let all automata advance one after the other, and add the corresponding transitions in the output. More... | |
template<size_t I> | |
weight_t | add_shuffle_transitions_ (const state_t src, const state_name_t &psrc) |
Let Ith automaton advance, and add the corresponding transitions in the output. More... | |
Public Member Functions inherited from vcsn::detail::tuple_automaton_impl< Aut, Auts...> | |
std::string | vname (bool full=true) const |
tuple_automaton_impl (const automaton_t &aut, const Auts &...auts) | |
bool | state_has_name (typename super_t::state_t s) const |
std::ostream & | print_state_name (typename super_t::state_t s, std::ostream &o, const std::string &fmt="text", bool delimit=false) const |
const origins_t & | origins () const |
A map from result state to tuple of original states. More... | |
std::string | vname_ (bool full=true) const |
The vname of the sub automata. More... | |
std::string | vname_ (bool full, seq< I...>) const |
state_name_t | pre_ () const |
The name of the pre of the output automaton. More... | |
state_name_t | pre_ (seq< I...>) const |
state_name_t | post_ () const |
The name of the post of the output automaton. More... | |
state_name_t | post_ (seq< I...>) const |
state_t | state (state_name_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::ostream & | print_state_name_ (typename super_t::state_t s, std::ostream &o, const std::string &fmt, seq< I...>) const |
Public Member Functions inherited from vcsn::detail::automaton_decorator< Aut > | |
automaton_decorator (automaton_t aut) | |
automaton_decorator (const automaton_decorator &aut) | |
automaton_decorator (const context_t &ctx) | |
automaton_decorator (automaton_decorator &&aut) | |
automaton_decorator & | operator= (automaton_decorator &&that) |
automaton_t | strip () |
auto | all_in (Args &&...args) const -> decltype(aut_-> all_in(std::forward< Args >(args)...)) |
auto | all_out (Args &&...args) const -> decltype(aut_-> all_out(std::forward< Args >(args)...)) |
auto | all_states (Args &&...args) const -> decltype(aut_-> all_states(std::forward< Args >(args)...)) |
auto | all_transitions (Args &&...args) const -> decltype(aut_-> all_transitions(std::forward< Args >(args)...)) |
auto | context (Args &&...args) const -> decltype(aut_-> context(std::forward< Args >(args)...)) |
auto | dst_of (Args &&...args) const -> decltype(aut_-> dst_of(std::forward< Args >(args)...)) |
auto | final_transitions (Args &&...args) const -> decltype(aut_-> final _transitions(std |
auto | get_final_weight (Args &&...args) const -> decltype(aut_-> get_ final _weight(std |
auto | get_initial_weight (Args &&...args) const -> decltype(aut_-> get_initial_weight(std::forward< Args >(args)...)) |
auto | get_transition (Args &&...args) const -> decltype(aut_-> get_transition(std::forward< Args >(args)...)) |
auto | has_transition (Args &&...args) const -> decltype(aut_-> has_transition(std::forward< Args >(args)...)) |
auto | has_state (Args &&...args) const -> decltype(aut_-> has_state(std::forward< Args >(args)...)) |
auto | in (Args &&...args) const -> decltype(aut_-> in(std::forward< Args >(args)...)) |
auto | initial_transitions (Args &&...args) const -> decltype(aut_-> initial_transitions(std::forward< Args >(args)...)) |
auto | is_final (Args &&...args) const -> decltype(aut_-> is_ final(std |
auto | is_initial (Args &&...args) const -> decltype(aut_-> is_initial(std::forward< Args >(args)...)) |
auto | label_of (Args &&...args) const -> decltype(aut_-> label_of(std::forward< Args >(args)...)) |
auto | labelset (Args &&...args) const -> decltype(aut_-> labelset(std::forward< Args >(args)...)) |
auto | num_all_states (Args &&...args) const -> decltype(aut_-> num_all_states(std::forward< Args >(args)...)) |
auto | num_finals (Args &&...args) const -> decltype(aut_-> num_ final s(std |
auto | num_initials (Args &&...args) const -> decltype(aut_-> num_initials(std::forward< Args >(args)...)) |
auto | num_states (Args &&...args) const -> decltype(aut_-> num_states(std::forward< Args >(args)...)) |
auto | num_transitions (Args &&...args) const -> decltype(aut_-> num_transitions(std::forward< Args >(args)...)) |
auto | out (Args &&...args) const -> decltype(aut_-> out(std::forward< Args >(args)...)) |
auto | outin (Args &&...args) const -> decltype(aut_-> outin(std::forward< Args >(args)...)) |
auto | print_state (Args &&...args) const -> decltype(aut_-> print_state(std::forward< Args >(args)...)) |
auto | print_state_name (Args &&...args) const -> decltype(aut_-> print_state_name(std::forward< Args >(args)...)) |
auto | src_of (Args &&...args) const -> decltype(aut_-> src_of(std::forward< Args >(args)...)) |
auto | state_has_name (Args &&...args) const -> decltype(aut_-> state_has_name(std::forward< Args >(args)...)) |
auto | states (Args &&...args) const -> decltype(aut_-> states(std::forward< Args >(args)...)) |
auto | transitions (Args &&...args) const -> decltype(aut_-> transitions(std::forward< Args >(args)...)) |
auto | vname (Args &&...args) const -> decltype(aut_-> vname(std::forward< Args >(args)...)) |
auto | weight_of (Args &&...args) const -> decltype(aut_-> weight_of(std::forward< Args >(args)...)) |
auto | weightset (Args &&...args) const -> decltype(aut_-> weightset(std::forward< Args >(args)...)) |
auto | add_final (Args &&...args) -> decltype(aut_-> add_ final(std |
auto | add_initial (Args &&...args) -> decltype(aut_-> add_initial(std::forward< Args >(args)...)) |
auto | add_transition (Args &&...args) -> decltype(aut_-> add_transition(std::forward< Args >(args)...)) |
auto | add_transition_copy (Args &&...args) -> decltype(aut_-> add_transition_copy(std::forward< Args >(args)...)) |
auto | add_weight (Args &&...args) -> decltype(aut_-> add_weight(std::forward< Args >(args)...)) |
auto | del_state (Args &&...args) -> decltype(aut_-> del_state(std::forward< Args >(args)...)) |
auto | del_transition (Args &&...args) -> decltype(aut_-> del_transition(std::forward< Args >(args)...)) |
auto | lmul_weight (Args &&...args) -> decltype(aut_-> lmul_weight(std::forward< Args >(args)...)) |
auto | new_state (Args &&...args) -> decltype(aut_-> new_state(std::forward< Args >(args)...)) |
auto | new_transition (Args &&...args) -> decltype(aut_-> new_transition(std::forward< Args >(args)...)) |
auto | new_transition_copy (Args &&...args) -> decltype(aut_-> new_transition_copy(std::forward< Args >(args)...)) |
auto | rmul_weight (Args &&...args) -> decltype(aut_-> rmul_weight(std::forward< Args >(args)...)) |
auto | set_final (Args &&...args) -> decltype(aut_-> set_ final(std |
auto | set_initial (Args &&...args) -> decltype(aut_-> set_initial(std::forward< Args >(args)...)) |
auto | set_transition (Args &&...args) -> decltype(aut_-> set_transition(std::forward< Args >(args)...)) |
auto | set_weight (Args &&...args) -> decltype(aut_-> set_weight(std::forward< Args >(args)...)) |
auto | unset_final (Args &&...args) -> decltype(aut_-> unset_ final(std |
auto | unset_initial (Args &&...args) -> decltype(aut_-> unset_initial(std::forward< Args >(args)...)) |
Static Public Member Functions | |
static std::string | sname () |
Static Public Member Functions inherited from vcsn::detail::tuple_automaton_impl< Aut, Auts...> | |
static std::string | sname () |
static std::string | sname_ () |
The sname of the sub automata. More... | |
Static Public Member Functions inherited from vcsn::detail::automaton_decorator< Aut > | |
static constexpr auto | null_state (Args &&...args) -> decltype(automaton_t::element_type::null_state(std::forward< Args >(args)...)) |
static constexpr auto | null_transition (Args &&...args) -> decltype(automaton_t::element_type::null_transition(std::forward< Args >(args)...)) |
static constexpr auto | post (Args &&...args) -> decltype(automaton_t::element_type::post(std::forward< Args >(args)...)) |
static constexpr auto | pre (Args &&...args) -> decltype(automaton_t::element_type::pre(std::forward< Args >(args)...)) |
static constexpr auto | sname (Args &&...args) -> decltype(automaton_t::element_type::sname(std::forward< Args >(args)...)) |
Public Attributes | |
std::tuple< transition_map_t < Auts >...> | transition_maps_ |
Transition caches. More... | |
Public Attributes inherited from vcsn::detail::tuple_automaton_impl< Aut, Auts...> | |
automata_t | auts_ |
Input automata, supplied at construction time. More... | |
map | pmap_ |
std::deque< state_name_t > | todo_ |
Worklist of state tuples. More... | |
origins_t | origins_ |
Private Types | |
using | automaton_t = Aut |
The type of the resulting automaton. More... | |
using | super_t = tuple_automaton_impl< automaton_t, Auts...> |
Additional Inherited Members | |
Static Public Attributes inherited from vcsn::detail::tuple_automaton_impl< Aut, Auts...> | |
static constexpr indices_t | indices |
Protected Attributes inherited from vcsn::detail::automaton_decorator< Aut > | |
automaton_t | aut_ |
The wrapped automaton, possibly const. More... | |
Build the (accessible part of the) product.
Definition at line 47 of file product.hh.
using vcsn::detail::product_automaton_impl< Aut, Auts >::automata_t = std::tuple<Auts...> |
The type of input automata.
Definition at line 92 of file product.hh.
|
private |
The type of the resulting automaton.
Definition at line 54 of file product.hh.
using vcsn::detail::product_automaton_impl< Aut, Auts >::context_t = context_t_of<Aut> |
The context of the result.
Definition at line 83 of file product.hh.
using vcsn::detail::product_automaton_impl< Aut, Auts >::input_automaton_t = base_t<typename std::tuple_element<I, automata_t>::type> |
The type of the Ith input automaton, unqualified.
Definition at line 97 of file product.hh.
using vcsn::detail::product_automaton_impl< Aut, Auts >::label_t = typename labelset_t::value_t |
Definition at line 87 of file product.hh.
using vcsn::detail::product_automaton_impl< Aut, Auts >::labelset_t = labelset_t_of<context_t> |
Definition at line 84 of file product.hh.
using vcsn::detail::product_automaton_impl< Aut, Auts >::seq = typename super_t::template seq<I...> |
Definition at line 61 of file product.hh.
using vcsn::detail::tuple_automaton_impl< Aut, Auts >::state_name_t = std::tuple<state_t_of<Auts>...> |
State names: Tuple of states of input automata.
Definition at line 104 of file tuple-automaton.hh.
using vcsn::detail::tuple_automaton_impl< Aut, Auts >::state_t = state_t_of<automaton_t> |
Result state type.
Definition at line 102 of file tuple-automaton.hh.
|
private |
Definition at line 55 of file product.hh.
using vcsn::detail::product_automaton_impl< Aut, Auts >::weight_t = typename weightset_t::value_t |
Definition at line 88 of file product.hh.
using vcsn::detail::product_automaton_impl< Aut, Auts >::weightset_t = weightset_t_of<context_t> |
Definition at line 85 of file product.hh.
|
inline |
Definition at line 101 of file product.hh.
References vcsn::detail::automaton_decorator< Aut >::aut_.
|
inline |
Add the spontaneous transitions leaving state src, if it is relevant (i.e.
only for the labelsets that have one).
Definition at line 223 of file product.hh.
References vcsn::detail::tuple_automaton_impl< Aut, Auts...>::auts_, and vcsn::detail::automaton_decorator< Aut >::labelset().
Referenced by vcsn::detail::product_automaton_impl< Aut, Auts >::add_product_transitions().
|
inline |
Add transitions to the given result automaton, starting from the given result input state, which must correspond to the given pair of input state automata.
Update the worklist with the needed source-state pairs.
Definition at line 200 of file product.hh.
References vcsn::detail::product_automaton_impl< Aut, Auts >::add_one_transitions_(), vcsn::detail::automaton_decorator< Aut >::aut_, vcsn::detail::cross_tuple(), vcsn::detail::tuple_automaton_impl< Aut, Auts...>::indices, vcsn::detail::product_automaton_impl< Aut, Auts >::out_(), vcsn::detail::tuple_automaton_impl< Aut, Auts...>::state(), and vcsn::zip_map_tuple().
|
inline |
Add transitions to the given result automaton, starting from the given result input state, which must correspond to the given tuple of input state automata.
Update the worklist with the needed source-state pairs.
Definition at line 352 of file product.hh.
References vcsn::detail::product_automaton_impl< Aut, Auts >::add_shuffle_transitions_(), vcsn::detail::automaton_decorator< Aut >::aut_, and vcsn::detail::tuple_automaton_impl< Aut, Auts...>::indices.
|
inline |
Let all automata advance one after the other, and add the corresponding transitions in the output.
Return the product of the final states.
Definition at line 364 of file product.hh.
References vcsn::detail::automaton_decorator< Aut >::aut_.
Referenced by vcsn::detail::product_automaton_impl< Aut, Auts >::add_shuffle_transitions().
|
inline |
Let Ith automaton advance, and add the corresponding transitions in the output.
If we reach a final state, return the corresponding final weight (zero otherwise).
Definition at line 386 of file product.hh.
References vcsn::detail::automaton_decorator< Aut >::aut_, vcsn::detail::tuple_automaton_impl< Aut, Auts...>::auts_, vcsn::detail::tuple_automaton_impl< Aut, Auts...>::state(), and vcsn::detail::product_automaton_impl< Aut, Auts >::transition_maps_.
|
inline |
Check if all the tapes after the Ith have only incoming spontaneous transitions.
Definition at line 265 of file product.hh.
References vcsn::detail::tuple_automaton_impl< Aut, Auts...>::auts_, and vcsn::detail::product_automaton_impl< Aut, Auts >::has_only_ones_in().
Referenced by vcsn::detail::product_automaton_impl< Aut, Auts >::maybe_add_one_transitions_().
|
inline |
Check if all the tapes before the Ith have only outgoing spontaneous transitions.
Definition at line 279 of file product.hh.
Referenced by vcsn::detail::product_automaton_impl< Aut, Auts >::maybe_add_one_transitions_().
|
inline |
Check if the state has only incoming spontaneous transitions.
As it is in the case of the one-free labelset, it's always false.
Definition at line 315 of file product.hh.
Referenced by vcsn::detail::product_automaton_impl< Aut, Auts >::has_one_in().
|
inline |
Whether the state has only incoming spontaneous transitions.
Definition at line 325 of file product.hh.
References vcsn::detail::product_automaton_impl< Aut, Auts >::is_one().
|
inline |
Whether the Ith state of psrc in the Ith input automaton has no non-spontaneous outgoing transitions.
Definition at line 336 of file product.hh.
References vcsn::detail::tuple_automaton_impl< Aut, Auts...>::auts_, vcsn::detail::automaton_decorator< Aut >::labelset(), and vcsn::detail::product_automaton_impl< Aut, Auts >::transition_maps_.
|
inline |
Check if the transition is spontaneous (in the case of a labelset with one).
Definition at line 294 of file product.hh.
Referenced by vcsn::detail::product_automaton_impl< Aut, Auts >::has_only_ones_in().
|
inline |
Same as above, but for labelsets without one, so it's always false.
Definition at line 304 of file product.hh.
|
inline |
In the case where the labelset doesn't have one, do nothing.
Definition at line 237 of file product.hh.
|
inline |
If the labelset has one, add the relevant spontaneous-transitions leaving the state.
Definition at line 244 of file product.hh.
References vcsn::detail::automaton_decorator< Aut >::aut_, vcsn::detail::product_automaton_impl< Aut, Auts >::has_one_in(), vcsn::detail::product_automaton_impl< Aut, Auts >::has_only_one_out(), vcsn::detail::tuple_automaton_impl< Aut, Auts...>::indices, vcsn::detail::tuple_automaton_impl< Aut, Auts...>::state(), and vcsn::detail::product_automaton_impl< Aut, Auts >::transition_maps_.
|
inline |
The outgoing tuple of transitions from state tuple ss.
Definition at line 184 of file product.hh.
References vcsn::detail::tuple_automaton_impl< Aut, Auts...>::indices.
Referenced by vcsn::detail::product_automaton_impl< Aut, Auts >::add_product_transitions().
|
inline |
Definition at line 191 of file product.hh.
References vcsn::detail::product_automaton_impl< Aut, Auts >::transition_maps_.
|
inlinestatic |
Definition at line 72 of file product.hh.
References vcsn::detail::tuple_automaton_impl< Aut, Auts >::sname_().
|
inline |
Definition at line 77 of file product.hh.
References vcsn::detail::tuple_automaton_impl< Aut, Auts >::vname_().
std::tuple<transition_map_t<Auts>...> vcsn::detail::product_automaton_impl< Aut, Auts >::transition_maps_ |
Transition caches.
Definition at line 417 of file product.hh.
Referenced by vcsn::detail::product_automaton_impl< Aut, Auts >::add_shuffle_transitions_(), vcsn::detail::product_automaton_impl< Aut, Auts >::has_only_ones_out(), vcsn::detail::product_automaton_impl< Aut, Auts >::maybe_add_one_transitions_(), and vcsn::detail::product_automaton_impl< Aut, Auts >::out_().