17 #ifndef AWALI_PARTITION_HISTORY_HH
18 # define AWALI_PARTITION_HISTORY_HH
41 template <
typename Autb>
49 std::map<state_t, state_set_t> origins_;
64 return (origins_.find(s)!=origins_.end());
68 return origins_.erase(s);
73 const std::string& fmt)
const override
75 const auto& set = origins_.at(s);
76 const char* separator =
"{";
77 for (
auto origin_state : set)
80 from_->print_state_history(origin_state , o, fmt);
87 const std::map<state_t, state_set_t>&
origins()
const
103 throw std::runtime_error(
"Origin state not available");
107 std::vector<state_t> v(origins_[s].begin(),origins_[s].end());
base type for history of automata
Definition: history.hh:40
specialisation of history_base
Definition: partition_history.hh:43
std::ostream & print_state_name(state_t s, std::ostream &o, const std::string &fmt) const override
Definition: partition_history.hh:72
void add_state(state_t s, const state_set_t &set)
set the history of state s
Definition: partition_history.hh:94
bool has_history(state_t s) const override
Definition: partition_history.hh:63
const std::map< state_t, state_set_t > & origins() const
map between states of the automaton and subsets of states of the source
Definition: partition_history.hh:87
state_t get_state(state_t) override
unsupported method : use get_state_set
Definition: partition_history.hh:102
history_kind_t get_nature() const override
Definition: partition_history.hh:58
partition_history(const Autb &source)
Definition: partition_history.hh:53
std::set< state_t > state_set_t
Definition: partition_history.hh:46
bool remove_history(state_t s) override
Definition: partition_history.hh:67
std::vector< state_t > get_state_set(state_t s) override
Definition: partition_history.hh:106
history_kind_t
The different kinds of history.
Definition: enums.hh:178
@ PARTITION
The state is a set of states of another automaton.
Main namespace of Awali.
Definition: ato.hh:22
unsigned state_t
Definition: types.hh:21