cprover
Toggle main menu visibility
Loading...
Searching...
No Matches
loop_contract_config.h
Go to the documentation of this file.
1
/*******************************************************************\
2
3
Module: Config for loop contract
4
5
Author: Qinheping Hu
6
7
Date: June 2024
8
9
\*******************************************************************/
10
13
14
#ifndef CPROVER_GOTO_INSTRUMENT_CONTRACTS_LOOP_CONTRACT_CONFIG_H
15
#define CPROVER_GOTO_INSTRUMENT_CONTRACTS_LOOP_CONTRACT_CONFIG_H
16
18
struct
loop_contract_configt
19
{
20
public
:
21
// Apply loop contracts.
22
bool
apply_loop_contracts
=
false
;
23
24
// Unwind transformed loops after applying loop contracts or not.
25
bool
unwind_transformed_loops
=
true
;
26
27
// Check if loop contracts are all side-effect free.
28
bool
check_side_effect
=
true
;
29
30
std::string
to_string
()
const
31
{
32
std::string result;
33
result +=
"Apply loop contracts: "
;
34
result += (
apply_loop_contracts
?
"yes\n"
:
"no\n"
);
35
result +=
"Unwind transformed loops: "
;
36
result += (
unwind_transformed_loops
?
"yes\n"
:
"no\n"
);
37
result +=
"Check side effect of loop contracts: "
;
38
result += (
check_side_effect
?
"yes\n"
:
"no\n"
);
39
return
result;
40
}
41
42
bool
operator==
(
const
loop_contract_configt
&rhs)
const
43
{
44
return
apply_loop_contracts
== rhs.
apply_loop_contracts
&&
45
unwind_transformed_loops
== rhs.
unwind_transformed_loops
&&
46
check_side_effect
== rhs.
check_side_effect
;
47
}
48
49
bool
operator!=
(
const
loop_contract_configt
&rhs)
const
50
{
51
return
!(
this
== &rhs);
52
}
53
};
54
55
#endif
// CPROVER_GOTO_INSTRUMENT_CONTRACTS_LOOP_CONTRACT_CONFIG_H
loop_contract_configt
Loop contract configurations.
Definition
loop_contract_config.h:19
loop_contract_configt::unwind_transformed_loops
bool unwind_transformed_loops
Definition
loop_contract_config.h:25
loop_contract_configt::apply_loop_contracts
bool apply_loop_contracts
Definition
loop_contract_config.h:22
loop_contract_configt::to_string
std::string to_string() const
Definition
loop_contract_config.h:30
loop_contract_configt::operator==
bool operator==(const loop_contract_configt &rhs) const
Definition
loop_contract_config.h:42
loop_contract_configt::operator!=
bool operator!=(const loop_contract_configt &rhs) const
Definition
loop_contract_config.h:49
loop_contract_configt::check_side_effect
bool check_side_effect
Definition
loop_contract_config.h:28
goto-instrument
contracts
loop_contract_config.h
Generated by
1.17.0