Vcsn  2.3
Be Rational
vcsn::detail::insplit_automaton_impl< Aut > Class Template Reference

Insplit automaton decorator. More...

#include <insplit.hh>

Inheritance diagram for vcsn::detail::insplit_automaton_impl< Aut >:
Collaboration diagram for vcsn::detail::insplit_automaton_impl< Aut >:

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_taut_out ()
 
const out_automaton_taut_out () const
 
const origins_torigins () 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_decoratoroperator= (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_taut_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_tpmap_ ()
 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...
 

Detailed Description

template<Automaton Aut>
class vcsn::detail::insplit_automaton_impl< Aut >

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.

Member Typedef Documentation

template<Automaton Aut>
using vcsn::detail::insplit_automaton_impl< Aut >::automaton_t = Aut

Definition at line 36 of file insplit.hh.

template<Automaton Aut>
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.

template<Automaton Aut>
using vcsn::detail::insplit_automaton_impl< Aut >::label_t = typename super_t::label_t

Definition at line 44 of file insplit.hh.

template<Automaton Aut>
using vcsn::detail::insplit_automaton_impl< Aut >::map_t = typename bimap_t::left_map

Definition at line 55 of file insplit.hh.

template<Automaton Aut>
using vcsn::detail::insplit_automaton_impl< Aut >::origins_t = typename bimap_t::right_map

Definition at line 56 of file insplit.hh.

template<Automaton Aut>
using vcsn::detail::insplit_automaton_impl< Aut >::out_automaton_t = fresh_automaton_t_of<Aut>

Definition at line 37 of file insplit.hh.

template<Automaton Aut>
using vcsn::detail::insplit_automaton_impl< Aut >::self_t = insplit_automaton_impl

Definition at line 39 of file insplit.hh.

template<Automaton Aut>
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.

template<Automaton Aut>
using vcsn::detail::insplit_automaton_impl< Aut >::state_t = typename super_t::state_t

Definition at line 43 of file insplit.hh.

Definition at line 41 of file insplit.hh.

template<Automaton Aut>
using vcsn::detail::insplit_automaton_impl< Aut >::transition_t = typename super_t::transition_t

Definition at line 45 of file insplit.hh.

template<Automaton Aut>
using vcsn::detail::insplit_automaton_impl< Aut >::weightset_t = weightset_t_of<Aut>

Definition at line 46 of file insplit.hh.

Constructor & Destructor Documentation

template<Automaton Aut>
vcsn::detail::insplit_automaton_impl< Aut >::insplit_automaton_impl ( const Aut &  aut)
inline

Definition at line 73 of file insplit.hh.

Member Function Documentation

template<Automaton Aut>
void vcsn::detail::insplit_automaton_impl< Aut >::add_insplit_transitions_ ( const state_t  s,
const state_name_t sn 
)
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().

Here is the call graph for this function:

template<Automaton Aut>
auto vcsn::detail::insplit_automaton_impl< Aut >::all_out ( const state_t  s) const
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_().

Here is the call graph for this function:

template<Automaton Aut>
const out_automaton_t& vcsn::detail::insplit_automaton_impl< Aut >::aut_out ( ) const
inline
template<Automaton Aut>
void vcsn::detail::insplit_automaton_impl< Aut >::complete_ ( const state_t  s) const
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().

Here is the call graph for this function:

template<Automaton Aut>
void vcsn::detail::insplit_automaton_impl< Aut >::insplit ( bool  lazy = false)
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_.

Here is the call graph for this function:

template<Automaton Aut>
bool vcsn::detail::insplit_automaton_impl< Aut >::is_spontaneous_ ( transition_t  t) const
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_().

Here is the call graph for this function:

template<Automaton Aut>
const origins_t& vcsn::detail::insplit_automaton_impl< Aut >::origins ( ) const
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_().

template<Automaton Aut>
map_t& vcsn::detail::insplit_automaton_impl< Aut >::pmap_ ( )
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().

template<Automaton Aut>
std::ostream& vcsn::detail::insplit_automaton_impl< Aut >::print_set ( std::ostream &  o,
format  fmt = {} 
) const
inline

Definition at line 67 of file insplit.hh.

template<Automaton Aut>
std::ostream& vcsn::detail::insplit_automaton_impl< Aut >::print_state_name ( state_t  s,
std::ostream &  o,
format  fmt = {},
bool  delimit = false 
) const
inline

Definition at line 100 of file insplit.hh.

template<Automaton Aut>
static symbol vcsn::detail::insplit_automaton_impl< Aut >::sname ( )
inlinestatic

Definition at line 59 of file insplit.hh.

References vcsn::res, and vcsn::sname().

Here is the call graph for this function:

template<Automaton Aut>
state_t vcsn::detail::insplit_automaton_impl< Aut >::state ( const state_name_t sn)
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_().

Here is the call graph for this function:

template<Automaton Aut>
static constexpr bool vcsn::detail::insplit_automaton_impl< Aut >::state_has_name ( state_t  )
inlinestatic

Definition at line 79 of file insplit.hh.

Member Data Documentation

template<Automaton Aut>
bimap_t vcsn::detail::insplit_automaton_impl< Aut >::bimap_
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_().

template<Automaton Aut>
automaton_t vcsn::detail::insplit_automaton_impl< Aut >::in_
private

The input automaton.

Definition at line 234 of file insplit.hh.

Referenced by vcsn::detail::insplit_automaton_impl< Aut >::aut_in().


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