CBMC
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
c
d
e
f
g
j
l
m
r
t
w
Functions
a
c
d
f
g
r
t
w
Typedefs
Enumerations
Classes
Class List
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
g
i
k
l
m
o
p
r
s
t
u
v
w
Enumerator
a
b
c
d
e
f
h
i
k
l
m
n
o
p
q
r
s
t
u
v
Related Symbols
b
c
d
e
g
i
j
m
n
o
s
t
u
v
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
i
l
m
n
o
p
r
s
t
u
w
y
Typedefs
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
Enumerations
_
a
b
c
d
f
g
i
l
m
p
r
s
t
u
v
w
Enumerator
_
a
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
Macros
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
y
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
synthesizer_utils.cpp
Go to the documentation of this file.
1
/*******************************************************************\
2
3
Module: Utility functions for loop invariant synthesizer.
4
5
Author: Qinheping Hu
6
7
\*******************************************************************/
8
9
#include "
synthesizer_utils.h
"
10
11
invariant_mapt
combine_in_and_post_invariant_clauses
(
12
const
invariant_mapt
&
in_clauses
,
13
const
invariant_mapt
&
post_clauses
,
14
const
invariant_mapt
&neg_guards)
15
{
16
// Combine invariant
17
// (in_inv || !guard) && (!guard -> pos_inv) for loops with loop guard
18
// in_inv && pos_inv for loops without loop guard
19
invariant_mapt
result;
20
for
(
const
auto
&
in_clause
:
in_clauses
)
21
{
22
const
auto
&
id
=
in_clause
.first;
23
const
auto
&
it_guard
= neg_guards.find(
id
);
24
25
// Unconditional loop or failed to get loop guard.
26
if
(
it_guard
== neg_guards.end())
27
{
28
result[id] =
and_exprt
(
in_clause
.second,
post_clauses
.at(
id
));
29
}
30
// Loops with loop guard.
31
else
32
{
33
result[id] =
and_exprt
(
34
or_exprt
(
it_guard
->second,
in_clause
.second),
35
implies_exprt
(
it_guard
->second,
post_clauses
.at(
id
)));
36
}
37
}
38
return
result;
39
}
11
invariant_mapt
combine_in_and_post_invariant_clauses
( {
…
}
ait
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition
ai.h:562
and_exprt
Boolean AND.
Definition
std_expr.h:2125
implies_exprt
Boolean implication.
Definition
std_expr.h:2225
or_exprt
Boolean OR.
Definition
std_expr.h:2270
combine_in_and_post_invariant_clauses
invariant_mapt combine_in_and_post_invariant_clauses(const invariant_mapt &in_clauses, const invariant_mapt &post_clauses, const invariant_mapt &neg_guards)
Combine invariant of form (in_inv || !guard) && (!guard -> pos_inv)
Definition
synthesizer_utils.cpp:11
synthesizer_utils.h
invariant_mapt
std::map< loop_idt, exprt > invariant_mapt
Definition
utils.h:32
src
goto-synthesizer
synthesizer_utils.cpp
Generated by
1.9.8