24 #include <spot/misc/bitvect.hh>
25 #include <spot/twa/twagraph.hh>
26 #include <spot/twaalgos/sccinfo.hh>
75 typedef std::underlying_type_t<zielonka_tree_options> ut;
77 &
static_cast<ut
>(right));
85 typedef std::underlying_type_t<zielonka_tree_options> ut;
87 |
static_cast<ut
>(right));
95 typedef std::underlying_type_t<zielonka_tree_options> ut;
97 & ~
static_cast<ut
>(right));
122 return num_branches_;
152 std::pair<unsigned, unsigned>
185 return empty_is_even_;
194 return has_rabin_shape_;
203 return has_streett_shape_;
211 return has_streett_shape_ && has_rabin_shape_;
215 void dot(std::ostream&)
const;
222 unsigned next_sibling = 0;
223 unsigned first_child = 0;
230 unsigned one_branch_ = 0;
231 unsigned num_branches_ = 0;
234 bool has_rabin_shape_ =
true;
235 bool has_streett_shape_ =
true;
288 typedef std::underlying_type_t<acd_options> ut;
289 return static_cast<acd_options>(
static_cast<ut
>(left)
290 &
static_cast<ut
>(right));
297 typedef std::underlying_type_t<acd_options> ut;
298 return static_cast<acd_options>(
static_cast<ut
>(left)
299 |
static_cast<ut
>(right));
306 typedef std::underlying_type_t<acd_options> ut;
307 return static_cast<acd_options>(
static_cast<ut
>(left)
308 & ~
static_cast<ut
>(right));
340 std::pair<unsigned, unsigned>
341 step(
unsigned branch,
unsigned edge)
const;
359 return nodes_.size();
377 if (scc >= scc_count_)
378 report_invalid_scc_number(scc,
"is_even");
379 return trees_[scc].is_even;
399 if (scc >= scc_count_)
400 report_invalid_scc_number(scc,
"scc_max_level");
401 return trees_[scc].max_level;
435 void dot(std::ostream&,
const char*
id =
nullptr)
const;
439 bool own_si_ =
false;
456 unsigned next_sibling = 0;
457 unsigned first_child = 0;
465 : edges(e), states(s)
471 std::deque<acd_node> nodes_;
474 std::deque<std::unique_ptr<bitvect>> bitvectors;
486 unsigned max_level = 0;
487 unsigned num_nodes = 0;
493 std::vector<scc_data> trees_;
498 bool has_rabin_shape_ =
true;
499 bool has_streett_shape_ =
true;
505 unsigned leftmost_branch_(
unsigned node,
unsigned state)
const;
509 void report_invalid_scc_number(
unsigned num,
const char* fn);
510 [[noreturn]]
static void report_need_opt(
const char* opt);
511 [[noreturn]]
static void report_empty_acd(
const char* fn);
539 bool colored =
false);
542 bool colored =
false,
543 bool order_heuristic =
true);
An acceptance condition.
Definition: acc.hh:54
Alternating Cycle Decomposition implementation.
Definition: zlktree.hh:323
bool has_parity_shape() const
Whether the ACD has parity shape.
unsigned first_branch(unsigned state) const
Return the first branch for state.
bool node_acceptance(unsigned n) const
const const_twa_graph_ptr get_aut() const
Return the automaton on which the ACD is defined.
Definition: zlktree.hh:426
bool is_even(unsigned scc) const
Whether the ACD corresponds to a min even or min odd parity acceptance in SCC scc.
Definition: zlktree.hh:375
bool has_rabin_shape() const
Whether the ACD has Rabin shape.
const acc_cond::mark_t & node_colors(unsigned n) const
Return the colors of a node.
std::pair< unsigned, unsigned > step(unsigned branch, unsigned edge) const
Step through the ACD.
unsigned node_level(unsigned n) const
Return the level of a node.
acd(const const_twa_graph_ptr &aut, acd_options opt=acd_options::NONE)
Build an ACD directly from an automaton.
std::vector< unsigned > edges_of_node(unsigned n) const
Return the list of edges covered by node n of the ACD.
unsigned node_count() const
Return the number of nodes in the ACD forest.
Definition: zlktree.hh:357
void dot(std::ostream &, const char *id=nullptr) const
Render the ACD as in GraphViz format.
bool is_even() const
Whether the ACD globally corresponds to a min even or min odd parity acceptance.
Definition: zlktree.hh:388
unsigned state_step(unsigned node, unsigned edge) const
Step through the ACD, with rules for state-based output.
acd(const scc_info &si, acd_options opt=acd_options::NONE)
Build an Alternating Cycle Decomposition an SCC decomposition.
unsigned scc_max_level(unsigned scc) const
Return the maximum parity level in the given SCC.
Definition: zlktree.hh:397
bool has_streett_shape() const
Whether the ACD has Streett shape.
A bit vector.
Definition: bitvect.hh:51
Compute an SCC map and gather assorted information.
Definition: sccinfo.hh:465
Abstract class for states.
Definition: twa.hh:49
Zielonka Tree implementation.
Definition: zlktree.hh:110
std::vector< zielonka_node > nodes_
All nodes of the Zielonka tree.
Definition: zlktree.hh:228
bool has_rabin_shape() const
Whether the Zielonka tree has Rabin shape.
Definition: zlktree.hh:192
bool has_parity_shape() const
Whether the Zielonka tree has parity shape.
Definition: zlktree.hh:209
bool has_streett_shape() const
Whether the Zielonka tree has Streett shape.
Definition: zlktree.hh:201
std::pair< unsigned, unsigned > step(unsigned branch, acc_cond::mark_t colors) const
Walk through the Zielonka tree.
zielonka_tree(const acc_cond &cond, zielonka_tree_options opt=zielonka_tree_options::NONE)
Build a Zielonka tree from the acceptance condition.
bool is_even() const
Whether the tree corresponds to a min even parity acceptance.
Definition: zlktree.hh:171
void dot(std::ostream &) const
Render the tree as in GraphViz format.
unsigned first_branch() const
The number of one branch in the tree.
Definition: zlktree.hh:128
bool empty_layer_is_even() const
Whether the layer corresponding to {} is even.
Definition: zlktree.hh:183
unsigned num_branches() const
The number of branches in the Zielonka tree.
Definition: zlktree.hh:120
scc_info_options operator&(scc_info_options left, scc_info_options right)
Bitwise AND of two scc_info_options values.
Definition: sccinfo.hh:427
bool operator!(scc_info_options me)
Test if an scc_info_options value equals NONE.
Definition: sccinfo.hh:419
std::shared_ptr< twa_graph > twa_graph_ptr
Shared pointer to a mutable twa_graph.
Definition: fwd.hh:44
std::shared_ptr< const twa_graph > const_twa_graph_ptr
Shared pointer to a const twa_graph.
Definition: fwd.hh:38
Definition: automata.hh:26
zielonka_tree_options operator-(zielonka_tree_options left, zielonka_tree_options right)
Remove options from a zielonka_tree_options set (bitwise AND NOT).
Definition: zlktree.hh:92
const mc_rvalue operator|(const mc_rvalue &lhs, const mc_rvalue &rhs)
This function helps to find the output value from a set of threads that may have different values.
Definition: mc.hh:140
An acceptance mark.
Definition: acc.hh:76
A node in the Zielonka tree, storing parent, sibling, child links, level, and color set.
Definition: zlktree.hh:220
unsigned level
Depth level of this node in the tree.
Definition: zlktree.hh:224
acc_cond::mark_t colors
Set of colors associated with this node.
Definition: zlktree.hh:225
unsigned parent
Index of parent node (0 for root).
Definition: zlktree.hh:221