Skip to content

Commit 425c2db

Browse files
authored
Merge pull request #2791 from xbauch/develop
Briefly document interval analysis
2 parents c269ca5 + 1d15a5e commit 425c2db

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

src/analyses/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@ To be documented.
139139

140140
To be documented.
141141

142-
\subsection analyses-interval-analysist Integer interval analysis (interval_analysist) -- both an analysis and a transformation
142+
\subsection analyses-interval-analysis Integer interval analysis -- both an analysis and a transformation
143143

144-
To be documented.
144+
\ref interval_analysis interprets instructions of the input \ref goto_modelt
145+
over the \ref interval_domaint, evaluates variables for each program location
146+
(as intervals) and instruments the program with assumptions representing the
147+
over-approximation of variable values.

src/analyses/interval_analysis.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,25 @@ Author: Daniel Kroening, [email protected]
77
\*******************************************************************/
88

99
/// \file
10-
/// Interval Analysis
10+
/// Interval Analysis -- implements the functionality necessary for performing
11+
/// abstract interpretation over interval domain for goto programs. The result
12+
/// of the analysis is an instrumented program.
1113

1214
#include "interval_analysis.h"
1315

1416
#include <util/find_symbols.h>
1517

1618
#include "interval_domain.h"
1719

20+
/// Instruments all "post-branch" instructions with assumptions about variable
21+
/// intervals. For each such instruction, the function evaluates all variables
22+
/// referenced within the input goto_function as intervals, transforms these
23+
/// intervals into expressions and instruments the instruction with their
24+
/// conjunction.
25+
/// Example: interval [5,10] (for variable "x") translates into conjunction
26+
/// 5 <= x && x <= 10.
27+
/// \param interval_analysis Interval domain to be used for variable evaluation.
28+
/// \param goto_function [out] Goto function to be analysed and instrumented.
1829
void instrument_intervals(
1930
const ait<interval_domaint> &interval_analysis,
2031
goto_functionst::goto_functiont &goto_function)
@@ -76,6 +87,9 @@ void instrument_intervals(
7687
}
7788
}
7889

90+
/// Initialises the abstract interpretation over interval domain and
91+
/// instruments instructions using interval assumptions.
92+
/// \param goto_model [out] Input code as goto_model.
7993
void interval_analysis(goto_modelt &goto_model)
8094
{
8195
ait<interval_domaint> interval_analysis;

0 commit comments

Comments
 (0)