31 n->data.action.set(action - 1);
32 }
while (is.peek() ==
',' && is.get());
37 n->data.condition = s;
39 n->left = LoadConactTreeRec(t, is);
40 n->right = LoadConactTreeRec(t, is);
48 ifstream is(filename);
53 t.
AddRoot(LoadConactTreeRec(t, is));
59 os << string(tab,
'\t');
62 auto a = n->data.actions();
64 for (
size_t i = 1; i < a.size(); ++i)
70 os << n->data.condition <<
"\n";
71 WriteConactTreeRec(n->left, os, tab + 1);
72 WriteConactTreeRec(n->right, os, tab + 1);
78 ofstream os(filename);
81 WriteConactTreeRec(t.
GetRoot(), os);
87 if (n1->data.neq(n2->data))
98 n2->data.action = n1->data.action &= n2->data.action;
108 if (n1->data != n2->data)
120 n1->data.action &= n2->data.action;
121 n2->data.action = n1->data.action;
A BinaryDrag is the GRAPHGEN implementation of a Binary Directed Rooted Acyclic Graph (DRAG in short)
node * GetRoot() const
Returns the last root of the BinaryDrag.
void AddRoot(node *r)
Adds a new root to the vector of roots.
node * make_node(Args &&... args)
Creates and returns a new node updating the nodes_ vector.
bool WriteConactTree(const BinaryDrag< conact > &t, const string &filename)
void IntersectTrees(BinaryDrag< conact >::node *n1, BinaryDrag< conact >::node *n2)
bool EqualTrees(const BinaryDrag< conact >::node *n1, const BinaryDrag< conact >::node *n2)
Checks whether two (sub)trees 'n1' and 'n2' are equal or nor.
bool LoadConactDrag(BinaryDrag< conact > &t, const string &filename)
bool LoadConactTree(BinaryDrag< conact > &t, const string &filename)
bool WriteConactDrag(BinaryDrag< conact > &t, const string &filename)
void intersect_leaves(BinaryDrag< conact >::node *n1, BinaryDrag< conact >::node *n2)
bool equivalent_trees(const BinaryDrag< conact >::node *n1, const BinaryDrag< conact >::node *n2)
void Dag2DagUsingIdenties(BinaryDrag< conact > &t)