16 template <
typename Aut>
20 && std::is_same<weightset_t_of<Aut>,
b>::value;
25 template <
typename Aut>
28 && labelset_t_of<Aut>::is_free(),
30 minimize(
const Aut& a,
const std::string& algo =
"auto")
34 else if (algo ==
"auto" || algo ==
"signature")
36 else if (algo ==
"weighted")
39 raise(
"minimize: invalid algorithm (Boolean, free labelset): ",
43 template <
typename Aut>
46 && ! labelset_t_of<Aut>::is_free(),
48 minimize(
const Aut& a,
const std::string& algo =
"auto")
50 if (algo ==
"auto" || algo ==
"signature")
52 else if (algo ==
"weighted")
55 raise(
"minimize: invalid algorithm (Boolean, non-free labelset): ",
59 template <
typename Aut>
63 minimize(
const Aut& a,
const std::string& algo =
"auto")
65 if (algo ==
"auto" || algo ==
"weighted")
68 raise(
"minimize: invalid algorithm (non-Boolean): ",
str_escape(algo));
71 template <
typename Aut>
74 cominimize(
const Aut& a,
const std::string& algo =
"auto")
90 template <
typename Aut,
typename String>
95 const auto& a = aut->as<Aut>();
96 if (algo ==
"brzozowski")
102 template <
typename Aut,
typename String>
107 const auto& a = aut->as<Aut>();
112 template <
typename Aut,
typename String>
117 return minimize_<Aut, String>(aut, algo);
131 template <
typename Aut,
typename String>
136 const auto& a = aut->as<Aut>();
137 if (algo ==
"brzozowski")
143 template <
typename Aut,
typename String>
148 const auto& a = aut->as<Aut>();
153 template <
typename Aut,
typename String>
158 return cominimize_<Aut, String>(aut, algo);
auto cominimize(const Aut &a, const std::string &algo="auto") -> decltype(transpose(minimize(transpose(a), algo)))
std::ostream & str_escape(std::ostream &os, const std::string &str)
Output a string, escaping special characters.
weightset_mixin< detail::b_impl > b
typename std::enable_if< Cond, T >::type enable_if_t
auto minimize_brzozowski(const Aut &a) -> decltype(determinize(codeterminize(a)))
constexpr bool can_use_brzozowski()
Aut transpose(const transpose_automaton< Aut > &aut)
automaton make_automaton(const Aut &aut)
Build a dyn::automaton.
auto minimize_weighted(const Aut &a) -> quotient_t< Aut >
vcsn::enable_if_t< std::is_same< weightset_t_of< Aut >, b >::value &&labelset_t_of< Aut >::is_free(), quotient_t< Aut > > minimize(const Aut &a, const std::string &algo="auto")
Provide a variadic mul on top of a binary mul(), and one().
std::shared_ptr< detail::automaton_base > automaton
auto minimize_signature(const Aut &a) -> quotient_t< Aut >
typename detail::labelset_t_of_impl< base_t< ValueSet >>::type labelset_t_of
automaton minimize(const automaton &aut, const std::string &algo)
Bridge.
auto cominimize_brzozowski(const Aut &a) -> decltype(transpose(minimize_brzozowski(transpose(a))))
vcsn::enable_if_t<::vcsn::detail::can_use_brzozowski< Aut >), automaton > minimize_(const automaton &aut, const std::string &algo)
vcsn::enable_if_t<::vcsn::detail::can_use_brzozowski< Aut >), automaton > cominimize_(const automaton &aut, const std::string &algo)
automaton cominimize(const automaton &aut, const std::string &algo)
Bridge.
auto minimize_moore(const Aut &a) -> quotient_t< Aut >
Minimize automaton a using the Moore algorithm.