![]() |
Vcsn
2.8
Be Rational
|
Build the (accessible part of the) composition. More...
#include <compose.hh>
Public Types | |
enum | { Rank = 2 } |
The number of input automata. More... | |
using | self_t = compose_automaton_impl |
using | type_helper_t = composed_type< Lhs, Rhs > |
using | hidden_l_labelset_t = typename type_helper_t::hidden_l_labelset_t |
using | hidden_r_labelset_t = typename type_helper_t::hidden_r_labelset_t |
using | hidden_l_label_t = typename type_helper_t::hidden_l_label_t |
using | hidden_r_label_t = typename type_helper_t::hidden_r_label_t |
using | labelset_t = typename type_helper_t::labelset_t |
The type of context of the result. More... | |
using | weightset_t = typename type_helper_t::weightset_t |
using | res_label_t = typename type_helper_t::res_label_t |
using | context_t = typename type_helper_t::context_t |
using | out_t = typename type_helper_t::out_t |
using | super_t = lazy_tuple_automaton< self_t, true, Lazy, out_t, Lhs, Rhs > |
using | state_t = typename super_t::state_t |
Result state type. More... | |
using | state_name_t = typename super_t::state_name_t |
Tuple of states of input automata. More... | |
using | automata_t = std::tuple< Lhs, Rhs > |
The type of input automata. More... | |
template<size_t I> | |
using | input_automaton_t = base_t< tuple_element_t< I, automata_t > > |
The type of the Ith input automaton, unqualified. More... | |
using | label_t = typename labelset_t::value_t |
using | weight_t = typename weightset_t::value_t |
![]() | |
using | tuple_automaton_t = tuple_automaton< Aut, Auts... > |
The underlying automaton, output and inputs. More... | |
using | tuple_automaton_impl = typename tuple_automaton_t::element_type |
using | state_name_t = typename tuple_automaton_impl::state_name_t |
using | state_t = typename tuple_automaton_impl::state_t |
using | seq = typename tuple_automaton_impl::template seq< I... > |
using | self_t = lazy_tuple_automaton |
using | super_t = automaton_decorator< tuple_automaton_t > |
using | decorated_t = compose_automaton_impl< Lazy, Lhs, Rhs > |
The automaton holding the logic. More... | |
using | weightset_t = weightset_t_of< Aut > |
![]() | |
using | automaton_t = Aut |
The type of automaton to wrap. More... | |
using | context_t = context_t_of< Aut > |
using | element_type = typename automaton_t::element_type |
The automaton type, without shared_ptr. More... | |
using | fresh_automaton_t = typename element_type::template fresh_automaton_t< Ctx > |
The (shared pointer) type to use it we have to create an automaton of the same (underlying) type. More... | |
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 > |
Public Member Functions | |
std::ostream & | print_set (std::ostream &o, format fmt={}) const |
compose_automaton_impl (const Lhs &lhs, const Rhs &rhs) | |
void | compose () |
The (accessible part of the) composition of lhs_ and rhs_. More... | |
void | add_transitions (const state_t src, const state_name_t &psrc) |
Callback for complete_ when lazy. More... | |
![]() | |
lazy_tuple_automaton (Aut aut, const Auts &... auts) | |
auto | origins () const -> decltype(aut_->origins()) |
A map from result state to tuple of original states. More... | |
void | complete_ (state_t s) const |
Complete a state: find its outgoing transitions. More... | |
auto | all_out (state_t s) const -> decltype(all_out(aut_, s)) |
All the outgoing transitions. More... | |
![]() | |
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 () |
The automaton we decorate. More... | |
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 | 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_state (Args &&... args) const -> decltype(aut_-> has_state(std::forward< Args >(args)...)) |
auto | has_transition (Args &&... args) const -> decltype(aut_-> has_transition(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 | prepost_label (Args &&... args) const -> decltype(aut_-> prepost_label(std::forward< Args >(args)...)) |
auto | print (Args &&... args) const -> decltype(aut_-> print(std::forward< Args >(args)...)) |
auto | print_set (Args &&... args) const -> decltype(aut_-> print_set(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 | is_lazy (Args &&... args) const -> decltype(aut_-> is_lazy(std::forward< Args >(args)...)) |
auto | is_lazy_in (Args &&... args) const -> decltype(aut_-> is_lazy_in(std::forward< Args >(args)...)) |
auto | states (Args &&... args) const -> decltype(aut_-> states(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 | lweight (Args &&... args) -> decltype(aut_-> lweight(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 | rweight (Args &&... args) -> decltype(aut_-> rweight(std::forward< Args >(args)...)) |
auto | set_final (Args &&... args) -> decltype(aut_-> set_ final(std |
auto | set_lazy (Args &&... args) -> decltype(aut_-> set_lazy(std::forward< Args >(args)...)) |
auto | set_lazy_in (Args &&... args) -> decltype(aut_-> set_lazy_in(std::forward< Args >(args)...)) |
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 symbol | sname () |
![]() | |
static symbol | sname_ (const T &... t) |
![]() | |
static constexpr auto | lazy_transition (Args &&... args) -> decltype(element_type::lazy_transition(std::forward< Args >(args)...)) |
static constexpr auto | null_state (Args &&... args) -> decltype(element_type::null_state(std::forward< Args >(args)...)) |
static constexpr auto | null_transition (Args &&... args) -> decltype(element_type::null_transition(std::forward< Args >(args)...)) |
static constexpr auto | post (Args &&... args) -> decltype(element_type::post(std::forward< Args >(args)...)) |
static constexpr auto | pre (Args &&... args) -> decltype(element_type::pre(std::forward< Args >(args)...)) |
static constexpr auto | sname (Args &&... args) -> decltype(element_type::sname(std::forward< Args >(args)...)) |
Private Types | |
template<std::size_t... I> | |
using | seq = vcsn::detail::index_sequence< I... > |
A static list of integers. More... | |
template<Automaton A> | |
using | transition_map_t = transition_map< A, weightset_t, false, true, true > |
The type of our transition maps: convert the weight to weightset_t, non deterministic, and including transitions to post(). More... | |
Private Member Functions | |
void | initialize_compose () |
Fill the worklist with the initial source-state pairs, as needed for the composition algorithm. More... | |
res_label_t | join_label (const hidden_l_label_t &ll, const hidden_r_label_t &rl) const |
template<Automaton Aut> | |
std::enable_if_t< labelset_t_of< Aut >::has_one(), res_label_t_of< Aut > > | get_hidden_one (const Aut &aut) const |
template<Automaton Aut> | |
std::enable_if_t< labelset_t_of< Aut >::has_one(), res_label_t_of< Aut > > | get_hidden_one (const insplit_automaton< Aut > &aut) const |
template<Automaton Aut> | |
ATTRIBUTE_NORETURN std::enable_if_t<!labelset_t_of< Aut >::has_one(), res_label_t_of< Aut > > | get_hidden_one (const Aut &) const |
void | add_compose_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) |
template<Automaton Aut> | |
std::enable_if_t< labelset_t_of< Aut >::has_one(), bool > | is_one (const Aut &aut, transition_t_of< Aut > tr) const |
template<Automaton Aut> | |
constexpr std::enable_if_t<!labelset_t_of< Aut >::has_one(), bool > | is_one (const Aut &, transition_t_of< Aut >) const |
template<std::size_t... I> | |
bool | are_proper_in (const state_name_t &psrc, seq< I... >) const |
Whether no tapes in the sequence have spontaneous incoming transitions. More... | |
template<size_t I> | |
constexpr auto | is_proper_in (const state_name_t &) const -> std::enable_if_t<!labelset_t_of< input_automaton_t< I >>::has_one(), bool > |
Whether the state has only proper incoming transitions. More... | |
template<size_t I> | |
auto | is_proper_in (const state_name_t &sn) const -> std::enable_if_t< labelset_t_of< input_automaton_t< I >>::has_one(), bool > |
Whether the state has only proper incoming transitions. More... | |
template<std::size_t... I> | |
bool | have_proper_out (const state_name_t &psrc, seq< I... >) |
Whether all the tapes in the sequence have proper outgoing transitions (but possibly spontaneous too). More... | |
template<size_t I> | |
bool | has_proper_out (const state_name_t &psrc) |
Whether the Ith state of psrc in the Ith input automaton has proper outgoing transitions (but possibly spontaneous transitions too). More... | |
Static Private Member Functions | |
template<Automaton A> | |
static auto | real_aut (const A &aut) |
Get the focus automaton, possibly from a non insplit automaton. More... | |
template<Automaton A> | |
static auto | real_aut (const insplit_automaton< A > &aut) |
Get the focus automaton from an insplit automaton. More... | |
static labelset_t | make_labelset_ (const hidden_l_labelset_t &ll, const hidden_r_labelset_t &rl) |
template<std::size_t... I1, std::size_t... I2> | |
static labelset_t | make_labelset_ (const hidden_l_labelset_t &ll, seq< I1... >, const hidden_r_labelset_t &rl, seq< I2... >) |
static context_t | make_context_ (const Lhs &lhs, const Rhs &rhs) |
Additional Inherited Members | |
![]() | |
using | transition_map_t = transition_map< A, weightset_t, false, true, KeepTransitions > |
The type of our transition maps: convert the weight to weightset_t, non deterministic, and including transitions to post(). More... | |
![]() | |
state_t | state (Args &&... args) |
Conversion from state name to state number. More... | |
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... | |
std::tuple< typename transition_map_t< Auts >::map_t &... > | out_ (const state_name_t &ss, seq< I... >) |
![]() | |
const weightset_t & | ws_ |
The resulting weightset. More... | |
std::tuple< transition_map_t< Auts >... > | transition_maps_ |
Transition caches. More... | |
![]() | |
automaton_t | aut_ |
The wrapped automaton, possibly const. More... | |
Build the (accessible part of the) composition.
Definition at line 79 of file compose.hh.
using vcsn::detail::compose_automaton_impl< Lazy, Lhs, Rhs >::automata_t = std::tuple<Lhs, Rhs> |
The type of input automata.
Definition at line 125 of file compose.hh.
using vcsn::detail::compose_automaton_impl< Lazy, Lhs, Rhs >::context_t = typename type_helper_t::context_t |
Definition at line 115 of file compose.hh.
using vcsn::detail::compose_automaton_impl< Lazy, Lhs, Rhs >::hidden_l_label_t = typename type_helper_t::hidden_l_label_t |
Definition at line 106 of file compose.hh.
using vcsn::detail::compose_automaton_impl< Lazy, Lhs, Rhs >::hidden_l_labelset_t = typename type_helper_t::hidden_l_labelset_t |
Definition at line 104 of file compose.hh.
using vcsn::detail::compose_automaton_impl< Lazy, Lhs, Rhs >::hidden_r_label_t = typename type_helper_t::hidden_r_label_t |
Definition at line 107 of file compose.hh.
using vcsn::detail::compose_automaton_impl< Lazy, Lhs, Rhs >::hidden_r_labelset_t = typename type_helper_t::hidden_r_labelset_t |
Definition at line 105 of file compose.hh.
using vcsn::detail::compose_automaton_impl< Lazy, Lhs, Rhs >::input_automaton_t = base_t<tuple_element_t<I, automata_t> > |
The type of the Ith input automaton, unqualified.
Definition at line 129 of file compose.hh.
using vcsn::detail::compose_automaton_impl< Lazy, Lhs, Rhs >::label_t = typename labelset_t::value_t |
Definition at line 177 of file compose.hh.
using vcsn::detail::compose_automaton_impl< Lazy, Lhs, Rhs >::labelset_t = typename type_helper_t::labelset_t |
The type of context of the result.
Definition at line 111 of file compose.hh.
using vcsn::detail::compose_automaton_impl< Lazy, Lhs, Rhs >::out_t = typename type_helper_t::out_t |
Definition at line 117 of file compose.hh.
using vcsn::detail::compose_automaton_impl< Lazy, Lhs, Rhs >::res_label_t = typename type_helper_t::res_label_t |
Definition at line 114 of file compose.hh.
using vcsn::detail::compose_automaton_impl< Lazy, Lhs, Rhs >::self_t = compose_automaton_impl |
Definition at line 101 of file compose.hh.
|
private |
A static list of integers.
Definition at line 97 of file compose.hh.
using vcsn::detail::compose_automaton_impl< Lazy, Lhs, Rhs >::state_name_t = typename super_t::state_name_t |
Tuple of states of input automata.
Definition at line 122 of file compose.hh.
using vcsn::detail::compose_automaton_impl< Lazy, Lhs, Rhs >::state_t = typename super_t::state_t |
Result state type.
Definition at line 120 of file compose.hh.
using vcsn::detail::compose_automaton_impl< Lazy, Lhs, Rhs >::super_t = lazy_tuple_automaton<self_t, true, Lazy, out_t, Lhs, Rhs> |
Definition at line 118 of file compose.hh.
|
private |
The type of our transition maps: convert the weight to weightset_t, non deterministic, and including transitions to post().
Definition at line 200 of file compose.hh.
using vcsn::detail::compose_automaton_impl< Lazy, Lhs, Rhs >::type_helper_t = composed_type<Lhs, Rhs> |
Definition at line 103 of file compose.hh.
using vcsn::detail::compose_automaton_impl< Lazy, Lhs, Rhs >::weight_t = typename weightset_t::value_t |
Definition at line 178 of file compose.hh.
using vcsn::detail::compose_automaton_impl< Lazy, Lhs, Rhs >::weightset_t = typename type_helper_t::weightset_t |
Definition at line 112 of file compose.hh.
anonymous enum |
|
inline |
Definition at line 152 of file compose.hh.
References vcsn::make_mutable_automaton().
|
inlineprivate |
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 272 of file compose.hh.
References vcsn::detail::cross_tuple(), vcsn::detail::transition_map< Aut, WeightSet, Deterministic, AllOut, KeepTransitions >::transition_< Weight, KeepTransitions_, Dummy >::dst, vcsn::detail::transition_map< Aut, WeightSet, Deterministic, AllOut, KeepTransitions >::transition_< Weight, KeepTransitions_, Dummy >::weight(), and vcsn::zip_maps().
|
inlineprivate |
Definition at line 322 of file compose.hh.
|
inline |
Callback for complete_ when lazy.
Definition at line 171 of file compose.hh.
|
inlineprivate |
Whether no tapes in the sequence have spontaneous incoming transitions.
Definition at line 382 of file compose.hh.
References vcsn::all().
|
inline |
The (accessible part of the) composition of lhs_ and rhs_.
Definition at line 157 of file compose.hh.
|
inlineprivate |
Definition at line 245 of file compose.hh.
|
inlineprivate |
Definition at line 253 of file compose.hh.
|
inlineprivate |
Definition at line 262 of file compose.hh.
|
inlineprivate |
Whether the Ith state of psrc in the Ith input automaton has proper outgoing transitions (but possibly spontaneous transitions too).
Not const, because we (might) update the transition maps.
Definition at line 434 of file compose.hh.
|
inlineprivate |
Whether all the tapes in the sequence have proper outgoing transitions (but possibly spontaneous too).
Definition at line 422 of file compose.hh.
References vcsn::all().
|
inlineprivate |
Fill the worklist with the initial source-state pairs, as needed for the composition algorithm.
Definition at line 231 of file compose.hh.
|
inlineprivate |
Definition at line 366 of file compose.hh.
|
inlineprivate |
Definition at line 374 of file compose.hh.
|
inlineprivate |
Whether the state has only proper incoming transitions.
Definition at line 390 of file compose.hh.
|
inlineprivate |
Whether the state has only proper incoming transitions.
The automaton has been insplit, so either all incoming transitions are proper, or all transitions are spontaneous (including the first one).
Definition at line 403 of file compose.hh.
References vcsn::detail::all_in().
|
inlineprivate |
Definition at line 236 of file compose.hh.
|
inlinestaticprivate |
Definition at line 222 of file compose.hh.
References vcsn::join().
|
inlinestaticprivate |
Definition at line 202 of file compose.hh.
References vcsn::rat::size().
|
inlinestaticprivate |
Definition at line 212 of file compose.hh.
|
inline |
Definition at line 145 of file compose.hh.
References vcsn::print_set().
|
inlinestaticprivate |
Get the focus automaton, possibly from a non insplit automaton.
Definition at line 184 of file compose.hh.
|
inlinestaticprivate |
Get the focus automaton from an insplit automaton.
Definition at line 191 of file compose.hh.
|
inlinestatic |
Definition at line 136 of file compose.hh.
References vcsn::res, and vcsn::sname().