X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=cyclegraph.cc;h=7e111b95a3a4bc43334d7037260fdc85ccbfc9c7;hb=e0f80c403452e544452f64687b3c489a869e4f77;hp=49ff00249fe9c49dbe9a1cda9fdad32af78c0f70;hpb=9fe0f14ceaf30ca99ce7a58aba8c49bb9b351f71;p=model-checker.git diff --git a/cyclegraph.cc b/cyclegraph.cc index 49ff002..7e111b9 100644 --- a/cyclegraph.cc +++ b/cyclegraph.cc @@ -320,7 +320,7 @@ static void print_node(FILE *file, const CycleNode *node, int label) if (node->is_promise()) { const Promise *promise = node->getPromise(); int idx = model->get_promise_number(promise); - fprintf(file, "P%d", idx); + fprintf(file, "P%u", idx); if (label) { int first = 1; fprintf(file, " [label=\"P%d, T", idx); @@ -350,6 +350,23 @@ static void print_edge(FILE *file, const CycleNode *from, const CycleNode *to, c fprintf(file, ";\n"); } +void CycleGraph::dot_print_node(FILE *file, const ModelAction *act) +{ + print_node(file, getNode(act), 1); +} + +template +void CycleGraph::dot_print_edge(FILE *file, const T *from, const U *to, const char *prop) +{ + CycleNode *fromnode = getNode(from); + CycleNode *tonode = getNode(to); + + print_edge(file, fromnode, tonode, prop); +} +/* Instantiate two forms of CycleGraph::dot_print_edge */ +template void CycleGraph::dot_print_edge(FILE *file, const Promise *from, const ModelAction *to, const char *prop); +template void CycleGraph::dot_print_edge(FILE *file, const ModelAction *from, const ModelAction *to, const char *prop); + void CycleGraph::dumpNodes(FILE *file) const { for (unsigned int i = 0; i < nodeList.size(); i++) {