cprover
Toggle main menu visibility
Loading...
Searching...
No Matches
static_show_domain.cpp
Go to the documentation of this file.
1
/*******************************************************************\
2
3
Module: goto-analyzer
4
5
Author: Martin Brain, martin.brain@cs.ox.ac.uk
6
7
\*******************************************************************/
8
9
#include "
static_show_domain.h
"
10
11
#include <
util/options.h
>
12
13
#include <
analyses/dependence_graph.h
>
14
#include <
analyses/variable-sensitivity/variable_sensitivity_dependence_graph.h
>
15
21
void
static_show_domain
(
22
const
goto_modelt
&goto_model,
23
const
ai_baset
&ai,
24
const
optionst
&options,
25
std::ostream &out)
26
{
27
if
(options.
get_bool_option
(
"json"
))
28
{
29
out << ai.
output_json
(goto_model);
30
}
31
else
if
(options.
get_bool_option
(
"xml"
))
32
{
33
out << ai.
output_xml
(goto_model);
34
}
35
else
if
(
36
options.
get_bool_option
(
"dot"
) &&
37
(options.
get_bool_option
(
"dependence-graph"
) ||
38
options.
get_bool_option
(
"dependence-graph-vs"
)))
39
{
40
// It would be nice to cast this to a grapht but C++ templates and
41
// inheritance need some care to work together.
42
if
(options.
get_bool_option
(
"dependence-graph"
))
43
{
44
auto
d =
dynamic_cast<
const
dependence_grapht
*
>
(&ai);
45
INVARIANT
(
46
d !=
nullptr
,
47
"--dependence-graph should set ai to be a dependence_grapht"
);
48
49
out <<
"digraph g {\n"
;
50
d->output_dot(out);
51
out <<
"}\n"
;
52
}
53
else
if
(options.
get_bool_option
(
"dependence-graph-vs"
))
54
{
55
auto
d =
56
dynamic_cast<
const
variable_sensitivity_dependence_grapht
*
>
(&ai);
57
INVARIANT
(
58
d !=
nullptr
,
59
"--dependence-graph-vsd should set ai to be a "
60
"variable_sensitivity_dependence_grapht"
);
61
62
out <<
"digraph g {\n"
;
63
d->output_dot(out);
64
out <<
"}\n"
;
65
}
66
UNREACHABLE
;
67
}
68
else
69
{
70
// 'text' or console output
71
ai.
output
(goto_model, out);
72
}
73
}
ai_baset
This is the basic interface of the abstract interpreter with default implementations of the core func...
Definition
ai.h:117
ai_baset::output
virtual void output(const namespacet &ns, const irep_idt &function_id, const goto_programt &goto_program, std::ostream &out) const
Output the abstract states for a single function.
Definition
ai.cpp:39
ai_baset::output_xml
virtual xmlt output_xml(const namespacet &ns, const irep_idt &function_id, const goto_programt &goto_program) const
Output the abstract states for a single function as XML.
Definition
ai.cpp:136
ai_baset::output_json
virtual jsont output_json(const namespacet &ns, const irep_idt &function_id, const goto_programt &goto_program) const
Output the abstract states for a single function as JSON.
Definition
ai.cpp:83
dependence_grapht
Definition
dependence_graph.h:221
goto_modelt
Definition
goto_model.h:27
optionst
Definition
options.h:23
optionst::get_bool_option
bool get_bool_option(const std::string &option) const
Definition
options.cpp:44
variable_sensitivity_dependence_grapht
Definition
variable_sensitivity_dependence_graph.h:219
dependence_graph.h
Field-Sensitive Program Dependence Analysis, Litvak et al., FSE 2010.
options.h
Options.
UNREACHABLE
#define UNREACHABLE
This should be used to mark dead code.
Definition
invariant.h:525
INVARIANT
#define INVARIANT(CONDITION, REASON)
This macro uses the wrapper function 'invariant_violated_string'.
Definition
invariant.h:423
static_show_domain
void static_show_domain(const goto_modelt &goto_model, const ai_baset &ai, const optionst &options, std::ostream &out)
Runs the analyzer and then prints out the domain.
Definition
static_show_domain.cpp:21
static_show_domain.h
variable_sensitivity_dependence_graph.h
A forked and modified version of analyses/dependence_graph.
goto-analyzer
static_show_domain.cpp
Generated by
1.17.0