17 #ifndef AWALI_ALGOS_PROJECTION_HH
18 # define AWALI_ALGOS_PROJECTION_HH
20 # include <unordered_map>
28 namespace awali {
namespace sttc {
37 template <
typename Labelset,
size_t I>
struct select;
38 template <
typename Labelset,
size_t... I>
struct selects;
41 template <
typename... T,
size_t I>
44 using labelset_t =
typename tp_t::template valueset_t<I>;
48 return std::get<I>(t.
sets());
53 template<
typename... T>
58 template <
typename... T,
size_t... I>
69 template <
typename... T>
80 template <
typename Aut,
size_t I>
94 auto in_labelset = in_context.labelset();
106 for (
auto s:
in_->states())
111 for (
auto t :
in_->all_transitions())
116 out_->new_transition(src->second, dst->second,
117 std::get<I>(
in_->label_of(t)),
in_->weight_of(t));
124 auto history = std::make_shared<single_history<Aut>>(
in_);
125 out_->set_history(history);
126 for (
auto p:
in_->all_states())
138 template <
typename Aut>
152 auto in_labelset = in_context.labelset();
164 for (
auto s:
in_->states())
169 for (
auto t :
in_->all_transitions())
174 out_->new_transition(src->second, dst->second,
182 auto history = std::make_shared<single_history<Aut>>(
in_);
183 out_->set_history(history);
184 for (
auto p:
in_->all_states())
197 template <
typename Aut,
size_t... I>
211 auto in_labelset = in_context.labelset();
222 for (
auto s:
in_->states())
227 for (
auto t :
in_->all_transitions())
232 out_->new_transition(src->second, dst->second,
240 auto history = std::make_shared<single_history<Aut>>(
in_);
241 out_->set_history(history);
242 for (
auto p:
in_->all_states())
263 template <
size_t I,
typename Tdc>
282 template <
typename Tdc>
306 template <
size_t... I,
typename Tdc>
carries the algebraic settings of automata
Definition: context.hh:40
The semiring of floating Numbers.
Definition: r.hh:34
A ValueSet which is a Cartesian product of ValueSets.
Definition: tupleset.hh:80
const valuesets_t & sets() const
The componants valuesets, as a tuple.
Definition: tupleset.hh:152
weightset_description weightset(const std::string &k)
auto tuple_tail(const Tuple &t) -> typename tail_tuple< Tuple >::type
Definition: sub_tuple.hh:96
Definition: projection.hh:39
Definition: projection.hh:38
Definition: sub_tuple.hh:65
Definition: projection.hh:52
auto projections(const Tdc &in, bool keep_history=true) -> typename internal::projectors< Tdc, I... >::out_automaton_t
Projection and/or permutation of tapes of a transducer.
Definition: projection.hh:309
auto projection(const Tdc &in, bool keep_history=true) -> typename internal::projector< Tdc, I >::out_automaton_t
Projection of one tape of a transducer.
Definition: projection.hh:266
typename internal::context_t_of_impl< internal::base_t< ValueSet > >::type context_t_of
Helper to retrieve the type of the context of a value set.
Definition: traits.hh:66
typename internal::labelset_t_of_impl< internal::base_t< ValueSet > >::type labelset_t_of
Helper to retrieve the type of the labelset of a value set.
Definition: traits.hh:76
auto images(const Tdc &in, bool keep_history=true) -> typename internal::imagers< Tdc >::out_automaton_t
Projection of last tapes of a transducer.
Definition: projection.hh:285
mutable_automaton< Context > make_mutable_automaton(const Context &ctx)
Definition: mutable_automaton.hh:911
std::shared_ptr< internal::mutable_automaton_impl< Context > > mutable_automaton
Definition: mutable_automaton.hh:45
typename internal::weightset_t_of_impl< internal::base_t< ValueSet > >::type weightset_t_of
Helper to retrieve the type of the weightset of a value set.
Definition: traits.hh:86
Main namespace of Awali.
Definition: ato.hh:22
Definition: projection.hh:140
context_t_of< Aut > context_t
Definition: projection.hh:141
mutable_automaton< out_context_t > out_automaton_t
Definition: projection.hh:146
out_automaton_t operator()()
Definition: projection.hh:160
void set_history()
Definition: projection.hh:181
mutable_automaton< out_context_t > out_
Output automaton.
Definition: projection.hh:191
weightset_t_of< context_t > weightset_t
Definition: projection.hh:143
typename select_tail< labelset_t >::labelset_t out_labelset_t
Definition: projection.hh:144
labelset_t_of< context_t > labelset_t
Definition: projection.hh:142
imagers(const Aut &in)
Definition: projection.hh:148
const Aut & in_
Input automaton.
Definition: projection.hh:189
std::unordered_map< state_t, state_t > out_state
input state -> output state.
Definition: projection.hh:193
Definition: projection.hh:82
mutable_automaton< out_context_t > out_automaton_t
Definition: projection.hh:88
void set_history()
Definition: projection.hh:123
std::unordered_map< state_t, state_t > out_state
input state -> output state.
Definition: projection.hh:135
labelset_t_of< context_t > labelset_t
Definition: projection.hh:84
projector(const Aut &in)
Definition: projection.hh:90
weightset_t_of< context_t > weightset_t
Definition: projection.hh:85
mutable_automaton< out_context_t > out_
Output automaton.
Definition: projection.hh:133
context_t_of< Aut > context_t
Definition: projection.hh:83
const Aut & in_
Input automaton.
Definition: projection.hh:131
out_automaton_t operator()()
Definition: projection.hh:102
typename select< labelset_t, I >::labelset_t out_labelset_t
Definition: projection.hh:86
Definition: projection.hh:199
context_t_of< Aut > context_t
Definition: projection.hh:200
out_automaton_t operator()()
Definition: projection.hh:218
std::unordered_map< state_t, state_t > out_state
input state -> output state.
Definition: projection.hh:251
projectors(const Aut &in)
Definition: projection.hh:207
weightset_t_of< context_t > weightset_t
Definition: projection.hh:202
mutable_automaton< out_context_t > out_automaton_t
Definition: projection.hh:205
mutable_automaton< out_context_t > out_
Output automaton.
Definition: projection.hh:249
void set_history()
Definition: projection.hh:239
labelset_t_of< context_t > labelset_t
Definition: projection.hh:201
const Aut & in_
Input automaton.
Definition: projection.hh:247
typename selects< labelset_t, I... >::labelset_t out_labelset_t
Definition: projection.hh:203
static labelset_t get(const tp_t &t)
Definition: projection.hh:47
typename tp_t::template valueset_t< I > labelset_t
Definition: projection.hh:44
typename tuple_to_tupleset< typename tail_tuple< std::tuple< T... > >::type >::type labelset_t
Definition: projection.hh:72
static labelset_t get(const tp_t &t)
Definition: projection.hh:75
Definition: reduce.hh:103
typename tuple_to_tupleset< typename sub_tuple< I... >::template type< std::tuple< T... > >>::type labelset_t
Definition: projection.hh:61
static labelset_t get(const tp_t &t)
Definition: projection.hh:64
Definition: sub_tuple.hh:34
static auto get(const Tuple &t) -> type< Tuple >
Definition: sub_tuple.hh:40