Vcsn  2.3
Be Rational
vcsn::detail::lazy_proper_automaton_impl< Aut, has_one > Class Template Reference

Build a "lazy proper" automaton from the input with nullable labels. More...

#include <epsilon-remover-lazy.hh>

Inheritance diagram for vcsn::detail::lazy_proper_automaton_impl< Aut, has_one >:
Collaboration diagram for vcsn::detail::lazy_proper_automaton_impl< Aut, has_one >:

Public Types

using in_automaton_t = Aut
 
using in_context_t = context_t_of< in_automaton_t >
 
using context_t = detail::proper_context< context_t_of< Aut >>
 
using automaton_t = fresh_automaton_t_of< Aut, context_t >
 
using self_t = lazy_proper_automaton_impl
 
using super_t = automaton_decorator< automaton_t >
 
using state_t = state_t_of< automaton_t >
 
using transition_t = transition_t_of< automaton_t >
 
using transpose_in_automaton_t = transpose_automaton< in_automaton_t >
 
- Public Types inherited from vcsn::detail::automaton_decorator< fresh_automaton_t_of< Aut, detail::proper_context< context_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
 
 lazy_proper_automaton_impl (const in_automaton_t &a, bool prune=true)
 We cannot initialize super_t with the input automaton, we have to call remover_() first with the transposed input, then assign the proper automaton from the remover to this->aut_. More...
 
bool state_has_spontaneous_out (state_t s) const
 Whether the given state has outgoing spontaneous transitions. More...
 
void complete_ (state_t s) const
 Complete a state: find its outgoing transitions. More...
 
auto all_out (state_t s) const -> decltype(vcsn::detail::all_out(this->aut_, s))
 All the outgoing transitions. More...
 
bool is_lazy (state_t s) const
 
auto all_states () const
 All states including pre()/post(). More...
 
template<typename Pred >
auto all_states (Pred pred) const
 All states including pre()/post() that validate pred. More...
 
auto states () const
 All states excluding pre()/post(). More...
 
- Public Member Functions inherited from vcsn::detail::automaton_decorator< fresh_automaton_t_of< Aut, detail::proper_context< context_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 Public Member Functions inherited from vcsn::detail::automaton_decorator< fresh_automaton_t_of< Aut, detail::proper_context< context_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 Attributes

epsilon_remover_separate< transpose_in_automaton_tremover_
 
std::unordered_set< state_tproper_states_
 States whose outgoing transitions are known. More...
 
std::unordered_set< state_tknown_states_
 States we want to show ("wavefront", proper_states and their successors) More...
 

Additional Inherited Members

- Protected Attributes inherited from vcsn::detail::automaton_decorator< fresh_automaton_t_of< Aut, detail::proper_context< context_t_of< Aut > > > >
automaton_t aut_
 The wrapped automaton, possibly const. More...
 

Detailed Description

template<Automaton Aut, bool has_one = labelset_t_of<Aut>::has_one()>
class vcsn::detail::lazy_proper_automaton_impl< Aut, has_one >

Build a "lazy proper" automaton from the input with nullable labels.

The resulting automaton has the proper_context matching the context of the input.

We use the epsilon-remover-separate algorithm to build two separate automata: the spontaneous one and the proper one. The methods of lazy_proper_automaton are forwarded to the proper automaton of the separate remover algorithm.

Since the remover implementation works on incoming transitions and we want to be lazy on outgoing transitions to have a forward automaton, we transpose the input automaton before passing it to the remover, and we transpose its proper part again when adding it as the underlying automaton.

Definition at line 31 of file epsilon-remover-lazy.hh.

Member Typedef Documentation

template<Automaton Aut, bool has_one = labelset_t_of<Aut>::has_one()>
using vcsn::detail::lazy_proper_automaton_impl< Aut, has_one >::automaton_t = fresh_automaton_t_of<Aut, context_t>

Definition at line 40 of file epsilon-remover-lazy.hh.

template<Automaton Aut, bool has_one = labelset_t_of<Aut>::has_one()>
using vcsn::detail::lazy_proper_automaton_impl< Aut, has_one >::context_t = detail::proper_context<context_t_of<Aut>>

Definition at line 39 of file epsilon-remover-lazy.hh.

template<Automaton Aut, bool has_one = labelset_t_of<Aut>::has_one()>
using vcsn::detail::lazy_proper_automaton_impl< Aut, has_one >::in_automaton_t = Aut

Definition at line 36 of file epsilon-remover-lazy.hh.

template<Automaton Aut, bool has_one = labelset_t_of<Aut>::has_one()>
using vcsn::detail::lazy_proper_automaton_impl< Aut, has_one >::in_context_t = context_t_of<in_automaton_t>

Definition at line 37 of file epsilon-remover-lazy.hh.

template<Automaton Aut, bool has_one = labelset_t_of<Aut>::has_one()>
using vcsn::detail::lazy_proper_automaton_impl< Aut, has_one >::self_t = lazy_proper_automaton_impl

Definition at line 42 of file epsilon-remover-lazy.hh.

template<Automaton Aut, bool has_one = labelset_t_of<Aut>::has_one()>
using vcsn::detail::lazy_proper_automaton_impl< Aut, has_one >::state_t = state_t_of<automaton_t>

Definition at line 44 of file epsilon-remover-lazy.hh.

template<Automaton Aut, bool has_one = labelset_t_of<Aut>::has_one()>
using vcsn::detail::lazy_proper_automaton_impl< Aut, has_one >::super_t = automaton_decorator<automaton_t>

Definition at line 43 of file epsilon-remover-lazy.hh.

template<Automaton Aut, bool has_one = labelset_t_of<Aut>::has_one()>
using vcsn::detail::lazy_proper_automaton_impl< Aut, has_one >::transition_t = transition_t_of<automaton_t>

Definition at line 45 of file epsilon-remover-lazy.hh.

template<Automaton Aut, bool has_one = labelset_t_of<Aut>::has_one()>
using vcsn::detail::lazy_proper_automaton_impl< Aut, has_one >::transpose_in_automaton_t = transpose_automaton<in_automaton_t>

Definition at line 47 of file epsilon-remover-lazy.hh.

Constructor & Destructor Documentation

template<Automaton Aut, bool has_one = labelset_t_of<Aut>::has_one()>
vcsn::detail::lazy_proper_automaton_impl< Aut, has_one >::lazy_proper_automaton_impl ( const in_automaton_t a,
bool  prune = true 
)
inline

We cannot initialize super_t with the input automaton, we have to call remover_() first with the transposed input, then assign the proper automaton from the remover to this->aut_.

Definition at line 67 of file epsilon-remover-lazy.hh.

Member Function Documentation

template<Automaton Aut, bool has_one = labelset_t_of<Aut>::has_one()>
auto vcsn::detail::lazy_proper_automaton_impl< Aut, has_one >::all_out ( state_t  s) const -> decltype(vcsn::detail::all_out(this->aut_, s))
inline

All the outgoing transitions.

Definition at line 116 of file epsilon-remover-lazy.hh.

template<Automaton Aut, bool has_one = labelset_t_of<Aut>::has_one()>
auto vcsn::detail::lazy_proper_automaton_impl< Aut, has_one >::all_states ( ) const
inline

All states including pre()/post().

Guaranteed in increasing order.

Definition at line 131 of file epsilon-remover-lazy.hh.

template<Automaton Aut, bool has_one = labelset_t_of<Aut>::has_one()>
template<typename Pred >
auto vcsn::detail::lazy_proper_automaton_impl< Aut, has_one >::all_states ( Pred  pred) const
inline

All states including pre()/post() that validate pred.

Guaranteed in increasing order.

Definition at line 139 of file epsilon-remover-lazy.hh.

template<Automaton Aut, bool has_one = labelset_t_of<Aut>::has_one()>
void vcsn::detail::lazy_proper_automaton_impl< Aut, has_one >::complete_ ( state_t  s) const
inline

Complete a state: find its outgoing transitions.

Since remover_on can remove the state it's working on, and add outgoing transitions from its parents, we need to call it on all the successors of the state while they have outgoing spontaneous transitions.

Definition at line 90 of file epsilon-remover-lazy.hh.

template<Automaton Aut, bool has_one = labelset_t_of<Aut>::has_one()>
bool vcsn::detail::lazy_proper_automaton_impl< Aut, has_one >::is_lazy ( state_t  s) const
inline

Definition at line 124 of file epsilon-remover-lazy.hh.

template<Automaton Aut, bool has_one = labelset_t_of<Aut>::has_one()>
std::ostream& vcsn::detail::lazy_proper_automaton_impl< Aut, has_one >::print_set ( std::ostream &  o,
format  fmt 
) const
inline
template<Automaton Aut, bool has_one = labelset_t_of<Aut>::has_one()>
static symbol vcsn::detail::lazy_proper_automaton_impl< Aut, has_one >::sname ( )
inlinestatic

Definition at line 49 of file epsilon-remover-lazy.hh.

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

Here is the call graph for this function:

template<Automaton Aut, bool has_one = labelset_t_of<Aut>::has_one()>
bool vcsn::detail::lazy_proper_automaton_impl< Aut, has_one >::state_has_spontaneous_out ( state_t  s) const
inline

Whether the given state has outgoing spontaneous transitions.

Definition at line 78 of file epsilon-remover-lazy.hh.

template<Automaton Aut, bool has_one = labelset_t_of<Aut>::has_one()>
auto vcsn::detail::lazy_proper_automaton_impl< Aut, has_one >::states ( ) const
inline

All states excluding pre()/post().

Guaranteed in increasing order.

Definition at line 150 of file epsilon-remover-lazy.hh.

Member Data Documentation

template<Automaton Aut, bool has_one = labelset_t_of<Aut>::has_one()>
std::unordered_set<state_t> vcsn::detail::lazy_proper_automaton_impl< Aut, has_one >::known_states_
private

States we want to show ("wavefront", proper_states and their successors)

Definition at line 167 of file epsilon-remover-lazy.hh.

template<Automaton Aut, bool has_one = labelset_t_of<Aut>::has_one()>
std::unordered_set<state_t> vcsn::detail::lazy_proper_automaton_impl< Aut, has_one >::proper_states_
private

States whose outgoing transitions are known.

Definition at line 163 of file epsilon-remover-lazy.hh.

template<Automaton Aut, bool has_one = labelset_t_of<Aut>::has_one()>
epsilon_remover_separate<transpose_in_automaton_t> vcsn::detail::lazy_proper_automaton_impl< Aut, has_one >::remover_
private

Definition at line 160 of file epsilon-remover-lazy.hh.


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