Vcsn  2.1
Be Rational
vcsn::detail::composer< Lhs, Rhs > Class Template Reference

Build the (accessible part of the) composition. More...

#include <compose.hh>

Collaboration diagram for vcsn::detail::composer< Lhs, Rhs >:

Public Types

using clhs_t = Lhs
 
using crhs_t = Rhs
 
using hidden_l_labelset_t = typename clhs_t::element_type::res_labelset_t
 
using hidden_r_labelset_t = typename crhs_t::element_type::res_labelset_t
 
using hidden_l_label_t = typename hidden_l_labelset_t::value_t
 
using hidden_r_label_t = typename hidden_r_labelset_t::value_t
 
using middle_labelset_t = labelset_t_of< clhs_t >
 
using labelset_t = typename concat_tupleset< hidden_l_labelset_t, hidden_r_labelset_t >::type
 The type of context of the result. More...
 
using weightset_t = join_t< weightset_t_of< context_t_of< Lhs >>, weightset_t_of< context_t_of< Rhs >>>
 
using res_label_t = typename labelset_t::value_t
 
using context_t = ::vcsn::context< labelset_t, weightset_t >
 
using automaton_t = tuple_automaton< mutable_automaton< context_t >, Lhs, Rhs >
 The type of the resulting automaton. More...
 
using state_t = state_t_of< automaton_t >
 Result state type. More...
 
using state_name_t = typename automaton_t::element_type::state_name_t
 Tuple of states of input automata. More...
 
using weight_t = typename weightset_t::value_t
 
template<typename 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...
 

Public Member Functions

 composer (const Lhs &lhs, const Rhs &rhs)
 
void initialize_compose ()
 Fill the worklist with the initial source-state pairs, as needed for the product algorithm. More...
 
res_label_t join_label (const hidden_l_label_t &ll, const hidden_r_label_t &rl)
 
template<typename Aut >
vcsn::enable_if_t< labelset_t_of< Aut >::has_one(), typename Aut::element_type::res_label_t > get_hidden_one (const Aut &aut)
 
template<typename Aut >
vcsn::enable_if_t<!labelset_t_of< Aut >::has_one(), typename Aut::element_type::res_label_t > get_hidden_one (const Aut &)
 
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<typename A >
vcsn::enable_if_t< labelset_t_of< A >::has_one(), bool > is_one (const A &aut, transition_t_of< A > tr) const
 
template<typename A >
constexpr vcsn::enable_if_t<!labelset_t_of< A >::has_one(), bool > is_one (const A &, transition_t_of< A >) const
 
template<typename Aut >
constexpr vcsn::enable_if_t<!labelset_t_of< Aut >::has_one(), bool > is_spontaneous_in (const Aut &, state_t_of< Aut >) const
 Check if the state has only incoming spontaneous transitions. More...
 
template<typename Aut >
vcsn::enable_if_t< labelset_t_of< Aut >::has_one(), bool > is_spontaneous_in (const Aut &rhs, state_t_of< Aut > rst) const
 Whether the state has only incoming spontaneous transitions. More...
 

Static Public Member Functions

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)
 

Public Attributes

automaton_t res_
 The computed product. More...
 
std::tuple< transition_map_t< Lhs >, transition_map_t< Rhs > > transition_maps_
 Transition caches. More...
 

Private Types

template<std::size_t... I>
using seq = vcsn::detail::index_sequence< I...>
 A static list of integers. More...
 

Detailed Description

template<typename Lhs, typename Rhs>
class vcsn::detail::composer< Lhs, Rhs >

Build the (accessible part of the) composition.

Definition at line 24 of file compose.hh.

Member Typedef Documentation

template<typename Lhs , typename Rhs >
using vcsn::detail::composer< Lhs, Rhs >::automaton_t = tuple_automaton<mutable_automaton<context_t>, Lhs, Rhs>

The type of the resulting automaton.

Definition at line 66 of file compose.hh.

template<typename Lhs , typename Rhs >
using vcsn::detail::composer< Lhs, Rhs >::clhs_t = Lhs

Definition at line 36 of file compose.hh.

template<typename Lhs , typename Rhs >
using vcsn::detail::composer< Lhs, Rhs >::context_t = ::vcsn::context<labelset_t, weightset_t>

Definition at line 62 of file compose.hh.

template<typename Lhs , typename Rhs >
using vcsn::detail::composer< Lhs, Rhs >::crhs_t = Rhs

Definition at line 37 of file compose.hh.

template<typename Lhs , typename Rhs >
using vcsn::detail::composer< Lhs, Rhs >::hidden_l_label_t = typename hidden_l_labelset_t::value_t

Definition at line 42 of file compose.hh.

template<typename Lhs , typename Rhs >
using vcsn::detail::composer< Lhs, Rhs >::hidden_l_labelset_t = typename clhs_t::element_type::res_labelset_t

Definition at line 40 of file compose.hh.

template<typename Lhs , typename Rhs >
using vcsn::detail::composer< Lhs, Rhs >::hidden_r_label_t = typename hidden_r_labelset_t::value_t

Definition at line 43 of file compose.hh.

template<typename Lhs , typename Rhs >
using vcsn::detail::composer< Lhs, Rhs >::hidden_r_labelset_t = typename crhs_t::element_type::res_labelset_t

Definition at line 41 of file compose.hh.

template<typename Lhs , typename Rhs >
using vcsn::detail::composer< Lhs, Rhs >::labelset_t = typename concat_tupleset<hidden_l_labelset_t, hidden_r_labelset_t>::type

The type of context of the result.

The type is the "join" of the contexts, independently of the algorithm. However, its value differs: in the case of the product, the labelset is the meet of the labelsets, it is its join for shuffle and infiltration.

Definition at line 57 of file compose.hh.

template<typename Lhs , typename Rhs >
using vcsn::detail::composer< Lhs, Rhs >::middle_labelset_t = labelset_t_of<clhs_t>

Definition at line 49 of file compose.hh.

template<typename Lhs , typename Rhs >
using vcsn::detail::composer< Lhs, Rhs >::res_label_t = typename labelset_t::value_t

Definition at line 61 of file compose.hh.

template<typename Lhs , typename Rhs >
template<std::size_t... I>
using vcsn::detail::composer< Lhs, Rhs >::seq = vcsn::detail::index_sequence<I...>
private

A static list of integers.

Definition at line 33 of file compose.hh.

template<typename Lhs , typename Rhs >
using vcsn::detail::composer< Lhs, Rhs >::state_name_t = typename automaton_t::element_type::state_name_t

Tuple of states of input automata.

Definition at line 71 of file compose.hh.

template<typename Lhs , typename Rhs >
using vcsn::detail::composer< Lhs, Rhs >::state_t = state_t_of<automaton_t>

Result state type.

Definition at line 69 of file compose.hh.

template<typename Lhs , typename Rhs >
template<typename A >
using vcsn::detail::composer< Lhs, Rhs >::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().

Definition at line 102 of file compose.hh.

template<typename Lhs , typename Rhs >
using vcsn::detail::composer< Lhs, Rhs >::weight_t = typename weightset_t::value_t
Initial value:
{rhs, *res_->weightset()}}
{}
automaton_t operator()()
{
while (!res_->todo_.empty())
{
const auto& p = res_->todo_.front();
add_compose_transitions(std::get<1>(p), std::get<0>(p));
res_->todo_.pop_front();
}
return std::move(res_);
}
private:
using label_t = typename labelset_t::value_t

Definition at line 96 of file compose.hh.

template<typename Lhs , typename Rhs >
using vcsn::detail::composer< Lhs, Rhs >::weightset_t = join_t<weightset_t_of<context_t_of<Lhs>>, weightset_t_of<context_t_of<Rhs>>>

Definition at line 59 of file compose.hh.

Constructor & Destructor Documentation

template<typename Lhs , typename Rhs >
vcsn::detail::composer< Lhs, Rhs >::composer ( const Lhs &  lhs,
const Rhs &  rhs 
)
inline

Definition at line 73 of file compose.hh.

References vcsn::detail::composer< Lhs, Rhs >::res_.

Member Function Documentation

template<typename Lhs , typename Rhs >
void vcsn::detail::composer< Lhs, Rhs >::add_compose_transitions ( const state_t  src,
const state_name_t psrc 
)
inline

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 161 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::composer< Lhs, Rhs >::get_hidden_one(), vcsn::detail::composer< Lhs, Rhs >::is_spontaneous_in(), vcsn::detail::composer< Lhs, Rhs >::join_label(), vcsn::detail::composer< Lhs, Rhs >::res_, vcsn::detail::composer< Lhs, Rhs >::transition_maps_, vcsn::detail::transition_map< Aut, WeightSet, Deterministic, AllOut, KeepTransitions >::transition_< Weight, KeepTransitions_, Dummy >::weight(), and vcsn::zip_maps().

Here is the call graph for this function:

template<typename Lhs , typename Rhs >
template<typename Aut >
vcsn::enable_if_t<labelset_t_of<Aut>::has_one(), typename Aut::element_type::res_label_t> vcsn::detail::composer< Lhs, Rhs >::get_hidden_one ( const Aut &  aut)
inline
template<typename Lhs , typename Rhs >
template<typename Aut >
vcsn::enable_if_t<!labelset_t_of<Aut>::has_one(), typename Aut::element_type::res_label_t> vcsn::detail::composer< Lhs, Rhs >::get_hidden_one ( const Aut &  )
inline

Definition at line 152 of file compose.hh.

template<typename Lhs , typename Rhs >
void vcsn::detail::composer< Lhs, Rhs >::initialize_compose ( )
inline

Fill the worklist with the initial source-state pairs, as needed for the product algorithm.

Definition at line 130 of file compose.hh.

References vcsn::detail::composer< Lhs, Rhs >::res_.

template<typename Lhs , typename Rhs >
template<typename A >
vcsn::enable_if_t<labelset_t_of<A>::has_one(), bool> vcsn::detail::composer< Lhs, Rhs >::is_one ( const A &  aut,
transition_t_of< A >  tr 
) const
inline

Definition at line 229 of file compose.hh.

Referenced by vcsn::detail::composer< Lhs, Rhs >::is_spontaneous_in().

template<typename Lhs , typename Rhs >
template<typename A >
constexpr vcsn::enable_if_t<!labelset_t_of<A>::has_one(), bool> vcsn::detail::composer< Lhs, Rhs >::is_one ( const A &  ,
transition_t_of< A >   
) const
inline

Definition at line 237 of file compose.hh.

template<typename Lhs , typename Rhs >
template<typename Aut >
constexpr vcsn::enable_if_t<!labelset_t_of<Aut>::has_one(), bool> vcsn::detail::composer< Lhs, Rhs >::is_spontaneous_in ( const Aut &  ,
state_t_of< Aut >   
) const
inline

Check if the state has only incoming spontaneous transitions.

As it is in the case of the one-free labelset, it's always false.

Definition at line 249 of file compose.hh.

Referenced by vcsn::detail::composer< Lhs, Rhs >::add_compose_transitions().

template<typename Lhs , typename Rhs >
template<typename Aut >
vcsn::enable_if_t<labelset_t_of<Aut>::has_one(), bool> vcsn::detail::composer< Lhs, Rhs >::is_spontaneous_in ( const Aut &  rhs,
state_t_of< Aut >  rst 
) const
inline

Whether the state has only incoming spontaneous 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 260 of file compose.hh.

References vcsn::detail::composer< Lhs, Rhs >::is_one().

Here is the call graph for this function:

template<typename Lhs , typename Rhs >
res_label_t vcsn::detail::composer< Lhs, Rhs >::join_label ( const hidden_l_label_t ll,
const hidden_r_label_t rl 
)
inline
template<typename Lhs , typename Rhs >
static context_t vcsn::detail::composer< Lhs, Rhs >::make_context_ ( const Lhs &  lhs,
const Rhs &  rhs 
)
inlinestatic

Definition at line 122 of file compose.hh.

References vcsn::join(), and vcsn::detail::composer< Lhs, Rhs >::make_labelset_().

Here is the call graph for this function:

template<typename Lhs , typename Rhs >
static labelset_t vcsn::detail::composer< Lhs, Rhs >::make_labelset_ ( const hidden_l_labelset_t ll,
const hidden_r_labelset_t rl 
)
inlinestatic

Definition at line 104 of file compose.hh.

References vcsn::rat::size().

Referenced by vcsn::detail::composer< Lhs, Rhs >::make_context_().

Here is the call graph for this function:

template<typename Lhs , typename Rhs >
template<std::size_t... I1, std::size_t... I2>
static labelset_t vcsn::detail::composer< Lhs, Rhs >::make_labelset_ ( const hidden_l_labelset_t ll,
seq< I1...>  ,
const hidden_r_labelset_t rl,
seq< I2...>   
)
inlinestatic

Definition at line 112 of file compose.hh.

Member Data Documentation

template<typename Lhs , typename Rhs >
std::tuple<transition_map_t<Lhs>, transition_map_t<Rhs> > vcsn::detail::composer< Lhs, Rhs >::transition_maps_

Transition caches.

Definition at line 270 of file compose.hh.

Referenced by vcsn::detail::composer< Lhs, Rhs >::add_compose_transitions().


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