1 #ifndef VCSN_ALGOS_INFO_HH
2 # define VCSN_ALGOS_INFO_HH
31 template <
typename Aut>
32 typename std::enable_if<labelset_t_of<Aut>::is_free(),
39 template <
typename Aut>
40 typename std::enable_if<!labelset_t_of<Aut>::is_free(),
50 template <
typename Aut>
51 typename std::enable_if<labelset_t_of<Aut>::is_free(),
58 template <
typename Aut>
59 typename std::enable_if<!labelset_t_of<Aut>::is_free(),
69 template <
typename Aut>
70 typename std::enable_if<labelset_t_of<Aut>::is_free(),
77 template <
typename Aut>
78 typename std::enable_if<!labelset_t_of<Aut>::is_free(),
88 template <
typename Aut>
89 typename std::enable_if<labelset_t_of<Aut>::is_free(),
96 template <
typename Aut>
97 typename std::enable_if<!labelset_t_of<Aut>::is_free(),
107 template <
typename Aut>
108 typename std::enable_if<labelset_t_of<Aut>::is_free(),
115 template <
typename Aut>
116 typename std::enable_if<!labelset_t_of<Aut>::is_free(),
126 template <
typename Aut>
127 typename std::enable_if<labelset_t_of<Aut>::is_free(),
134 template <
typename Aut>
135 typename std::enable_if<!labelset_t_of<Aut>::is_free(),
145 template <
typename Aut>
146 typename std::enable_if<labelset_t_of<Aut>::is_free(),
153 template <
typename Aut>
154 typename std::enable_if<!labelset_t_of<Aut>::is_free(),
164 template <
typename Aut>
165 typename std::enable_if<labelset_t_of<Aut>::is_free(),
172 template <
typename Aut>
173 typename std::enable_if<!labelset_t_of<Aut>::is_free(),
183 template <
typename Aut>
185 typename std::enable_if<!labelset_t_of<Aut>::has_one(),
192 template <
typename Aut>
193 typename std::enable_if<labelset_t_of<Aut>::has_one(),
198 for (
auto t : aut->transitions())
199 res += aut->labelset()->is_one(aut->label_of(t));
203 template <
typename Aut>
218 info(
const A& aut, std::ostream& out,
bool detailed =
false)
220 #define ECHO(Name, Value) \
221 out << Name ": " << Value << '\n'
222 ECHO(
"type", aut->vname(
true));
223 ECHO(
"number of states", aut->num_states());
224 ECHO(
"number of initial states", aut->num_initials());
225 ECHO(
"number of final states", aut->num_finals());
229 ECHO(
"number of transitions", aut->num_transitions());
230 ECHO(
"number of codeterministic states",
232 ECHO(
"number of deterministic states",
236 ECHO(
"number of strongly connected components",
num_sccs(aut));
255 out <<
"is valid: " <<
is_valid(aut);
264 template <
typename Aut,
typename Ostream,
typename Bool>
268 info(aut->as<Aut>(), out, detailed);
273 (
const automaton& aut, std::ostream& out,
274 bool detailed) -> std::ostream&);
283 template <
class RatExpSet>
285 info(
const RatExpSet& rs,
const typename RatExpSet::value_t& e,
292 # define DEFINE(Type) \
293 << "\n" #Type ": " << nfo.Type
295 <<
"type: " << rs.vname(
true)
296 <<
"\nsize: " << sizer(e)
318 template <
typename RatExpSet,
typename Ostream>
321 const auto& e = exp->as<RatExpSet>();
322 vcsn::info<RatExpSet>(e.ratexpset(), e.ratexp(), o);
327 (
const ratexp& aut, std::ostream& o) -> std::ostream&);
332 #endif // !VCSN_ALGOS_INFO_HH
std::enable_if< labelset_t_of< Aut >::is_free(), bool >::type is_cycle_ambiguous(const Aut &a)
bool is_deterministic(const Aut &aut, state_t_of< Aut > s)
Whether state s is deterministic in aut.
bool is_ambiguous(const Aut &aut)
REGISTER_DECLARE(accessible,(const automaton &) -> automaton)
std::shared_ptr< detail::automaton_base > automaton
size_t num_accessible_states(const Aut &a)
Number of accessible states, not counting pre() and post().
std::enable_if< labelset_t_of< Aut >::is_free(), size_t >::type num_deterministic_states(const Aut &a)
std::enable_if< labelset_t_of< Aut >::is_free(), bool >::type is_codeterministic(const Aut &a)
std::enable_if< labelset_t_of< Aut >::is_free(), bool >::type is_synchronizing(const Aut &a)
std::enable_if< labelset_t_of< Aut >::is_free(), bool >::type is_deterministic(const Aut &a)
std::ostream & info(const A &aut, std::ostream &out, bool detailed=false)
bool is_trim(const Aut &a)
bool is_useless(const Aut &a)
bool is_standard(const Aut &a)
Whether a is standard.
RatExpSet::value_t conjunction(const RatExpSet &rs, const typename RatExpSet::value_t &lhs, const typename RatExpSet::value_t &rhs)
Intersection/Hadamard product of ratexps.
#define ECHO(Name, Value)
std::size_t num_sccs(const Aut &aut)
Get number of strongly connected components.
std::enable_if< labelset_t_of< Aut >::is_free(), size_t >::type num_codeterministic_states(const Aut &a)
std::shared_ptr< detail::ratexp_base > ratexp
bool is_complete(const Aut &aut)
Whether aut is complete.
bool is_valid(const Aut &aut)
size_t num_codeterministic_states(const Aut &aut)
Number of non-deterministic states of transpositive automaton.
bool is_codeterministic(const Aut &aut)
Whether the transpositive automaton is deterministic.
bool is_proper(const Aut &aut)
Test whether an automaton is proper.
std::ostream & info_ratexp(const ratexp &exp, std::ostream &o)
Bridge.
ATTRIBUTE_CONST bool is_eps_acyclic(const Aut &aut)
auto complement(const Aut &aut) -> decltype(copy(aut))
std::enable_if< labelset_t_of< Aut >::is_free(), bool >::type is_complete(const Aut &a)
std::enable_if< labelset_t_of< Aut >::is_free(), bool >::type is_ambiguous(const Aut &a)
size_t num_eps_transitions(const Aut &)
ATTRIBUTE_CONST std::enable_if<!labelset_t_of< Aut >::has_one(), size_t >::type num_eps_transitions_(const Aut &)
bool is_empty(const Aut &a) ATTRIBUTE_PURE
auto shuffle(const Auts &...as) -> product_automaton< decltype(join_automata(as...)), Auts...>
The (accessible part of the) shuffle product.
size_t num_deterministic_states(const Aut &aut)
Number of non-deterministic states.
size_t num_useful_states(const Aut &a)
Number of accessible states, not counting pre() and post().
auto sum(const A &lhs, const B &rhs) -> decltype(join_automata(lhs, rhs))
bool is_cycle_ambiguous(const Aut &aut)
Whether aut is cycle-ambiguous.
size_t num_coaccessible_states(const Aut &a)
Number of accessible states, not counting pre() and post().
std::ostream & info(const automaton &aut, std::ostream &out, bool detailed)
Bridge.
Aut::element_type::automaton_nocv_t star(const Aut &aut)
Star of a standard automaton.
bool is_synchronizing(const Aut &aut)
bool is_normalized(const Aut &a)
Whether a is standard and co-standard.