Vcsn
2.2
Be Rational
|
#include <insplit.hh>
Public Types | |
using | automaton_t = Aut |
using | out_automaton_t = fresh_automaton_t_of< Aut > |
using | self_t = insplit_automaton_impl |
using | super_t = automaton_decorator< out_automaton_t > |
using | state_t = typename super_t::state_t |
using | label_t = typename super_t::label_t |
using | transition_t = typename super_t::transition_t |
using | weightset_t = weightset_t_of< Aut > |
using | state_name_t = std::pair< state_t, bool > |
Tuple of states of input automata. More... | |
using | bimap_t = boost::bimap< boost::bimaps::unordered_set_of< state_name_t >, boost::bimaps::unordered_set_of< state_t >> |
using | map_t = typename bimap_t::left_map |
using | origins_t = typename bimap_t::right_map |
Public Types inherited from vcsn::detail::automaton_decorator< fresh_automaton_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 |
insplit_automaton_impl (const Aut &aut) | |
void | insplit (bool lazy=false) |
void | add_transitions (const state_t src, const state_name_t &psrc) |
std::ostream & | print_state_name (state_t s, std::ostream &o, format fmt={}, bool delimit=false) const |
bool | is_lazy (state_t s) const |
Whether a given state's outgoing transitions have been computed. More... | |
void | complete_ (state_t s) const |
Complete a state: find its outgoing transitions. More... | |
auto | all_out (state_t s) const -> decltype(aut_->all_out(s)) |
out_automaton_t & | aut_out () |
const out_automaton_t & | aut_out () const |
const origins_t & | origins () const |
A map from result state to original state and status (spontaneous or proper state). More... | |
Public Member Functions inherited from vcsn::detail::automaton_decorator< fresh_automaton_t_of< 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 () |
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 | 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_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 constexpr bool | state_has_name (state_t) |
Static Public Member Functions inherited from vcsn::detail::automaton_decorator< fresh_automaton_t_of< Aut > > | |
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 Member Functions | |
const automaton_t & | aut_in () const |
void | initialize_insplit () |
state_name_t | pre_ () const |
void | add_insplit_transitions (const state_t st, const state_name_t &psrc) |
bool | exists (state_t st, bool epsilon) |
bool | is_spontaneous (transition_t tr) |
state_t | state (const state_name_t &state) |
The state in the insplit corresponding to a state and a status (spontaneous or proper state). More... | |
map_t & | pmap_ () |
A map from original state and status (spontaneous or proper state) to result state. More... | |
Private Attributes | |
automaton_t | in_ |
The input automaton. More... | |
const weightset_t & | ws_ = *aut_->weightset() |
The resulting weightset. More... | |
bimap_t | bimap_ |
Map input-state, status -> result-state. More... | |
std::set< state_t > | done_ = {aut_->post()} |
When performing the lazy construction, list of states that have been completed (i.e., their outgoing transitions have been computed). More... | |
std::deque< std::pair< state_name_t, state_t > > | todo_ |
Worklist of state tuples. More... | |
Additional Inherited Members | |
Protected Attributes inherited from vcsn::detail::automaton_decorator< fresh_automaton_t_of< Aut > > | |
automaton_t | aut_ |
The wrapped automaton, possibly const. More... | |
Definition at line 22 of file insplit.hh.
using vcsn::detail::insplit_automaton_impl< Aut, HasOne >::automaton_t = Aut |
Definition at line 27 of file insplit.hh.
using vcsn::detail::insplit_automaton_impl< Aut, HasOne >::bimap_t = boost::bimap<boost::bimaps::unordered_set_of<state_name_t>, boost::bimaps::unordered_set_of<state_t>> |
Definition at line 44 of file insplit.hh.
using vcsn::detail::insplit_automaton_impl< Aut, HasOne >::label_t = typename super_t::label_t |
Definition at line 35 of file insplit.hh.
using vcsn::detail::insplit_automaton_impl< Aut, HasOne >::map_t = typename bimap_t::left_map |
Definition at line 45 of file insplit.hh.
using vcsn::detail::insplit_automaton_impl< Aut, HasOne >::origins_t = typename bimap_t::right_map |
Definition at line 46 of file insplit.hh.
using vcsn::detail::insplit_automaton_impl< Aut, HasOne >::out_automaton_t = fresh_automaton_t_of<Aut> |
Definition at line 28 of file insplit.hh.
using vcsn::detail::insplit_automaton_impl< Aut, HasOne >::self_t = insplit_automaton_impl |
Definition at line 30 of file insplit.hh.
using vcsn::detail::insplit_automaton_impl< Aut, HasOne >::state_name_t = std::pair<state_t, bool> |
Tuple of states of input automata.
Definition at line 39 of file insplit.hh.
using vcsn::detail::insplit_automaton_impl< Aut, HasOne >::state_t = typename super_t::state_t |
Definition at line 34 of file insplit.hh.
using vcsn::detail::insplit_automaton_impl< Aut, HasOne >::super_t = automaton_decorator<out_automaton_t> |
Definition at line 32 of file insplit.hh.
using vcsn::detail::insplit_automaton_impl< Aut, HasOne >::transition_t = typename super_t::transition_t |
Definition at line 36 of file insplit.hh.
using vcsn::detail::insplit_automaton_impl< Aut, HasOne >::weightset_t = weightset_t_of<Aut> |
Definition at line 37 of file insplit.hh.
|
inline |
Definition at line 62 of file insplit.hh.
|
inlineprivate |
Definition at line 188 of file insplit.hh.
References vcsn::detail::insplit_automaton_impl< Aut, HasOne >::all_out(), vcsn::detail::insplit_automaton_impl< Aut, HasOne >::aut_in(), vcsn::detail::insplit_automaton_impl< Aut, HasOne >::aut_out(), vcsn::detail::insplit_automaton_impl< Aut, HasOne >::is_spontaneous(), and vcsn::detail::insplit_automaton_impl< Aut, HasOne >::state().
Referenced by vcsn::detail::insplit_automaton_impl< Aut, HasOne >::add_transitions().
|
inline |
Definition at line 87 of file insplit.hh.
References vcsn::detail::insplit_automaton_impl< Aut, HasOne >::add_insplit_transitions().
Referenced by vcsn::detail::insplit_automaton_impl< Aut, HasOne >::complete_().
|
inline |
Definition at line 140 of file insplit.hh.
References vcsn::detail::automaton_decorator< fresh_automaton_t_of< Aut > >::aut_, vcsn::detail::insplit_automaton_impl< Aut, HasOne >::complete_(), and vcsn::detail::insplit_automaton_impl< Aut, HasOne >::is_lazy().
Referenced by vcsn::detail::insplit_automaton_impl< Aut, HasOne >::add_insplit_transitions().
|
inlineprivate |
Definition at line 171 of file insplit.hh.
References vcsn::detail::insplit_automaton_impl< Aut, HasOne >::in_.
Referenced by vcsn::detail::insplit_automaton_impl< Aut, HasOne >::add_insplit_transitions(), vcsn::detail::insplit_automaton_impl< Aut, HasOne >::initialize_insplit(), and vcsn::detail::insplit_automaton_impl< Aut, HasOne >::is_spontaneous().
|
inline |
Definition at line 149 of file insplit.hh.
References vcsn::detail::automaton_decorator< fresh_automaton_t_of< Aut > >::aut_.
Referenced by vcsn::detail::insplit_automaton_impl< Aut, HasOne >::add_insplit_transitions(), and vcsn::detail::insplit_automaton_impl< Aut, HasOne >::initialize_insplit().
|
inline |
Definition at line 155 of file insplit.hh.
References vcsn::detail::automaton_decorator< fresh_automaton_t_of< Aut > >::aut_.
|
inline |
Complete a state: find its outgoing transitions.
Definition at line 130 of file insplit.hh.
References vcsn::detail::insplit_automaton_impl< Aut, HasOne >::add_transitions(), vcsn::detail::insplit_automaton_impl< Aut, HasOne >::done_, and vcsn::detail::insplit_automaton_impl< Aut, HasOne >::origins().
Referenced by vcsn::detail::insplit_automaton_impl< Aut, HasOne >::all_out(), and vcsn::detail::insplit_automaton_impl< Aut, HasOne >::insplit().
|
inlineprivate |
Definition at line 198 of file insplit.hh.
References vcsn::detail::insplit_automaton_impl< Aut, HasOne >::pmap_().
|
inlineprivate |
Definition at line 176 of file insplit.hh.
References vcsn::detail::automaton_decorator< fresh_automaton_t_of< Aut > >::aut_, vcsn::detail::insplit_automaton_impl< Aut, HasOne >::aut_in(), vcsn::detail::insplit_automaton_impl< Aut, HasOne >::aut_out(), vcsn::detail::insplit_automaton_impl< Aut, HasOne >::pmap_(), vcsn::detail::automaton_decorator< fresh_automaton_t_of< Aut > >::post(), vcsn::detail::automaton_decorator< fresh_automaton_t_of< Aut > >::pre(), vcsn::detail::insplit_automaton_impl< Aut, HasOne >::pre_(), and vcsn::detail::insplit_automaton_impl< Aut, HasOne >::todo_.
Referenced by vcsn::detail::insplit_automaton_impl< Aut, HasOne >::insplit().
|
inline |
Definition at line 74 of file insplit.hh.
References vcsn::detail::insplit_automaton_impl< Aut, HasOne >::complete_(), vcsn::detail::insplit_automaton_impl< Aut, HasOne >::initialize_insplit(), and vcsn::detail::insplit_automaton_impl< Aut, HasOne >::todo_.
|
inline |
Whether a given state's outgoing transitions have been computed.
Definition at line 124 of file insplit.hh.
References vcsn::detail::insplit_automaton_impl< Aut, HasOne >::done_, and vcsn::has().
Referenced by vcsn::detail::insplit_automaton_impl< Aut, HasOne >::all_out().
|
inlineprivate |
Definition at line 204 of file insplit.hh.
References vcsn::detail::insplit_automaton_impl< Aut, HasOne >::aut_in(), and vcsn::detail::automaton_decorator< fresh_automaton_t_of< Aut > >::label_of().
Referenced by vcsn::detail::insplit_automaton_impl< Aut, HasOne >::add_insplit_transitions().
|
inline |
A map from result state to original state and status (spontaneous or proper state).
Definition at line 163 of file insplit.hh.
References vcsn::detail::insplit_automaton_impl< Aut, HasOne >::bimap_.
Referenced by vcsn::detail::insplit_automaton_impl< Aut, HasOne >::complete_().
|
inlineprivate |
A map from original state and status (spontaneous or proper state) to result state.
Definition at line 230 of file insplit.hh.
References vcsn::detail::insplit_automaton_impl< Aut, HasOne >::bimap_.
Referenced by vcsn::detail::insplit_automaton_impl< Aut, HasOne >::exists(), vcsn::detail::insplit_automaton_impl< Aut, HasOne >::initialize_insplit(), and vcsn::detail::insplit_automaton_impl< Aut, HasOne >::state().
|
inlineprivate |
Definition at line 183 of file insplit.hh.
References vcsn::detail::automaton_decorator< fresh_automaton_t_of< Aut > >::aut_.
Referenced by vcsn::detail::insplit_automaton_impl< Aut, HasOne >::initialize_insplit().
|
inline |
Definition at line 56 of file insplit.hh.
|
inline |
Definition at line 94 of file insplit.hh.
|
inlinestatic |
Definition at line 50 of file insplit.hh.
References vcsn::sname().
|
inlineprivate |
The state in the insplit corresponding to a state and a status (spontaneous or proper state).
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.
Definition at line 215 of file insplit.hh.
References vcsn::detail::automaton_decorator< fresh_automaton_t_of< Aut > >::aut_, vcsn::detail::insplit_automaton_impl< Aut, HasOne >::pmap_(), and vcsn::detail::insplit_automaton_impl< Aut, HasOne >::todo_.
Referenced by vcsn::detail::insplit_automaton_impl< Aut, HasOne >::add_insplit_transitions().
|
inlinestatic |
Definition at line 68 of file insplit.hh.
|
mutableprivate |
Map input-state, status -> result-state.
status == false: no spontaneous incoming transition status == true: only spontaneous incoming transitions
Definition at line 244 of file insplit.hh.
Referenced by vcsn::detail::insplit_automaton_impl< Aut, HasOne >::origins(), and vcsn::detail::insplit_automaton_impl< Aut, HasOne >::pmap_().
|
mutableprivate |
When performing the lazy construction, list of states that have been completed (i.e., their outgoing transitions have been computed).
Definition at line 249 of file insplit.hh.
Referenced by vcsn::detail::insplit_automaton_impl< Aut, HasOne >::complete_(), and vcsn::detail::insplit_automaton_impl< Aut, HasOne >::is_lazy().
|
private |
The input automaton.
Definition at line 236 of file insplit.hh.
Referenced by vcsn::detail::insplit_automaton_impl< Aut, HasOne >::aut_in().
|
private |
Worklist of state tuples.
Definition at line 252 of file insplit.hh.
Referenced by vcsn::detail::insplit_automaton_impl< Aut, HasOne >::initialize_insplit(), vcsn::detail::insplit_automaton_impl< Aut, HasOne >::insplit(), and vcsn::detail::insplit_automaton_impl< Aut, HasOne >::state().
|
private |
The resulting weightset.
Definition at line 239 of file insplit.hh.