cprover
Loading...
Searching...
No Matches
graphml.h
Go to the documentation of this file.
1/*******************************************************************\
2
3Module: Read/write graphs as GraphML
4
5Author: Michael Tautschnig, mt@eecs.qmul.ac.uk
6
7\*******************************************************************/
8
11
12#ifndef CPROVER_XMLLANG_GRAPHML_H
13#define CPROVER_XMLLANG_GRAPHML_H
14
15#include <iosfwd>
16#include <string>
17
18#include <util/irep.h>
19#include <util/graph.h>
20#include <util/xml.h>
21
23{
25};
26
40
41class graphmlt:public grapht<xml_graph_nodet>
42{
43public:
44 bool has_node(const std::string &node_name) const
45 {
46 for(const auto &n : nodes)
47 if(n.node_name==node_name)
48 return true;
49
50 return false;
51 }
52
53 node_indext add_node_if_not_exists(std::string node_name)
54 {
55 for(node_indext i=0; i<nodes.size(); ++i)
56 {
57 if(nodes[i].node_name==node_name)
58 return i;
59 }
60
62 }
63
64 typedef std::map<std::string, std::string> key_valuest;
66};
67
68bool read_graphml(
69 std::istream &is,
72bool read_graphml(
73 const std::string &filename,
76
77bool write_graphml(const graphmlt &src, std::ostream &os);
78
79#endif // CPROVER_XMLLANG_GRAPHML_H
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:564
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition dstring.h:37
This class represents a node in a directed graph.
Definition graph.h:35
std::map< node_indext, edget > edgest
Definition graph.h:40
bool has_node(const std::string &node_name) const
Definition graphml.h:44
node_indext add_node_if_not_exists(std::string node_name)
Definition graphml.h:53
std::map< std::string, std::string > key_valuest
Definition graphml.h:64
key_valuest key_values
Definition graphml.h:65
A generic directed graph with a parametric node type.
Definition graph.h:167
nodet::node_indext node_indext
Definition graph.h:173
node_indext add_node(arguments &&... values)
Definition graph.h:180
Definition xml.h:21
A Template Class for Graphs.
bool write_graphml(const graphmlt &src, std::ostream &os)
Definition graphml.cpp:205
bool read_graphml(std::istream &is, graphmlt &dest, graphmlt::node_indext &entry)
Definition graphml.cpp:177
xmlt xml_node
Definition graphml.h:24
std::string invariant
Definition graphml.h:37
irep_idt file
Definition graphml.h:33
irep_idt line
Definition graphml.h:34
bool has_invariant
Definition graphml.h:36
std::string invariant_scope
Definition graphml.h:38
bool is_violation
Definition graphml.h:35
graph_nodet< xml_edget >::edgest edgest
Definition graphml.h:30
graph_nodet< xml_edget >::edget edget
Definition graphml.h:29
std::string node_name
Definition graphml.h:32