forked from diffblue/cbmc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpath_strategies.h
66 lines (54 loc) · 1.49 KB
/
path_strategies.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/// \file Test for path strategies set through `cbmc --paths ...`
///
/// \author Kareem Khazem
#ifndef CPROVER_PATH_STRATEGIES_H
#define CPROVER_PATH_STRATEGIES_H
#include <goto-programs/goto_model.h>
#include <goto-checker/incremental_goto_checker.h>
#include <goto-symex/goto_symex_state.h>
/// \brief Events that we expect to happen during path exploration
///
/// See the description in the .cpp file on how to use this class.
struct symex_eventt
{
public:
enum class enumt
{
JUMP,
NEXT,
SUCCESS,
FAILURE
};
typedef std::pair<enumt, int> pairt;
typedef std::list<pairt> listt;
static pairt resume(enumt kind, int location)
{
return pairt(kind, location);
}
static pairt result(enumt kind)
{
return pairt(kind, -1);
}
static void validate_result(
listt &events,
const incremental_goto_checkert::resultt::progresst result,
std::size_t &);
static void
validate_resume(listt &events, const goto_symex_statet &state, std::size_t &);
};
void _check_with_strategy(
const std::string &strategy,
const std::string &program,
std::function<void(optionst &)>,
symex_eventt::listt &events);
/// Call this one, not the underscore version
void check_with_strategy(
const std::string &strategy,
std::function<void(optionst &)> opts_callback,
const std::string &program,
symex_eventt::listt events)
{
WHEN("strategy is '" + strategy + "'")
_check_with_strategy(strategy, program, opts_callback, events);
}
#endif // CPROVER_PATH_STRATEGIES_H