cprover
Toggle main menu visibility
Loading...
Searching...
No Matches
complexity_limiter.h
Go to the documentation of this file.
1
/*******************************************************************\
2
3
Module: Symbolic Execution
4
5
Author: John Dumbell
6
7
\*******************************************************************/
8
11
12
#ifndef CPROVER_GOTO_SYMEX_COMPLEXITY_LIMITER_H
13
#define CPROVER_GOTO_SYMEX_COMPLEXITY_LIMITER_H
14
15
#include <
util/message.h
>
16
17
#include "
complexity_violation.h
"
18
#include "
symex_complexity_limit_exceeded_action.h
"
19
20
class
optionst
;
21
48
class
complexity_limitert
49
{
50
public
:
51
complexity_limitert
(
message_handlert
&logger,
const
optionst
&options);
52
55
inline
bool
complexity_limits_active
()
56
{
57
return
this->
complexity_active
;
58
}
59
64
complexity_violationt
check_complexity
(
goto_symex_statet
&state);
65
69
void
run_transformations
(
70
complexity_violationt
complexity_violation,
71
goto_symex_statet
¤t_state);
72
77
static
std::size_t
bounded_expr_size
(
const
exprt
&expr, std::size_t limit);
78
79
protected
:
80
mutable
messaget
log
;
81
84
bool
complexity_active
=
false
;
85
88
std::vector<symex_complexity_limit_exceeded_actiont>
89
violation_transformations
;
90
92
symex_complexity_limit_exceeded_actiont
default_transformation
;
93
97
std::size_t
max_complexity
= 0;
98
101
std::size_t
max_loops_complexity
= 0;
102
105
bool
are_loop_children_too_complicated
(
call_stackt
¤t_call_stack);
106
109
static
bool
in_blacklisted_loop
(
110
const
call_stackt
¤t_call_stack,
111
const
goto_programt::const_targett
&instr);
112
116
static
framet::active_loop_infot
*
117
get_current_active_loop
(
call_stackt
¤t_call_stack);
118
};
119
120
#endif
// CPROVER_GOTO_SYMEX_COMPLEXITY_LIMITER_H
call_stackt
Definition
call_stack.h:15
complexity_limitert::complexity_limitert
complexity_limitert(message_handlert &logger, const optionst &options)
Definition
complexity_limiter.cpp:17
complexity_limitert::check_complexity
complexity_violationt check_complexity(goto_symex_statet &state)
Checks the passed-in state to see if its become too complex for us to deal with, and if so set its gu...
Definition
complexity_limiter.cpp:138
complexity_limitert::complexity_limits_active
bool complexity_limits_active()
Is the complexity module active?
Definition
complexity_limiter.h:55
complexity_limitert::bounded_expr_size
static std::size_t bounded_expr_size(const exprt &expr, std::size_t limit)
Amount of nodes in expr approximately bounded by limit.
Definition
complexity_limiter.cpp:243
complexity_limitert::complexity_active
bool complexity_active
Is the complexity module active, usually coincides with a max_complexity value above 0.
Definition
complexity_limiter.h:84
complexity_limitert::in_blacklisted_loop
static bool in_blacklisted_loop(const call_stackt ¤t_call_stack, const goto_programt::const_targett &instr)
Checks whether we're in a loop that is currently considered blacklisted, and shouldn't be executed.
Definition
complexity_limiter.cpp:65
complexity_limitert::max_complexity
std::size_t max_complexity
The max complexity rating that a branch can be before it's abandoned.
Definition
complexity_limiter.h:97
complexity_limitert::violation_transformations
std::vector< symex_complexity_limit_exceeded_actiont > violation_transformations
Functions called when the heuristic has been violated.
Definition
complexity_limiter.h:89
complexity_limitert::max_loops_complexity
std::size_t max_loops_complexity
The amount of branches that can fail within the scope of a loops execution before the entire loop is ...
Definition
complexity_limiter.h:101
complexity_limitert::get_current_active_loop
static framet::active_loop_infot * get_current_active_loop(call_stackt ¤t_call_stack)
Returns inner-most currently active loop.
Definition
complexity_limiter.cpp:48
complexity_limitert::log
messaget log
Definition
complexity_limiter.h:80
complexity_limitert::default_transformation
symex_complexity_limit_exceeded_actiont default_transformation
Default heuristic transformation. Sets state as unreachable.
Definition
complexity_limiter.h:92
complexity_limitert::run_transformations
void run_transformations(complexity_violationt complexity_violation, goto_symex_statet ¤t_state)
Runs a suite of transformations on the state and symex executable, performing whatever transformation...
Definition
complexity_limiter.cpp:211
complexity_limitert::are_loop_children_too_complicated
bool are_loop_children_too_complicated(call_stackt ¤t_call_stack)
Checks whether the current loop execution stack has violated max_loops_complexity.
Definition
complexity_limiter.cpp:88
exprt
Base class for all expressions.
Definition
expr.h:57
framet::active_loop_infot
Definition
frame.h:57
goto_programt::const_targett
instructionst::const_iterator const_targett
Definition
goto_program.h:614
goto_symex_statet
Central data structure: state.
Definition
goto_symex_state.h:42
message_handlert
Definition
message.h:27
messaget
Class that provides messages with a built-in verbosity 'level'.
Definition
message.h:154
optionst
Definition
options.h:23
symex_complexity_limit_exceeded_actiont
Default heuristic transformation that cancels branches when complexity has been breached.
Definition
symex_complexity_limit_exceeded_action.h:12
complexity_violation.h
complexity_violationt
complexity_violationt
What sort of symex-complexity violation has taken place.
Definition
complexity_violation.h:18
message.h
symex_complexity_limit_exceeded_action.h
goto-symex
complexity_limiter.h
Generated by
1.17.0