17 #ifndef AWALI_ALGOS_PARTIAL_IDENTITY_HH
18 # define AWALI_ALGOS_PARTIAL_IDENTITY_HH
20 # include <unordered_map>
29 namespace awali {
namespace sttc {
37 template <
size_t N,
typename Labelset>
56 template <
typename Labelset>
64 using type = std::tuple<T>;
69 return std::make_tuple(v);
73 template <
typename Aut,
size_t I>
87 auto in_labelset = in_context.labelset();
99 for (
auto s:
in_->states())
104 for (
auto t :
in_->all_transitions())
109 out_->new_transition(src->second, dst->second,
116 auto history = std::make_shared<single_history<Aut>>(
in_);
117 out_->set_history(history);
118 for (
auto p:
in_->all_states()) {
120 if(
in_->has_name(p)) {
143 template <
size_t I,
typename Aut>
carries the algebraic settings of automata
Definition: context.hh:40
A ValueSet which is a Cartesian product of ValueSets.
Definition: tupleset.hh:80
weightset_description weightset(const std::string &k)
typename concat_tupleset< tupleset< Labelset >, typename multitupleset< N-1, Labelset >::type >::type type
Definition: partial_identity.hh:41
Definition: tupleset.hh:959
Definition: partial_identity.hh:38
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
mutable_automaton< Context > make_mutable_automaton(const Context &ctx)
Definition: mutable_automaton.hh:915
auto partial_identity(const Aut &in, bool keep_history=true) -> typename internal::partial_identiter< Aut, I >::out_automaton_t
Builds a transducer realizing the identity on a language.
Definition: partial_identity.hh:146
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
static auto get(const T &v) -> type< T >
Definition: partial_identity.hh:68
std::tuple< T > type
Definition: partial_identity.hh:64
Definition: partial_identity.hh:45
static auto get(const T &v) -> type< T >
Definition: partial_identity.hh:51
typename std::cons_tuple< T, typename multituple< N-1 >::template type< T > >::type type
Definition: partial_identity.hh:47
Definition: partial_identity.hh:75
void operator()()
Definition: partial_identity.hh:95
const Aut & in_
Input automaton.
Definition: partial_identity.hh:127
typename multitupleset< I, in_labelset_t >::type out_labelset_t
Definition: partial_identity.hh:79
mutable_automaton< out_context_t > out_automaton_t
Definition: partial_identity.hh:81
void set_history()
Definition: partial_identity.hh:115
weightset_t_of< in_context_t > weightset_t
Definition: partial_identity.hh:78
partial_identiter(const Aut &in)
Definition: partial_identity.hh:83
mutable_automaton< out_context_t > out_
Output automaton.
Definition: partial_identity.hh:129
context_t_of< Aut > in_context_t
Definition: partial_identity.hh:76
std::unordered_map< state_t, state_t > out_state
input state -> output state.
Definition: partial_identity.hh:131
labelset_t_of< in_context_t > in_labelset_t
Definition: partial_identity.hh:77