22 #include <unordered_map>
23 #include <spot/misc/common.hh>
24 #include <spot/misc/trival.hh>
25 #include <spot/graph/adjlist.hh>
35 static constexpr
unsigned target = (1U << (
sizeof(unsigned)*8 - 4)) - 1;
44 unsigned choice:
sizeof(unsigned)*8 - 4;
46 backprop_state(
bool owner)
59 : stop_asap_(stop_asap)
66 return reverse_.new_state(owner);
72 names_.emplace(
state, s);
92 return (*
this)[
state].frozen;
98 return (*
this)[
state].determined;
104 return (*
this)[
state].winner;
110 return (*
this)[
state].choice;
116 return set_winner(
state, winner, target);
125 return reverse_.num_edges();
129 bool set_winner(
unsigned state,
bool winner,
unsigned choice_state);
133 std::unordered_map<unsigned, std::string> names_;
135 const backprop_state& operator[](
unsigned state)
const
140 backprop_state& operator[](
unsigned state)
internal::boxed_label< State_Data >::data_t & state_data(unsigned s)
Return the state data for state s.
Definition: adjlist.hh:114
Graph used for backward propagation of winning conditions in parity games.
Definition: backprop.hh:34
unsigned num_edges() const
Return the number of edges.
Definition: backprop.hh:123
std::ostream & print_dot(std::ostream &os) const
Print the graph in dot format.
bool is_frozen(unsigned state) const
Check if a state is frozen.
Definition: backprop.hh:90
bool winner(unsigned state) const
Return the winner of a state (true = Player 0).
Definition: backprop.hh:102
void set_name(unsigned state, const std::string &s)
Set the name of the given state.
Definition: backprop.hh:70
bool is_determined(unsigned state) const
Check if the winner of a state has been determined.
Definition: backprop.hh:96
backprop_graph(bool stop_asap=true)
Construct the backpropagation graph.
Definition: backprop.hh:58
unsigned choice(unsigned state) const
Return the chosen successor for a state.
Definition: backprop.hh:108
bool new_edge(unsigned src, unsigned dst)
Add an edge from src to dst.
int new_state(bool owner)
Add a new state; owner is true if owned by Player 1.
Definition: backprop.hh:64
bool set_winner(unsigned state, bool winner)
Set the winner of a state.
Definition: backprop.hh:114
bool freeze_state(unsigned state)
Mark a state as frozen (no more incoming edges).
Abstract class for states.
Definition: twa.hh:49
Definition: automata.hh:26