33 template <Automaton Aut>
35 std::enable_if_t<!labelset_t_of<Aut>::has_one(),
size_t>
41 template <Automaton Aut>
42 std::enable_if_t<labelset_t_of<Aut>::has_one(),
size_t>
47 res += aut->labelset()->is_one(aut->label_of(t));
55 template <Automaton Aut>
60 for (
auto s: a->all_states())
70 template <Automaton Aut>
72 info(
const Aut& aut, std::ostream&
out,
bool detailed =
false)
76 #define ECHO(Name, Value) \
77 out << Name ": " << Value << '\n'
78 #define VCSN_IF_FREE(Fun, Aut) \
79 detail::static_if<labelset_t_of<decltype(Aut)>::is_free()> \
80 ([](auto a) { return Fun(a); }, \
81 [](auto) { return "N/A"; })(Aut)
83 ECHO(
"number of states", aut->num_states());
85 ECHO(
"number of initial states", aut->num_initials());
86 ECHO(
"number of final states", aut->num_finals());
90 ECHO(
"number of codeterministic states",
92 ECHO(
"number of deterministic states",
94 ECHO(
"number of transitions", aut->num_transitions());
95 ECHO(
"number of spontaneous transitions",
98 ECHO(
"number of strongly connected components",
119 out <<
"is valid: " <<
is_valid(aut);
129 template <Automaton Aut,
typename Ostream,
typename Bool>
133 info(aut->as<Aut>(), out, detailed);
144 template <
typename ExpSet>
146 info(
const ExpSet&
rs,
const typename ExpSet::value_t& e,
152 o <<
"\nsize: " << rat::size<ExpSet>(e);
154 auto info = rat::make_info<ExpSet>(e);
155 o <<
"\nwidth: " << info.atom;
157 o << "\n" #Type ": " << info.Type
182 template <
typename ExpSet,
typename Ostream>
185 const auto& e = exp->as<ExpSet>();
186 vcsn::info(e.expressionset(), e.expression(), o);
bool is_proper(const Aut &aut)
Test whether an automaton is proper.
ValueSet::value_t tuple(const ValueSet &vs, const typename ValueSets::value_t &...v)
#define VCSN_IF_FREE(Fun, Aut)
#define ECHO(Name, Value)
auto conjunction(const Auts &...as) -> tuple_automaton< decltype(meet_automata(as...)), Auts... >
Build the (accessible part of the) conjunction.
auto sum(const Aut1 &lhs, const Aut2 &rhs, Tag tag={}) -> decltype(join_automata(lhs, rhs))
The sum of two automata.
bool is_synchronizing(const Aut &aut)
Whether this automaton is synchronizing, i.e., has synchronizing words.
auto infiltration(const A1 &a1, const A2 &a2) -> tuple_automaton< decltype(join_automata(a1, a2)), A1, A2 >
The (accessible part of the) infiltration product.
bool is_cycle_ambiguous(const Aut &aut)
Whether aut is cycle-ambiguous.
bool is_trim(const Aut &a)
Whether all its states are useful.
ATTRIBUTE_CONST std::enable_if_t<!labelset_t_of< Aut >::has_one(), size_t > num_spontaneous_transitions(const Aut &)
size_t num_accessible_states(const Aut &a)
Number of accessible states, not counting pre() and post().
ATTRIBUTE_CONST bool is_eps_acyclic(const Aut &aut)
bool is_empty(const Aut &a) ATTRIBUTE_PURE
Whether has no states.
size_t num_lazy_states(const Aut &a)
std::size_t num_components(const scc_automaton< Aut > &aut)
Get number of strongly connected components.
bool is_normalized(const Aut &a)
Whether a is standard and co-standard.
auto out(const Aut &aut, state_t_of< Aut > s)
Indexes of visible transitions leaving state s.
bool is_deterministic(const Aut &aut, state_t_of< Aut > s)
Whether state s is deterministic in aut.
size_t num_codeterministic_states(const Aut &aut)
Number of non-deterministic states of transpositive automaton.
auto complement(const Aut &aut) -> decltype(copy(aut))
std::shared_ptr< detail::automaton_base > automaton
std::ostream & info(const automaton &aut, std::ostream &out, bool detailed)
Bridge.
auto transitions(const Aut &aut) -> decltype(all_transitions(aut, is_special_t< Aut >
All the transition indexes between visible states.
auto star(const Aut &aut, Tag tag={}) -> decltype(detail::make_join_automaton(tag, aut))
Star of an automaton.
bool is_complete(const Aut &aut)
Whether aut is complete.
size_t num_deterministic_states(const Aut &aut)
Number of non-deterministic states.
Print as a parsable type string.
std::ostream & info_expression(const expression &exp, std::ostream &o)
Bridge (info).
bool is_valid(const Aut &aut)
size_t num_coaccessible_states(const Aut &a)
Number of accessible states, not counting pre() and post().
bool is_useless(const Aut &a)
Whether all no state is useful.
bool is_codeterministic(const Aut &aut)
Whether the transpositive automaton is deterministic.
std::shared_ptr< detail::expression_base > expression
bool is_ambiguous(const Aut &aut)
std::ostream & info(const Aut &aut, std::ostream &out, bool detailed=false)
scc_automaton< Aut > scc(const Aut &aut, const std::string &algo="auto")
Get scc_automaton from aut.
size_t num_useful_states(const Aut &a)
Number of accessible states, not counting pre() and post().
bool is_standard(const Aut &a)
Whether a is standard.
auto shuffle(const Auts &...as) -> tuple_automaton< decltype(join_automata(as...)), Auts... >
The (accessible part of the) shuffle product.
ValueSet::value_t ldiv(const ValueSet &vs, const typename ValueSet::value_t &lhs, const typename ValueSet::value_t &rhs)
Left-division of values.