Vcsn
2.3
Be Rational
|
Insplit automaton decorator. More...
#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) |
Insplit the automaton. More... | |
std::ostream & | print_state_name (state_t s, std::ostream &o, format fmt={}, bool delimit=false) const |
void | complete_ (const state_t s) const |
Complete a lazy state: find its outgoing transitions. More... | |
auto | all_out (const state_t s) const |
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 | 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 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 |
The input automaton. More... | |
void | initialize_insplit_ () |
state_name_t | pre_ () const |
void | add_insplit_transitions_ (const state_t s, const state_name_t &sn) |
Split the original outgoing transitions to the insplit states. More... | |
bool | is_spontaneous_ (transition_t t) const |
Whether transition t is labeled by one. More... | |
state_t | state (const state_name_t &sn) |
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... | |
bool | lazy_ = false |
Whether the computation is lazy. More... | |
bimap_t | bimap_ |
Map (input-state, status) -> result-state. 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... | |
Insplit automaton decorator.
Build on-the-fly an insplit automaton, i.e., an automaton whose states have either only proper incoming transitions, or only spontaneous incoming transitions.
This is the case where the automaton can have spontaneous transitions.
Definition at line 29 of file insplit.hh.
using vcsn::detail::insplit_automaton_impl< Aut >::automaton_t = Aut |
Definition at line 36 of file insplit.hh.
using vcsn::detail::insplit_automaton_impl< Aut >::bimap_t = boost::bimap<boost::bimaps::unordered_set_of<state_name_t>, boost::bimaps::unordered_set_of<state_t>> |
Definition at line 54 of file insplit.hh.
using vcsn::detail::insplit_automaton_impl< Aut >::label_t = typename super_t::label_t |
Definition at line 44 of file insplit.hh.
using vcsn::detail::insplit_automaton_impl< Aut >::map_t = typename bimap_t::left_map |
Definition at line 55 of file insplit.hh.
using vcsn::detail::insplit_automaton_impl< Aut >::origins_t = typename bimap_t::right_map |
Definition at line 56 of file insplit.hh.
using vcsn::detail::insplit_automaton_impl< Aut >::out_automaton_t = fresh_automaton_t_of<Aut> |
Definition at line 37 of file insplit.hh.
using vcsn::detail::insplit_automaton_impl< Aut >::self_t = insplit_automaton_impl |
Definition at line 39 of file insplit.hh.
using vcsn::detail::insplit_automaton_impl< Aut >::state_name_t = std::pair<state_t, bool> |
Tuple of states of input automata.
Definition at line 48 of file insplit.hh.
using vcsn::detail::insplit_automaton_impl< Aut >::state_t = typename super_t::state_t |
Definition at line 43 of file insplit.hh.
using vcsn::detail::insplit_automaton_impl< Aut >::super_t = automaton_decorator<out_automaton_t> |
Definition at line 41 of file insplit.hh.
using vcsn::detail::insplit_automaton_impl< Aut >::transition_t = typename super_t::transition_t |
Definition at line 45 of file insplit.hh.
using vcsn::detail::insplit_automaton_impl< Aut >::weightset_t = weightset_t_of<Aut> |
Definition at line 46 of file insplit.hh.
|
inline |
Definition at line 73 of file insplit.hh.
|
inlineprivate |
Split the original outgoing transitions to the insplit states.
Definition at line 190 of file insplit.hh.
References vcsn::detail::insplit_automaton_impl< Aut >::all_out(), vcsn::detail::insplit_automaton_impl< Aut >::aut_in(), vcsn::detail::insplit_automaton_impl< Aut >::aut_out(), vcsn::detail::insplit_automaton_impl< Aut >::is_spontaneous_(), and vcsn::detail::insplit_automaton_impl< Aut >::state().
Referenced by vcsn::detail::insplit_automaton_impl< Aut >::insplit().
|
inline |
Definition at line 138 of file insplit.hh.
References vcsn::detail::automaton_decorator< fresh_automaton_t_of< Aut > >::aut_, vcsn::detail::insplit_automaton_impl< Aut >::complete_(), and vcsn::detail::insplit_automaton_impl< Aut >::lazy_.
Referenced by vcsn::detail::insplit_automaton_impl< Aut >::add_insplit_transitions_().
|
inlineprivate |
The input automaton.
Definition at line 167 of file insplit.hh.
References vcsn::detail::insplit_automaton_impl< Aut >::in_.
Referenced by vcsn::detail::insplit_automaton_impl< Aut >::add_insplit_transitions_(), vcsn::detail::insplit_automaton_impl< Aut >::initialize_insplit_(), and vcsn::detail::insplit_automaton_impl< Aut >::is_spontaneous_().
|
inline |
Definition at line 146 of file insplit.hh.
References vcsn::detail::automaton_decorator< fresh_automaton_t_of< Aut > >::aut_.
Referenced by vcsn::detail::insplit_automaton_impl< Aut >::add_insplit_transitions_(), and vcsn::detail::insplit_automaton_impl< Aut >::initialize_insplit_().
|
inline |
Definition at line 152 of file insplit.hh.
References vcsn::detail::automaton_decorator< fresh_automaton_t_of< Aut > >::aut_.
|
inline |
Complete a lazy state: find its outgoing transitions.
Definition at line 127 of file insplit.hh.
References vcsn::detail::insplit_automaton_impl< Aut >::origins().
Referenced by vcsn::detail::insplit_automaton_impl< Aut >::all_out().
|
inlineprivate |
Definition at line 172 of file insplit.hh.
References vcsn::detail::insplit_automaton_impl< Aut >::aut_in(), vcsn::detail::insplit_automaton_impl< Aut >::aut_out(), vcsn::detail::insplit_automaton_impl< Aut >::lazy_, vcsn::detail::insplit_automaton_impl< Aut >::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 >::pre_(), and vcsn::detail::insplit_automaton_impl< Aut >::todo_.
Referenced by vcsn::detail::insplit_automaton_impl< Aut >::insplit().
|
inline |
Insplit the automaton.
Definition at line 85 of file insplit.hh.
References vcsn::detail::insplit_automaton_impl< Aut >::add_insplit_transitions_(), vcsn::detail::insplit_automaton_impl< Aut >::initialize_insplit_(), vcsn::detail::insplit_automaton_impl< Aut >::lazy_, and vcsn::detail::insplit_automaton_impl< Aut >::todo_.
|
inlineprivate |
Whether transition t is labeled by one.
Definition at line 201 of file insplit.hh.
References vcsn::detail::insplit_automaton_impl< Aut >::aut_in(), and vcsn::detail::automaton_decorator< fresh_automaton_t_of< Aut > >::label_of().
Referenced by vcsn::detail::insplit_automaton_impl< Aut >::add_insplit_transitions_().
|
inline |
A map from result state to original state and status (spontaneous or proper state).
Definition at line 159 of file insplit.hh.
References vcsn::detail::insplit_automaton_impl< Aut >::bimap_.
Referenced by vcsn::detail::insplit_automaton_impl< Aut >::complete_().
|
inlineprivate |
A map from original state and status (spontaneous or proper state) to result state.
Definition at line 228 of file insplit.hh.
References vcsn::detail::insplit_automaton_impl< Aut >::bimap_.
Referenced by vcsn::detail::insplit_automaton_impl< Aut >::initialize_insplit_(), and vcsn::detail::insplit_automaton_impl< Aut >::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 >::initialize_insplit_().
|
inline |
Definition at line 67 of file insplit.hh.
|
inline |
Definition at line 100 of file insplit.hh.
|
inlinestatic |
Definition at line 59 of file insplit.hh.
References vcsn::res, and 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 212 of file insplit.hh.
References vcsn::detail::automaton_decorator< fresh_automaton_t_of< Aut > >::aut_, vcsn::detail::insplit_automaton_impl< Aut >::lazy_, vcsn::detail::insplit_automaton_impl< Aut >::pmap_(), and vcsn::detail::insplit_automaton_impl< Aut >::todo_.
Referenced by vcsn::detail::insplit_automaton_impl< Aut >::add_insplit_transitions_().
|
inlinestatic |
Definition at line 79 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 242 of file insplit.hh.
Referenced by vcsn::detail::insplit_automaton_impl< Aut >::origins(), and vcsn::detail::insplit_automaton_impl< Aut >::pmap_().
|
private |
The input automaton.
Definition at line 234 of file insplit.hh.
Referenced by vcsn::detail::insplit_automaton_impl< Aut >::aut_in().
|
private |
Whether the computation is lazy.
Definition at line 237 of file insplit.hh.
Referenced by vcsn::detail::insplit_automaton_impl< Aut >::all_out(), vcsn::detail::insplit_automaton_impl< Aut >::initialize_insplit_(), vcsn::detail::insplit_automaton_impl< Aut >::insplit(), and vcsn::detail::insplit_automaton_impl< Aut >::state().
|
private |
Worklist of state tuples.
Definition at line 245 of file insplit.hh.
Referenced by vcsn::detail::insplit_automaton_impl< Aut >::initialize_insplit_(), vcsn::detail::insplit_automaton_impl< Aut >::insplit(), and vcsn::detail::insplit_automaton_impl< Aut >::state().