Newer
Older

Julien Signoles
committed
/* Generated by Frama-C */

Julien Signoles
committed
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
/*@ requires n > 0; */
int __gen_e_acsl_fact(int n);
/*@ requires n > 0; */
int fact(int n)
{
int __retres;
int tmp;
if (n == 1) {
__retres = 1;
goto return_label;
}
{ /* sequence */
tmp = __gen_e_acsl_fact(n - 1);
;
}
__retres = n * tmp;
return_label: return __retres;
}
int main(void)
{
int __retres;
int x;
x = __gen_e_acsl_fact(5);
/*@ assert x ≡ 120; */
__e_acsl_assert(x == 120,(char *)"Assertion",(char *)"main",
(char *)"x == 120",13);
__retres = 0;
return __retres;
}
/*@ requires n > 0; */
int __gen_e_acsl_fact(int n)
{
int __retres;
__e_acsl_assert(n > 0,(char *)"Precondition",(char *)"fact",
(char *)"n > 0",5);
__retres = fact(n);
return __retres;
}