-
Notifications
You must be signed in to change notification settings - Fork 2
/
test.c
326 lines (300 loc) · 6.74 KB
/
test.c
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
// ---------------------------------------------
// C file generated from test.pvs
// ---------------------------------------------
// Make sure to link GC.c and GMP in compilation:
// gcc -o test test.c GC.c -lgmp
// ./test
// ---------------------------------------------
#include<stdio.h>
#include<gmp.h>
#include "GC.h"
#include "test.h"
#define TRUE 1
#define FALSE 0
int main(void) {
GC_start();
printf("Executing test ...\n");
// Insert code here
GC_quit();
return 0;
}
void pvs_adda47(mpz_t result, mpz_t i) {
mpz_t c;
mpz_init( c );
mpz_set_si(c, (long) 3);
mpz_set(result, c);
mpz_clear(c);
mpz_clear(i);
}
void pvs_adda_d48(mpz_t result, mpz_t i) {
mpz_t c;
mpz_init( c );
mpz_set_si(c, (long) 3);
mpz_set(result, c);
mpz_clear(c);
mpz_clear(i);
}
void pvs_f49(mpz_t result, int a, int b) {
mpz_set_si(result, (long) (a + b));
}
void pvs_f_d50(mpz_t result, int a, int b) {
mpz_set_si(result, (long) (a + b));
}
void pvs_incr51(mpz_t result, mpz_t x) {
mpz_t a;
mpz_init( a );
mpz_set(a, x);
mpz_add_ui( result , a , (unsigned long int) 1 );
mpz_clear(x);
mpz_clear(a);
}
void pvs_incr_d52(mpz_t result, mpz_t x) {
mpz_t a;
mpz_init( a );
mpz_set(a, x);
mpz_add_ui( result , a , (unsigned long int) 1 );
mpz_clear(x);
mpz_clear(a);
}
void pvs_norm53(mpz_t result, mpz_t x, mpz_t y) {
mpz_t aux55;
mpz_init( aux55 );
mpz_mul( aux55 , x , x );
mpz_t aux56;
mpz_init( aux56 );
mpz_mul( aux56 , y , y );
mpz_add( result , aux55 , aux56 );
mpz_clear(x);
mpz_clear(y);
mpz_clear(aux55);
mpz_clear(aux56);
}
void pvs_norm_d54(mpz_t result, mpz_t x, mpz_t y) {
mpz_t aux57;
mpz_init( aux57 );
mpz_mul( aux57 , x , x );
mpz_t aux58;
mpz_init( aux58 );
mpz_mul( aux58 , y , y );
mpz_add( result , aux57 , aux58 );
mpz_clear(x);
mpz_clear(y);
mpz_clear(aux57);
mpz_clear(aux58);
}
void pvs_g59(mpz_t result, int a) {
pvs_f_d50( result , a , a );
}
void pvs_g_d60(mpz_t result, int a) {
pvs_f_d50( result , a , a );
}
int pvs_b61() {
return 1;
}
int pvs_b_d62() {
return 1;
}
int pvs_bar63(mpz_t n) {
mpz_t aux65;
mpz_init( aux65 );
mpz_add_ui( aux65 , n , (unsigned long int) 3 );
mpz_t conv66;
mpz_init( conv66 );
mpz_set_si(conv66, (long) 6);
mpz_t conv67;
mpz_init( conv67 );
mpz_set_si(conv67, (long) 12);
int if70;
if (((mpz_cmp(aux65, conv66) > 0) && (mpz_cmp(n, conv67) < 0))) {
mpz_t conv68;
mpz_init( conv68 );
mpz_set_si(conv68, (long) 6);
if70 = (mpz_cmp(n, conv68) == 0);
mpz_clear(conv68);
} else {
mpz_t conv69;
mpz_init( conv69 );
mpz_set_si(conv69, (long) 5);
if70 = (mpz_cmp(n, conv69) < 0);
mpz_clear(conv69);
}
mpz_clear(aux65);
mpz_clear(conv66);
mpz_clear(conv67);
mpz_clear(n);
return if70;
}
int pvs_bar_d64(mpz_t n) {
mpz_t aux71;
mpz_init( aux71 );
mpz_add_ui( aux71 , n , (unsigned long int) 3 );
mpz_t conv72;
mpz_init( conv72 );
mpz_set_si(conv72, (long) 6);
mpz_t conv73;
mpz_init( conv73 );
mpz_set_si(conv73, (long) 12);
int if76;
if (((mpz_cmp(aux71, conv72) > 0) && (mpz_cmp(n, conv73) < 0))) {
mpz_t conv74;
mpz_init( conv74 );
mpz_set_si(conv74, (long) 6);
if76 = (mpz_cmp(n, conv74) == 0);
mpz_clear(conv74);
} else {
mpz_t conv75;
mpz_init( conv75 );
mpz_set_si(conv75, (long) 5);
if76 = (mpz_cmp(n, conv75) < 0);
mpz_clear(conv75);
}
mpz_clear(aux71);
mpz_clear(conv72);
mpz_clear(conv73);
mpz_clear(n);
return if76;
}
void pvs_foo77(mpz_t result, mpz_t x) {
mpz_t conv79;
mpz_init( conv79 );
mpz_set_si(conv79, (long) 0);
mpz_t if80;
mpz_init( if80 );
if ((mpz_cmp(x, conv79) == 0)) {
mpz_set_si(if80, (long) 1);
} else {
mpz_add_ui( if80 , x , (unsigned long int) 3 );
}
mpz_clear(conv79);
mpz_add_ui( result , if80 , (unsigned long int) 1 );
mpz_clear(x);
mpz_clear(if80);
}
void pvs_foo_d78(mpz_t result, mpz_t x) {
mpz_t conv81;
mpz_init( conv81 );
mpz_set_si(conv81, (long) 0);
mpz_t if82;
mpz_init( if82 );
if ((mpz_cmp(x, conv81) == 0)) {
mpz_set_si(if82, (long) 1);
} else {
mpz_add_ui( if82 , x , (unsigned long int) 3 );
}
mpz_clear(conv81);
mpz_add_ui( result , if82 , (unsigned long int) 1 );
mpz_clear(x);
mpz_clear(if82);
}
void pvs_add283(mpz_t result, mpz_t a) {
mpz_t conv85;
mpz_init( conv85 );
mpz_set_si(conv85, (long) 1);
mpz_t if86;
mpz_init( if86 );
if ((mpz_cmp(a, conv85) == 0)) {
mpz_set_si(if86, (long) 1);
} else {
mpz_set_si(if86, (long) 0);
}
mpz_clear(conv85);
mpz_t c;
mpz_init( c );
mpz_add( c , a , if86 );
mpz_t d;
mpz_init( d );
mpz_set_si(d, (long) 2);
mpz_t aux87;
mpz_init( aux87 );
mpz_add( aux87 , c , d );
mpz_add_ui( result , aux87 , (unsigned long int) 1 );
mpz_clear(a);
mpz_clear(aux87);
mpz_clear(if86);
mpz_clear(c);
mpz_clear(d);
}
void pvs_add2_d84(mpz_t result, mpz_t a) {
mpz_t conv88;
mpz_init( conv88 );
mpz_set_si(conv88, (long) 1);
mpz_t if89;
mpz_init( if89 );
if ((mpz_cmp(a, conv88) == 0)) {
mpz_set_si(if89, (long) 1);
} else {
mpz_set_si(if89, (long) 0);
}
mpz_clear(conv88);
mpz_t c;
mpz_init( c );
mpz_add( c , a , if89 );
mpz_t d;
mpz_init( d );
mpz_set_si(d, (long) 2);
mpz_t aux90;
mpz_init( aux90 );
mpz_add( aux90 , c , d );
mpz_add_ui( result , aux90 , (unsigned long int) 1 );
mpz_clear(a);
mpz_clear(aux90);
mpz_clear(if89);
mpz_clear(c);
mpz_clear(d);
}
void pvs_f91(mpz_t result, mpz_t x) {
mpz_t y;
mpz_init( y );
mpz_set_si(y, (long) 12);
mpz_add_ui( result , y , (unsigned long int) 2 );
mpz_clear(x);
mpz_clear(y);
}
void pvs_f_d92(mpz_t result, mpz_t x) {
mpz_t y;
mpz_init( y );
mpz_set_si(y, (long) 12);
mpz_add_ui( result , y , (unsigned long int) 2 );
mpz_clear(x);
mpz_clear(y);
}
void pvs_factorial93(mpz_t result, mpz_t n) {
mpz_t conv95;
mpz_init( conv95 );
mpz_set_si(conv95, (long) 0);
if ((mpz_cmp(n, conv95) == 0)) {
mpz_set_si(result, (long) 1);
} else {
mpz_t aux96;
mpz_init( aux96 );
mpz_sub_ui( aux96 , n , (unsigned long int) 1 );
mpz_t aux97;
mpz_init( aux97 );
pvs_factorial_d94( aux97 , aux96 );
mpz_clear(aux96);
mpz_mul( result , n , aux97 );
mpz_clear(aux97);
}
mpz_clear(n);
mpz_clear(conv95);
}
void pvs_factorial_d94(mpz_t result, mpz_t n) {
mpz_t conv98;
mpz_init( conv98 );
mpz_set_si(conv98, (long) 0);
if ((mpz_cmp(n, conv98) == 0)) {
mpz_set_si(result, (long) 1);
} else {
mpz_t aux99;
mpz_init( aux99 );
mpz_sub_ui( aux99 , n , (unsigned long int) 1 );
mpz_t aux100;
mpz_init( aux100 );
pvs_factorial_d94( aux100 , aux99 );
mpz_clear(aux99);
mpz_mul( result , n , aux100 );
mpz_clear(aux100);
}
mpz_clear(n);
mpz_clear(conv98);
}