cprover
abstract_object_set.cpp
Go to the documentation of this file.
1
/*******************************************************************\
2
3
Module: analyses variable-sensitivity
4
5
Author: Jez Higgins, jez@jezuk.co.uk
6
7
\*******************************************************************/
8
9
#include <
analyses/variable-sensitivity/abstract_object_set.h
>
10
#include <
util/string_utils.h
>
11
12
static
bool
by_length
(
const
std::string &lhs,
const
std::string &rhs)
13
{
14
if
(lhs.size() < rhs.size())
15
return
true
;
16
if
(lhs.size() > rhs.size())
17
return
false
;
18
return
lhs < rhs;
19
}
20
21
void
abstract_object_sett::output
(
22
std::ostream &out,
23
const
ai_baset
&ai,
24
const
namespacet
&ns)
const
25
{
26
std::vector<std::string> output_values;
27
for
(
const
auto
&value :
values
)
28
{
29
std::ostringstream ss;
30
value->output(ss, ai, ns);
31
output_values.emplace_back(ss.str());
32
}
33
std::sort(output_values.begin(), output_values.end(),
by_length
);
34
35
join_strings
(out, output_values.begin(), output_values.end(),
", "
);
36
}
string_utils.h
by_length
static bool by_length(const std::string &lhs, const std::string &rhs)
Definition:
abstract_object_set.cpp:12
namespacet
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition:
namespace.h:92
abstract_object_set.h
an unordered set of value objects
join_strings
Stream & join_strings(Stream &&os, const It b, const It e, const Delimiter &delimiter, TransformFunc &&transform_func)
Prints items to an stream, separated by a constant delimiter.
Definition:
string_utils.h:62
ai_baset
This is the basic interface of the abstract interpreter with default implementations of the core func...
Definition:
ai.h:120
abstract_object_sett::values
value_sett values
Definition:
abstract_object_set.h:74
abstract_object_sett::output
void output(std::ostream &out, const ai_baset &ai, const namespacet &ns) const
Definition:
abstract_object_set.cpp:21
analyses
variable-sensitivity
abstract_object_set.cpp
Generated by
1.8.20