17 #ifndef AWALI_ALGOS_IS_VALID_HH
18 # define AWALI_ALGOS_IS_VALID_HH
21 # include <type_traits>
22 # include <unordered_map>
46 template <
typename Aut>
47 typename Aut::element_type::automaton_nocv_t
52 const auto& ws = *aut->weightset();
53 for (
auto t: res->transitions())
54 res->set_weight(t, ws.abs(res->weight_of(t)));
60 template <
typename Aut>
67 template <typename Aut, bool has_one = context_t_of<Aut>::has_one()>
74 return is_valid_<weightset_t::star_status()>(aut);
78 template <star_status_t Status>
82 is_valid_(
const automaton_t& aut) {
88 template <star_status_t Status>
92 is_valid_(
const automaton_t& aut) {
98 template <star_status_t Status>
102 is_valid_(
const automaton_t&) {
106 template <star_status_t Status>
110 is_valid_(
const automaton_t& aut) {
115 template <
typename Aut>
117 using automaton_t =
typename std::remove_cv<Aut>::type;
160 template <
typename Aut>
171 template <
typename RatExpSet>
173 is_valid(
const RatExpSet& rs,
const typename RatExpSet::ratexp_t& e)
181 catch (
const std::runtime_error&)
static constexpr bool is_valid(const automaton_t &)
Definition: is_valid.hh:119
Definition: is_valid.hh:68
static bool is_valid(const automaton_t &aut)
Definition: is_valid.hh:73
weightset_t_of< automaton_t > weightset_t
Definition: is_valid.hh:71
typename std::remove_cv< Aut >::type automaton_t
Definition: is_valid.hh:70
Definition: constant_term.hh:40
@ NON_STARRABLE
Definition: enums.hh:166
@ TOPS
Definition: enums.hh:167
@ ABSVAL
Definition: enums.hh:168
@ STARRABLE
The star of every element exists.
Definition: enums.hh:165
bool is_properable(Aut &&aut)
Whether proper_here(aut) succeeds.
Definition: is_valid.hh:61
Aut::element_type::automaton_nocv_t absval(const Aut &aut)
Copy of aut, with absolute values.
Definition: is_valid.hh:48
bool is_proper(const Aut &aut) ATTRIBUTE_CONST
Test whether an automaton is proper.
Definition: is_proper.hh:94
AutOut copy(const AutIn &input, Pred keep_state, bool keep_history=true, bool transpose=false)
A copy of input keeping only its states that are accepted by keep_state.
Definition: copy.hh:189
bool in_situ_remover(Aut &aut, bool prune=true)
Blindly eliminate epsilon transitions without checking for the validity of the automaton.
Definition: proper.hh:418
weight_t_of< RatExpSet > constant_term(const RatExpSet &rs, const typename RatExpSet::ratexp_t &e)
Definition: constant_term.hh:155
ATTRIBUTE_CONST bool is_eps_acyclic(const Aut &aut)
Definition: is_eps_acyclic.hh:123
bool is_valid(const Aut &aut)
Tests if aut is valid.
Definition: is_valid.hh:162
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