File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ Author: Daniel Kroening, Peter Schrammel
12
12
#include " properties.h"
13
13
14
14
#include < util/invariant.h>
15
+ #include < util/json.h>
16
+ #include < util/xml.h>
15
17
16
18
std::string as_string (resultt result)
17
19
{
@@ -79,6 +81,31 @@ propertiest initialize_properties(const abstract_goto_modelt &goto_model)
79
81
return properties;
80
82
}
81
83
84
+ std::string
85
+ as_string (const irep_idt &property_id, const property_infot &property_info)
86
+ {
87
+ return " [" + id2string (property_id) + " ] " + property_info.description +
88
+ " : " + as_string (property_info.result );
89
+ }
90
+
91
+ xmlt xml (const irep_idt &property_id, const property_infot &property_info)
92
+ {
93
+ xmlt xml_result (" result" );
94
+ xml_result.set_attribute (" property" , id2string (property_id));
95
+ xml_result.set_attribute (" status" , as_string (property_info.result ));
96
+ return xml_result;
97
+ }
98
+
99
+ json_objectt
100
+ json (const irep_idt &property_id, const property_infot &property_info)
101
+ {
102
+ json_objectt result;
103
+ result[" property" ] = json_stringt (property_id);
104
+ result[" description" ] = json_stringt (property_info.description );
105
+ result[" status" ] = json_stringt (as_string (property_info.result ));
106
+ return result;
107
+ }
108
+
82
109
// / Returns the number of properties with given \p result
83
110
std::size_t
84
111
count_properties (const propertiest &properties, property_resultt result)
Original file line number Diff line number Diff line change @@ -16,6 +16,9 @@ Author: Daniel Kroening, Peter Schrammel
16
16
17
17
#include < goto-programs/goto_model.h>
18
18
19
+ class json_objectt ;
20
+ class xmlt ;
21
+
19
22
// / The result status of a property
20
23
enum class property_resultt
21
24
{
@@ -68,6 +71,14 @@ typedef std::unordered_map<irep_idt, property_infot> propertiest;
68
71
// / Returns the properties in the goto model
69
72
propertiest initialize_properties (const abstract_goto_modelt &);
70
73
74
+ std::string
75
+ as_string (const irep_idt &property_id, const property_infot &property_info);
76
+
77
+ xmlt xml (const irep_idt &property_id, const property_infot &property_info);
78
+
79
+ json_objectt
80
+ json (const irep_idt &property_id, const property_infot &property_info);
81
+
71
82
std::size_t
72
83
count_properties (const propertiest &properties, property_resultt result);
73
84
You can’t perform that action at this time.
0 commit comments