1 #ifndef VCSN_ALGOS_MINIMIZE_HH
2 # define VCSN_ALGOS_MINIMIZE_HH
17 template <
typename Aut>
21 && std::is_same<weightset_t_of<Aut>,
b>::value;
26 template <
typename Aut>
28 typename std::enable_if<std::is_same<weightset_t_of<Aut>,
b>::value
29 && labelset_t_of<Aut>::is_free(),
30 partition_automaton<Aut>>::type
31 minimize(
const Aut& a,
const std::string& algo)
35 else if (algo ==
"auto" || algo ==
"signature")
37 else if (algo ==
"weighted")
40 raise(
"minimize: invalid algorithm (Boolean, free labelset): ",
44 template <
typename Aut>
46 typename std::enable_if<std::is_same<weightset_t_of<Aut>,
b>::value
47 && ! labelset_t_of<Aut>::is_free(),
48 partition_automaton<Aut>>::type
49 minimize(
const Aut& a,
const std::string& algo)
51 if (algo ==
"auto" || algo ==
"signature")
53 else if (algo ==
"weighted")
56 raise(
"minimize: invalid algorithm (Boolean, non-free labelset): ",
60 template <
typename Aut>
62 typename std::enable_if<!std::is_same<weightset_t_of<Aut>,
b>::value,
63 partition_automaton<Aut>>::type
64 minimize(
const Aut& a,
const std::string& algo)
66 if (algo ==
"auto" || algo ==
"weighted")
69 raise(
"minimize: invalid algorithm (non-Boolean): ",
str_escape(algo));
72 template <
typename Aut>
91 template <
typename Aut,
typename String>
93 typename std::enable_if<::vcsn::detail::can_use_brzozowski<Aut>(),
97 const auto& a = aut->as<Aut>();
98 if (algo ==
"brzozowski")
104 template <
typename Aut,
typename String>
106 typename std::enable_if<!::vcsn::detail::can_use_brzozowski<Aut>(),
110 const auto& a = aut->as<Aut>();
131 template <
typename Aut,
typename String>
133 typename std::enable_if<::vcsn::detail::can_use_brzozowski<Aut>(),
137 const auto& a = aut->as<Aut>();
138 if (algo ==
"brzozowski")
144 template <
typename Aut,
typename String>
146 typename std::enable_if<!::vcsn::detail::can_use_brzozowski<Aut>(),
150 const auto& a = aut->as<Aut>();
162 #endif // !VCSN_ALGOS_MINIMIZE_HH
std::enable_if< std::is_same< weightset_t_of< Aut >, b >::value &&labelset_t_of< Aut >::is_free(), partition_automaton< Aut > >::type minimize(const Aut &a, const std::string &algo)
REGISTER_DECLARE(accessible,(const automaton &) -> automaton)
std::shared_ptr< detail::automaton_base > automaton
std::enable_if<::vcsn::detail::can_use_brzozowski< Aut >), automaton >::type cominimize(const automaton &aut, const std::string &algo)
typename detail::labelset_t_of_impl< base_t< ValueSet >>::type labelset_t_of
automaton make_automaton(const Aut &aut)
Build a dyn::automaton.
variadic_mul_mixin< detail::b_impl > b
std::ostream & str_escape(std::ostream &os, const std::string &str)
Output a string, escaping special characters.
auto minimize_signature(const Aut &a) -> partition_automaton< Aut >
auto minimize_weighted(const Aut &a) -> partition_automaton< Aut >
auto cominimize_brzozowski(const Aut &a) -> decltype(transpose(minimize_brzozowski(transpose(a))))
std::enable_if<::vcsn::detail::can_use_brzozowski< Aut >), automaton >::type minimize(const automaton &aut, const std::string &algo)
Provide a variadic mul on top of a binary mul(), and one().
auto minimize_moore(const Aut &a) -> partition_automaton< Aut >
auto minimize_brzozowski(const Aut &a) -> decltype(determinize(codeterminize(a)))
Aut transpose(const transpose_automaton< Aut > &aut)
auto cominimize(const Aut &a, const std::string &algo) -> decltype(transpose(minimize(transpose(a), algo)))
constexpr bool can_use_brzozowski()