mirror of
https://github.com/Z3Prover/z3
synced 2025-08-02 17:30:23 +00:00
start working on network flow
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
d6f0c13f2a
commit
a1a8aad09b
5 changed files with 77 additions and 80 deletions
|
@ -27,44 +27,41 @@ namespace smt {
|
|||
template<typename Ext>
|
||||
class thread_spanning_tree : public spanning_tree_base, protected Ext {
|
||||
protected:
|
||||
typedef dl_var node;
|
||||
typedef dl_edge<Ext> edge;
|
||||
typedef dl_graph<Ext> graph;
|
||||
typedef typename Ext::numeral numeral;
|
||||
typedef typename Ext::fin_numeral fin_numeral;
|
||||
|
||||
// Store the parent of a node i in the spanning tree
|
||||
svector<node> m_pred;
|
||||
svector<node_id> m_pred;
|
||||
// Store the number of edge on the path from node i to the root
|
||||
svector<int> m_depth;
|
||||
// Store the pointer from node i to the next node in depth-first search order
|
||||
svector<node> m_thread;
|
||||
svector<node_id> m_thread; // Store the pointer from node i to the next node in depth-first search order
|
||||
|
||||
// i |-> edge between (i, m_pred[i])
|
||||
svector<edge_id> m_tree;
|
||||
svector<edge_id> m_tree; // i |-> edge between (i, m_pred[i])
|
||||
|
||||
node m_root_t2;
|
||||
node_id m_root_t2;
|
||||
|
||||
graph & m_graph;
|
||||
|
||||
void swap_order(node q, node v);
|
||||
node find_rev_thread(node n) const;
|
||||
void fix_depth(node start, node after_end);
|
||||
node get_final(int start);
|
||||
bool is_preorder_traversal(node start, node end);
|
||||
node get_common_ancestor(node u, node v);
|
||||
void swap_order(node_id q, node_id v);
|
||||
node_id find_rev_thread(node_id n) const;
|
||||
void fix_depth(node_id start, node_id after_end);
|
||||
node_id get_final(int start);
|
||||
bool is_preorder_traversal(node_id start, node_id end);
|
||||
node_id get_common_ancestor(node_id u, node_id v);
|
||||
bool is_forward_edge(edge_id e_id) const;
|
||||
bool is_ancestor_of(node ancestor, node child);
|
||||
bool is_ancestor_of(node_id ancestor, node_id child);
|
||||
|
||||
public:
|
||||
thread_spanning_tree(graph & g);
|
||||
|
||||
virtual void initialize(svector<edge_id> const & tree);
|
||||
void get_descendants(node start, svector<node> & descendants);
|
||||
void get_descendants(node_id start, svector<node_id> & descendants);
|
||||
|
||||
virtual void update(edge_id enter_id, edge_id leave_id);
|
||||
void get_path(node start, node end, svector<edge_id> & path, svector<bool> & against);
|
||||
bool in_subtree_t2(node child);
|
||||
void get_path(node_id start, node_id end, svector<edge_id> & path, svector<bool> & against);
|
||||
bool in_subtree_t2(node_id child);
|
||||
|
||||
bool check_well_formed();
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue