Skip to content

Commit 6f8ebe4

Browse files
committed
Updates requested in the PR.
1 parent 39a774f commit 6f8ebe4

File tree

2 files changed

+17
-27
lines changed

2 files changed

+17
-27
lines changed

src/goto-programs/goto_statistics.cpp

+12-22
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Author: Marek Trtik
1111

1212
void goto_statisticst::extend(
1313
const goto_functionst &functions,
14-
const symbol_tablet & table)
14+
const symbol_tablet &table)
1515
{
1616
for(auto const &elem : functions.function_map)
1717
{
@@ -45,45 +45,35 @@ void goto_statisticst::extend(
4545
}
4646
for(const auto &name_symbol : table.symbols)
4747
{
48-
if(name_symbol.second.is_lvalue and name_symbol.second.is_state_var)
48+
if(name_symbol.second.is_lvalue && name_symbol.second.is_state_var)
4949
{
5050
if(name_symbol.second.is_auxiliary)
5151
++num_auxiliary_variables;
5252
else
53-
++num_genuine_variables;
53+
++num_user_variables;
5454
}
5555
}
5656
}
5757

5858
jsont to_json(const goto_statisticst &stats)
5959
{
60-
struct localt
61-
{
62-
static std::string to_string(const std::size_t number)
63-
{
64-
std::stringstream sstr;
65-
sstr << number;
66-
return sstr.str();
67-
}
68-
};
69-
7060
json_objectt json_stats;
7161
json_stats["num_functions"]=
72-
json_numbert(localt::to_string(stats.get_num_functions()));
62+
json_numbert(std::to_string(stats.get_num_functions()));
7363
json_stats["num_instructions"]=
74-
json_numbert(localt::to_string(stats.get_num_instructions()));
75-
json_stats["num_genuine_variables"]=
76-
json_numbert(localt::to_string(stats.get_num_genuine_variables()));
64+
json_numbert(std::to_string(stats.get_num_instructions()));
65+
json_stats["num_user_variables"]=
66+
json_numbert(std::to_string(stats.get_num_user_variables()));
7767
json_stats["num_auxiliary_variables"]=
78-
json_numbert(localt::to_string(stats.get_num_auxiliary_variables()));
68+
json_numbert(std::to_string(stats.get_num_auxiliary_variables()));
7969
json_stats["num_function_calls"]=
80-
json_numbert(localt::to_string(stats.get_num_function_calls()));
70+
json_numbert(std::to_string(stats.get_num_function_calls()));
8171
json_stats["num_unconditional_gotos"]=
82-
json_numbert(localt::to_string(stats.get_num_unconditional_gotos()));
72+
json_numbert(std::to_string(stats.get_num_unconditional_gotos()));
8373
json_stats["num_conditional_gotos"]=
84-
json_numbert(localt::to_string(stats.get_num_conditional_gotos()));
74+
json_numbert(std::to_string(stats.get_num_conditional_gotos()));
8575
json_stats["num_loops"]=
86-
json_numbert(localt::to_string(stats.get_num_loops()));
76+
json_numbert(std::to_string(stats.get_num_loops()));
8777

8878
return json_stats;
8979
}

src/goto-programs/goto_statistics.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Author: Marek Trtik
1010
#define CPROVER_GOTO_PROGRAMS_GOTO_STATISTICS_H
1111

1212
/// \file goto-programs/goto_statistics.h
13-
/// \brief Computation of statistal properties of a GOTO program.
13+
/// \brief Computation of statistical properties of a GOTO program.
1414

1515
#include <cstddef>
1616
#include <util/json.h>
@@ -22,7 +22,7 @@ class goto_statisticst
2222
goto_statisticst():
2323
num_functions(0UL),
2424
num_instructions(0UL),
25-
num_genuine_variables(0UL),
25+
num_user_variables(0UL),
2626
num_auxiliary_variables(0UL),
2727
num_function_calls(0UL),
2828
num_unconditional_gotos(0UL),
@@ -53,9 +53,9 @@ class goto_statisticst
5353
return num_instructions;
5454
}
5555

56-
std::size_t get_num_genuine_variables() const
56+
std::size_t get_num_user_variables() const
5757
{
58-
return num_genuine_variables;
58+
return num_user_variables;
5959
}
6060

6161
std::size_t get_num_auxiliary_variables() const
@@ -86,7 +86,7 @@ class goto_statisticst
8686
private:
8787
std::size_t num_functions;
8888
std::size_t num_instructions;
89-
std::size_t num_genuine_variables;
89+
std::size_t num_user_variables;
9090
std::size_t num_auxiliary_variables;
9191
std::size_t num_function_calls;
9292
std::size_t num_unconditional_gotos;

0 commit comments

Comments
 (0)