1
|
/* C code generated by main_lustre_compiler.native
|
2
|
SVN version number 355
|
3
|
Code is C99 compliant */
|
4
|
|
5
|
#ifndef _ALT_2_LUSTREC
|
6
|
#define _ALT_2_LUSTREC
|
7
|
|
8
|
/* Imports standard library */
|
9
|
#include "/home/davyg/local_proofcompilation//include/lustrec/arrow.h"
|
10
|
|
11
|
|
12
|
/* Types definitions */
|
13
|
|
14
|
/*@ lemma missing: \forall _Bool x; (x != 0) <==> (((int) x) != 0);*/
|
15
|
/* Global constant (declarations, definitions are in C file) */
|
16
|
|
17
|
/* Struct declarations */
|
18
|
struct integrator_reset_mem {struct integrator_reset_reg {double __integrator_reset_2;} _reg; struct _arrow_mem ni_4; };
|
19
|
struct VariableRateLimit_mem {struct VariableRateLimit_reg {double __VariableRateLimit_3;} _reg; struct _arrow_mem ni_3; struct integrator_reset_mem ni_2; };
|
20
|
struct AltitudeControl_mem {struct AltitudeControl_reg {int dummy;} _reg; struct VariableRateLimit_mem ni_1; };
|
21
|
struct top_mem {struct top_reg {int dummy;} _reg; struct AltitudeControl_mem ni_0; };
|
22
|
|
23
|
/* Nodes declarations */
|
24
|
/*@ predicate trans_VariableLimitSaturation(real up_lim,
|
25
|
real Signal,
|
26
|
real lo_lim,
|
27
|
real out,
|
28
|
integer __VariableLimitSaturation_1,
|
29
|
integer __VariableLimitSaturation_2,
|
30
|
real enforce_lo_lim) =
|
31
|
|
32
|
(__VariableLimitSaturation_1 == (Signal >= lo_lim)) &&
|
33
|
(enforce_lo_lim == (__VariableLimitSaturation_1?(Signal):(lo_lim))) &&
|
34
|
(__VariableLimitSaturation_2 == (enforce_lo_lim <= up_lim)) &&
|
35
|
(out == (__VariableLimitSaturation_2?(enforce_lo_lim):(up_lim)));
|
36
|
*/
|
37
|
/*@ predicate Ctrans_VariableLimitSaturation(real up_lim,
|
38
|
real Signal,
|
39
|
real lo_lim,
|
40
|
real out) =
|
41
|
\exists integer __VariableLimitSaturation_1;
|
42
|
\exists integer __VariableLimitSaturation_2;
|
43
|
\exists real enforce_lo_lim;
|
44
|
trans_VariableLimitSaturation(up_lim,
|
45
|
Signal,
|
46
|
lo_lim,
|
47
|
out,
|
48
|
__VariableLimitSaturation_1,
|
49
|
__VariableLimitSaturation_2,
|
50
|
enforce_lo_lim);
|
51
|
*/
|
52
|
/*@ requires \valid(out);
|
53
|
ensures Ctrans_VariableLimitSaturation(up_lim,
|
54
|
Signal,
|
55
|
lo_lim,
|
56
|
*out);
|
57
|
assigns *out;
|
58
|
*/
|
59
|
extern void VariableLimitSaturation_step (double up_lim, double Signal,
|
60
|
double lo_lim,
|
61
|
double (*out)
|
62
|
);
|
63
|
|
64
|
/*@ predicate trans_integrator_reset(real Fx,
|
65
|
integer ResetLevel,
|
66
|
real x0,
|
67
|
real ir_out,
|
68
|
struct integrator_reset_mem self1,
|
69
|
struct integrator_reset_mem self2,
|
70
|
integer __integrator_reset_1) =
|
71
|
|
72
|
(__integrator_reset_1==(self1.ni_4._reg._first?(1):(0))) && (self2.ni_4._reg._first==0) &&
|
73
|
(ir_out == (__integrator_reset_1?(x0):((ResetLevel?(x0):(((Fx * 1.) + self1._reg.__integrator_reset_2)))))) &&
|
74
|
(self2._reg.__integrator_reset_2 == ir_out);
|
75
|
*/
|
76
|
/*@ predicate Ctrans_integrator_reset(real Fx,
|
77
|
integer ResetLevel,
|
78
|
real x0,
|
79
|
real ir_out,
|
80
|
struct integrator_reset_mem self1,
|
81
|
struct integrator_reset_mem self2) =
|
82
|
\exists integer __integrator_reset_1;
|
83
|
trans_integrator_reset(Fx,
|
84
|
ResetLevel,
|
85
|
x0,
|
86
|
ir_out,
|
87
|
self1,
|
88
|
self2,
|
89
|
__integrator_reset_1);
|
90
|
*/
|
91
|
/*@ predicate init_integrator_reset(struct integrator_reset_mem self) =
|
92
|
|
93
|
(self.ni_4._reg._first==1);
|
94
|
*/
|
95
|
#define integrator_reset_DECLARE(attr, inst)\
|
96
|
attr struct integrator_reset_mem inst;\
|
97
|
_arrow_DECLARE(attr, inst ## _ni_4);
|
98
|
|
99
|
|
100
|
#define integrator_reset_ALLOC(attr,inst)\
|
101
|
integrator_reset_DECLARE(attr,inst);
|
102
|
|
103
|
|
104
|
/*@requires \valid(self);
|
105
|
ensures init_integrator_reset(\at(*self, Here));
|
106
|
assigns *self;*/
|
107
|
extern void integrator_reset_reset (struct integrator_reset_mem *self);
|
108
|
|
109
|
/*@ requires \valid(ir_out);
|
110
|
requires \valid(self);
|
111
|
requires \separated(ir_out, self);
|
112
|
ensures Ctrans_integrator_reset(Fx,
|
113
|
ResetLevel,
|
114
|
x0,
|
115
|
*ir_out,
|
116
|
\at(*self, Pre),
|
117
|
(*self));
|
118
|
assigns *ir_out, *self;
|
119
|
*/
|
120
|
extern void integrator_reset_step (double Fx, _Bool ResetLevel, double x0,
|
121
|
double (*ir_out),
|
122
|
struct integrator_reset_mem *self);
|
123
|
|
124
|
/*@ predicate trans_Saturation(real Signal,
|
125
|
real s_out,
|
126
|
integer __Saturation_1,
|
127
|
integer __Saturation_2,
|
128
|
real enforce_lo_lim) =
|
129
|
|
130
|
(__Saturation_1 == (0.0001 >= Signal)) &&
|
131
|
(enforce_lo_lim == (__Saturation_1?(0.0001):(Signal))) &&
|
132
|
(__Saturation_2 == (1000. <= enforce_lo_lim)) &&
|
133
|
(s_out == (__Saturation_2?(1000.):(enforce_lo_lim)));
|
134
|
*/
|
135
|
/*@ predicate Ctrans_Saturation(real Signal,
|
136
|
real s_out) =
|
137
|
\exists integer __Saturation_1;
|
138
|
\exists integer __Saturation_2;
|
139
|
\exists real enforce_lo_lim;
|
140
|
trans_Saturation(Signal,
|
141
|
s_out,
|
142
|
__Saturation_1,
|
143
|
__Saturation_2,
|
144
|
enforce_lo_lim);
|
145
|
*/
|
146
|
/*@ requires \valid(s_out);
|
147
|
ensures Ctrans_Saturation(Signal,
|
148
|
*s_out);
|
149
|
assigns *s_out;
|
150
|
*/
|
151
|
extern void Saturation_step (double Signal,
|
152
|
double (*s_out)
|
153
|
);
|
154
|
|
155
|
/*@ predicate trans_VariableRateLimit(real ratelim_Out1_334,
|
156
|
real input_Out1_344,
|
157
|
integer ICtrig_Out1_354,
|
158
|
real IC_Out1_364,
|
159
|
real output_In1_489,
|
160
|
struct VariableRateLimit_mem self1,
|
161
|
struct VariableRateLimit_mem self2,
|
162
|
real Gain1_Out1_382,
|
163
|
real Gain_Out1_373,
|
164
|
real Integrator1_Out1_391,
|
165
|
real Sum2_Out1_401,
|
166
|
real Variable_Limit_Saturation_Out1_410,
|
167
|
integer __VariableRateLimit_1,
|
168
|
real __VariableRateLimit_2) =
|
169
|
|
170
|
(__VariableRateLimit_1==(self1.ni_3._reg._first?(1):(0))) && (self2.ni_3._reg._first==0) &&
|
171
|
(Integrator1_Out1_391 == (__VariableRateLimit_1?(IC_Out1_364):(self1._reg.__VariableRateLimit_3))) &&
|
172
|
(output_In1_489 == Integrator1_Out1_391) &&
|
173
|
(Gain1_Out1_382 == (- ratelim_Out1_334)) &&
|
174
|
(Sum2_Out1_401 == (input_Out1_344 + (- Integrator1_Out1_391))) &&
|
175
|
(Gain_Out1_373 == (20. * Sum2_Out1_401)) &&
|
176
|
Ctrans_VariableLimitSaturation((double) ratelim_Out1_334,
|
177
|
(double) Gain_Out1_373,
|
178
|
(double) Gain1_Out1_382,
|
179
|
Variable_Limit_Saturation_Out1_410) &&
|
180
|
Ctrans_integrator_reset((double) Variable_Limit_Saturation_Out1_410,
|
181
|
ICtrig_Out1_354,
|
182
|
(double) IC_Out1_364,
|
183
|
__VariableRateLimit_2,
|
184
|
self1.ni_2,
|
185
|
self2.ni_2) &&
|
186
|
(self2._reg.__VariableRateLimit_3 == __VariableRateLimit_2);
|
187
|
*/
|
188
|
/*@ predicate Ctrans_VariableRateLimit(real ratelim_Out1_334,
|
189
|
real input_Out1_344,
|
190
|
integer ICtrig_Out1_354,
|
191
|
real IC_Out1_364,
|
192
|
real output_In1_489,
|
193
|
struct VariableRateLimit_mem self1,
|
194
|
struct VariableRateLimit_mem self2) =
|
195
|
\exists real Gain1_Out1_382;
|
196
|
\exists real Gain_Out1_373;
|
197
|
\exists real Integrator1_Out1_391;
|
198
|
\exists real Sum2_Out1_401;
|
199
|
\exists real Variable_Limit_Saturation_Out1_410;
|
200
|
\exists integer __VariableRateLimit_1;
|
201
|
\exists real __VariableRateLimit_2;
|
202
|
trans_VariableRateLimit(ratelim_Out1_334,
|
203
|
input_Out1_344,
|
204
|
ICtrig_Out1_354,
|
205
|
IC_Out1_364,
|
206
|
output_In1_489,
|
207
|
self1,
|
208
|
self2,
|
209
|
Gain1_Out1_382,
|
210
|
Gain_Out1_373,
|
211
|
Integrator1_Out1_391,
|
212
|
Sum2_Out1_401,
|
213
|
Variable_Limit_Saturation_Out1_410,
|
214
|
__VariableRateLimit_1,
|
215
|
__VariableRateLimit_2);
|
216
|
*/
|
217
|
/*@ predicate init_VariableRateLimit(struct VariableRateLimit_mem self) =
|
218
|
|
219
|
(self.ni_3._reg._first==1) &&
|
220
|
init_integrator_reset(self.ni_2);
|
221
|
*/
|
222
|
#define VariableRateLimit_DECLARE(attr, inst)\
|
223
|
attr struct VariableRateLimit_mem inst;\
|
224
|
_arrow_DECLARE(attr, inst ## _ni_3);\
|
225
|
integrator_reset_DECLARE(attr, inst ## _ni_2);
|
226
|
|
227
|
|
228
|
#define VariableRateLimit_ALLOC(attr,inst)\
|
229
|
VariableRateLimit_DECLARE(attr,inst);
|
230
|
|
231
|
|
232
|
/*@requires \valid(self);
|
233
|
ensures init_VariableRateLimit(\at(*self, Here));
|
234
|
assigns *self;*/
|
235
|
extern void VariableRateLimit_reset (struct VariableRateLimit_mem *self);
|
236
|
|
237
|
/*@ requires \valid(output_In1_489);
|
238
|
requires \valid(self);
|
239
|
requires \separated(output_In1_489, self);
|
240
|
ensures Ctrans_VariableRateLimit(ratelim_Out1_334,
|
241
|
input_Out1_344,
|
242
|
ICtrig_Out1_354,
|
243
|
IC_Out1_364,
|
244
|
*output_In1_489,
|
245
|
\at(*self, Pre),
|
246
|
(*self));
|
247
|
assigns *output_In1_489, *self;
|
248
|
*/
|
249
|
extern void VariableRateLimit_step (double ratelim_Out1_334,
|
250
|
double input_Out1_344,
|
251
|
_Bool ICtrig_Out1_354,
|
252
|
double IC_Out1_364,
|
253
|
double (*output_In1_489),
|
254
|
struct VariableRateLimit_mem *self);
|
255
|
|
256
|
/*@ predicate spec_85(real AntEng_Out1_19, real AltCmd_Out1_29, real Alt_Out1_39, real GsKts_Out1_49, real hdot_Out1_59, real hdotChgRate_Out1_69, real altgammacmd_In1_661, struct AltitudeControl_mem self) =
|
257
|
(AntEng_Out1_19 == 0.);
|
258
|
*/
|
259
|
/*@ predicate spec_90(real AntEng_Out1_19, real AltCmd_Out1_29, real Alt_Out1_39, real GsKts_Out1_49, real hdot_Out1_59, real hdotChgRate_Out1_69, real altgammacmd_In1_661, struct AltitudeControl_mem self) =
|
260
|
(altgammacmd_In1_661 == 0.);
|
261
|
*/
|
262
|
/*@ predicate trans_AltitudeControl(real AntEng_Out1_19,
|
263
|
real AltCmd_Out1_29,
|
264
|
real Alt_Out1_39,
|
265
|
real GsKts_Out1_49,
|
266
|
real hdot_Out1_59,
|
267
|
real hdotChgRate_Out1_69,
|
268
|
real altgammacmd_In1_661,
|
269
|
struct AltitudeControl_mem self1,
|
270
|
struct AltitudeControl_mem self2,
|
271
|
real Abs_Out1_144,
|
272
|
real Kh_Out1_193,
|
273
|
integer Logical_Operator_In1_197,
|
274
|
integer Logical_Operator_Out1_198,
|
275
|
real Saturation1_Out1_213,
|
276
|
real Sum3_Out1_296,
|
277
|
real Sum_Out1_286,
|
278
|
integer Switch1_In2_312,
|
279
|
real Switch1_Out1_314,
|
280
|
integer Switch_In2_303,
|
281
|
real Switch_Out1_305,
|
282
|
real Variable_Limit_Saturation_0_Out1_509,
|
283
|
real Variable__Rate_Limit_Out1_324,
|
284
|
integer __AltitudeControl_1,
|
285
|
integer __AltitudeControl_2,
|
286
|
real k_Out1_585,
|
287
|
real kts2fps_Out1_594,
|
288
|
real r2d_Out1_603) =
|
289
|
|
290
|
(__AltitudeControl_1 == (hdot_Out1_59 < 0.)) &&
|
291
|
(Abs_Out1_144 == (__AltitudeControl_1?((- hdot_Out1_59)):(hdot_Out1_59))) &&
|
292
|
(Sum3_Out1_296 == (Abs_Out1_144 + 10.)) &&
|
293
|
(k_Out1_585 == (- Sum3_Out1_296)) &&
|
294
|
(__AltitudeControl_2 == (AntEng_Out1_19 == 0.)) &&
|
295
|
((!Logical_Operator_In1_197) == (!(__AltitudeControl_2?(0):(1)))) &&
|
296
|
((!Logical_Operator_Out1_198) == (!(!Logical_Operator_In1_197))) &&
|
297
|
((!Switch_In2_303) == (!(__AltitudeControl_2?(0):(1)))) &&
|
298
|
(Sum_Out1_286 == (AltCmd_Out1_29 + (- Alt_Out1_39))) &&
|
299
|
(Kh_Out1_193 == (0.08 * Sum_Out1_286)) &&
|
300
|
(Switch_Out1_305 == (Switch_In2_303?(Kh_Out1_193):(0.))) &&
|
301
|
Ctrans_VariableLimitSaturation((double) Sum3_Out1_296,
|
302
|
(double) Switch_Out1_305,
|
303
|
(double) k_Out1_585,
|
304
|
Variable_Limit_Saturation_0_Out1_509) &&
|
305
|
Ctrans_VariableRateLimit((double) hdotChgRate_Out1_69,
|
306
|
(double) Variable_Limit_Saturation_0_Out1_509,
|
307
|
(_Bool) ((Logical_Operator_Out1_198)?1:0),
|
308
|
(double) hdot_Out1_59,
|
309
|
Variable__Rate_Limit_Out1_324,
|
310
|
self1.ni_1,
|
311
|
self2.ni_1) &&
|
312
|
(r2d_Out1_603 == (57.2958 * Variable__Rate_Limit_Out1_324)) &&
|
313
|
(kts2fps_Out1_594 == (1.6878 * GsKts_Out1_49)) &&
|
314
|
((!Switch1_In2_312) == (!(__AltitudeControl_2?(0):(1)))) &&
|
315
|
(Switch1_Out1_314 == (Switch1_In2_312?(r2d_Out1_603):(0.))) &&
|
316
|
(altgammacmd_In1_661 == Switch1_Out1_314) &&
|
317
|
Ctrans_Saturation((double) kts2fps_Out1_594,
|
318
|
Saturation1_Out1_213);
|
319
|
*/
|
320
|
/*@ predicate Ctrans_AltitudeControl(real AntEng_Out1_19,
|
321
|
real AltCmd_Out1_29,
|
322
|
real Alt_Out1_39,
|
323
|
real GsKts_Out1_49,
|
324
|
real hdot_Out1_59,
|
325
|
real hdotChgRate_Out1_69,
|
326
|
real altgammacmd_In1_661,
|
327
|
struct AltitudeControl_mem self1,
|
328
|
struct AltitudeControl_mem self2) =
|
329
|
\exists real Abs_Out1_144;
|
330
|
\exists real Kh_Out1_193;
|
331
|
\exists integer Logical_Operator_In1_197;
|
332
|
\exists integer Logical_Operator_Out1_198;
|
333
|
\exists real Saturation1_Out1_213;
|
334
|
\exists real Sum3_Out1_296;
|
335
|
\exists real Sum_Out1_286;
|
336
|
\exists integer Switch1_In2_312;
|
337
|
\exists real Switch1_Out1_314;
|
338
|
\exists integer Switch_In2_303;
|
339
|
\exists real Switch_Out1_305;
|
340
|
\exists real Variable_Limit_Saturation_0_Out1_509;
|
341
|
\exists real Variable__Rate_Limit_Out1_324;
|
342
|
\exists integer __AltitudeControl_1;
|
343
|
\exists integer __AltitudeControl_2;
|
344
|
\exists real k_Out1_585;
|
345
|
\exists real kts2fps_Out1_594;
|
346
|
\exists real r2d_Out1_603;
|
347
|
trans_AltitudeControl(AntEng_Out1_19,
|
348
|
AltCmd_Out1_29,
|
349
|
Alt_Out1_39,
|
350
|
GsKts_Out1_49,
|
351
|
hdot_Out1_59,
|
352
|
hdotChgRate_Out1_69,
|
353
|
altgammacmd_In1_661,
|
354
|
self1,
|
355
|
self2,
|
356
|
Abs_Out1_144,
|
357
|
Kh_Out1_193,
|
358
|
Logical_Operator_In1_197,
|
359
|
Logical_Operator_Out1_198,
|
360
|
Saturation1_Out1_213,
|
361
|
Sum3_Out1_296,
|
362
|
Sum_Out1_286,
|
363
|
Switch1_In2_312,
|
364
|
Switch1_Out1_314,
|
365
|
Switch_In2_303,
|
366
|
Switch_Out1_305,
|
367
|
Variable_Limit_Saturation_0_Out1_509,
|
368
|
Variable__Rate_Limit_Out1_324,
|
369
|
__AltitudeControl_1,
|
370
|
__AltitudeControl_2,
|
371
|
k_Out1_585,
|
372
|
kts2fps_Out1_594,
|
373
|
r2d_Out1_603);
|
374
|
*/
|
375
|
/*@ predicate init_AltitudeControl(struct AltitudeControl_mem self) =
|
376
|
|
377
|
init_VariableRateLimit(self.ni_1);
|
378
|
*/
|
379
|
/*@ predicate inv_AltitudeControl(struct AltitudeControl_mem self3) =
|
380
|
(init_AltitudeControl(self3))||
|
381
|
(\exists struct AltitudeControl_mem self2, real AntEng_Out1_193, real AltCmd_Out1_293, real Alt_Out1_393, real GsKts_Out1_493, real hdot_Out1_593, real hdotChgRate_Out1_693, real altgammacmd_In1_6613;
|
382
|
Ctrans_AltitudeControl(AntEng_Out1_193,
|
383
|
AltCmd_Out1_293,
|
384
|
Alt_Out1_393,
|
385
|
GsKts_Out1_493,
|
386
|
hdot_Out1_593,
|
387
|
hdotChgRate_Out1_693,
|
388
|
altgammacmd_In1_6613,
|
389
|
self2,
|
390
|
self3)&&
|
391
|
(spec_85(AntEng_Out1_193, AltCmd_Out1_293, Alt_Out1_393, GsKts_Out1_493, hdot_Out1_593, hdotChgRate_Out1_693, altgammacmd_In1_6613, self2))&&
|
392
|
init_AltitudeControl(self2))||
|
393
|
(\exists struct AltitudeControl_mem self2, struct AltitudeControl_mem self1, real AntEng_Out1_193, real AntEng_Out1_192, real AltCmd_Out1_293, real AltCmd_Out1_292, real Alt_Out1_393, real Alt_Out1_392, real GsKts_Out1_493, real GsKts_Out1_492, real hdot_Out1_593, real hdot_Out1_592, real hdotChgRate_Out1_693, real hdotChgRate_Out1_692, real altgammacmd_In1_6613, real altgammacmd_In1_6612;
|
394
|
Ctrans_AltitudeControl(AntEng_Out1_193,
|
395
|
AltCmd_Out1_293,
|
396
|
Alt_Out1_393,
|
397
|
GsKts_Out1_493,
|
398
|
hdot_Out1_593,
|
399
|
hdotChgRate_Out1_693,
|
400
|
altgammacmd_In1_6613,
|
401
|
self2,
|
402
|
self3)&&
|
403
|
Ctrans_AltitudeControl(AntEng_Out1_192,
|
404
|
AltCmd_Out1_292,
|
405
|
Alt_Out1_392,
|
406
|
GsKts_Out1_492,
|
407
|
hdot_Out1_592,
|
408
|
hdotChgRate_Out1_692,
|
409
|
altgammacmd_In1_6612,
|
410
|
self1,
|
411
|
self2)&&
|
412
|
(spec_85(AntEng_Out1_193, AltCmd_Out1_293, Alt_Out1_393, GsKts_Out1_493, hdot_Out1_593, hdotChgRate_Out1_693, altgammacmd_In1_6613, self2))&&
|
413
|
(spec_85(AntEng_Out1_192, AltCmd_Out1_292, Alt_Out1_392, GsKts_Out1_492, hdot_Out1_592, hdotChgRate_Out1_692, altgammacmd_In1_6612, self1))&&
|
414
|
init_AltitudeControl(self1))||
|
415
|
(\exists struct AltitudeControl_mem self2, struct AltitudeControl_mem self1, struct AltitudeControl_mem self0, real AntEng_Out1_193, real AntEng_Out1_192, real AntEng_Out1_191, real AltCmd_Out1_293, real AltCmd_Out1_292, real AltCmd_Out1_291, real Alt_Out1_393, real Alt_Out1_392, real Alt_Out1_391, real GsKts_Out1_493, real GsKts_Out1_492, real GsKts_Out1_491, real hdot_Out1_593, real hdot_Out1_592, real hdot_Out1_591, real hdotChgRate_Out1_693, real hdotChgRate_Out1_692, real hdotChgRate_Out1_691, real altgammacmd_In1_6613, real altgammacmd_In1_6612, real altgammacmd_In1_6611;
|
416
|
Ctrans_AltitudeControl(AntEng_Out1_193,
|
417
|
AltCmd_Out1_293,
|
418
|
Alt_Out1_393,
|
419
|
GsKts_Out1_493,
|
420
|
hdot_Out1_593,
|
421
|
hdotChgRate_Out1_693,
|
422
|
altgammacmd_In1_6613,
|
423
|
self2,
|
424
|
self3)&&
|
425
|
Ctrans_AltitudeControl(AntEng_Out1_192,
|
426
|
AltCmd_Out1_292,
|
427
|
Alt_Out1_392,
|
428
|
GsKts_Out1_492,
|
429
|
hdot_Out1_592,
|
430
|
hdotChgRate_Out1_692,
|
431
|
altgammacmd_In1_6612,
|
432
|
self1,
|
433
|
self2)&&
|
434
|
Ctrans_AltitudeControl(AntEng_Out1_191,
|
435
|
AltCmd_Out1_291,
|
436
|
Alt_Out1_391,
|
437
|
GsKts_Out1_491,
|
438
|
hdot_Out1_591,
|
439
|
hdotChgRate_Out1_691,
|
440
|
altgammacmd_In1_6611,
|
441
|
self0,
|
442
|
self1)&&
|
443
|
(spec_85(AntEng_Out1_193, AltCmd_Out1_293, Alt_Out1_393, GsKts_Out1_493, hdot_Out1_593, hdotChgRate_Out1_693, altgammacmd_In1_6613, self2))&&
|
444
|
(spec_85(AntEng_Out1_192, AltCmd_Out1_292, Alt_Out1_392, GsKts_Out1_492, hdot_Out1_592, hdotChgRate_Out1_692, altgammacmd_In1_6612, self1))&&
|
445
|
(spec_85(AntEng_Out1_191, AltCmd_Out1_291, Alt_Out1_391, GsKts_Out1_491, hdot_Out1_591, hdotChgRate_Out1_691, altgammacmd_In1_6611, self0))&&
|
446
|
(spec_90(AntEng_Out1_193, AltCmd_Out1_293, Alt_Out1_393, GsKts_Out1_493, hdot_Out1_593, hdotChgRate_Out1_693, altgammacmd_In1_6613, self3))&&
|
447
|
(spec_90(AntEng_Out1_192, AltCmd_Out1_292, Alt_Out1_392, GsKts_Out1_492, hdot_Out1_592, hdotChgRate_Out1_692, altgammacmd_In1_6612, self2))&&
|
448
|
(spec_90(AntEng_Out1_191, AltCmd_Out1_291, Alt_Out1_391, GsKts_Out1_491, hdot_Out1_591, hdotChgRate_Out1_691, altgammacmd_In1_6611, self1)));
|
449
|
*/
|
450
|
/*@ lemma inv_init_3_AltitudeControl :
|
451
|
\forall struct AltitudeControl_mem self3, struct AltitudeControl_mem self2, struct AltitudeControl_mem self1, struct AltitudeControl_mem self0, real AntEng_Out1_193, real AntEng_Out1_192, real AntEng_Out1_191, real AltCmd_Out1_293, real AltCmd_Out1_292, real AltCmd_Out1_291, real Alt_Out1_393, real Alt_Out1_392, real Alt_Out1_391, real GsKts_Out1_493, real GsKts_Out1_492, real GsKts_Out1_491, real hdot_Out1_593, real hdot_Out1_592, real hdot_Out1_591, real hdotChgRate_Out1_693, real hdotChgRate_Out1_692, real hdotChgRate_Out1_691, real altgammacmd_In1_6613, real altgammacmd_In1_6612, real altgammacmd_In1_6611;
|
452
|
Ctrans_AltitudeControl(AntEng_Out1_193,
|
453
|
AltCmd_Out1_293,
|
454
|
Alt_Out1_393,
|
455
|
GsKts_Out1_493,
|
456
|
hdot_Out1_593,
|
457
|
hdotChgRate_Out1_693,
|
458
|
altgammacmd_In1_6613,
|
459
|
self2,
|
460
|
self3)==>
|
461
|
Ctrans_AltitudeControl(AntEng_Out1_192,
|
462
|
AltCmd_Out1_292,
|
463
|
Alt_Out1_392,
|
464
|
GsKts_Out1_492,
|
465
|
hdot_Out1_592,
|
466
|
hdotChgRate_Out1_692,
|
467
|
altgammacmd_In1_6612,
|
468
|
self1,
|
469
|
self2)==>
|
470
|
Ctrans_AltitudeControl(AntEng_Out1_191,
|
471
|
AltCmd_Out1_291,
|
472
|
Alt_Out1_391,
|
473
|
GsKts_Out1_491,
|
474
|
hdot_Out1_591,
|
475
|
hdotChgRate_Out1_691,
|
476
|
altgammacmd_In1_6611,
|
477
|
self0,
|
478
|
self1)==>
|
479
|
init_AltitudeControl(self0) ==> spec_85(AntEng_Out1_193, AltCmd_Out1_293, Alt_Out1_393, GsKts_Out1_493, hdot_Out1_593, hdotChgRate_Out1_693, altgammacmd_In1_6613, self2)==>
|
480
|
spec_85(AntEng_Out1_193, AltCmd_Out1_293, Alt_Out1_393, GsKts_Out1_493, hdot_Out1_593, hdotChgRate_Out1_693, altgammacmd_In1_6613, self1)==>
|
481
|
spec_85(AntEng_Out1_193, AltCmd_Out1_293, Alt_Out1_393, GsKts_Out1_493, hdot_Out1_593, hdotChgRate_Out1_693, altgammacmd_In1_6613, self0)==>
|
482
|
(spec_90(AntEng_Out1_193, AltCmd_Out1_293, Alt_Out1_393, GsKts_Out1_493, hdot_Out1_593, hdotChgRate_Out1_693, altgammacmd_In1_6613, self3));
|
483
|
*/
|
484
|
/*@ lemma inv_init_2_AltitudeControl :
|
485
|
\forall struct AltitudeControl_mem self3, struct AltitudeControl_mem self2, struct AltitudeControl_mem self1, real AntEng_Out1_193, real AntEng_Out1_192, real AltCmd_Out1_293, real AltCmd_Out1_292, real Alt_Out1_393, real Alt_Out1_392, real GsKts_Out1_493, real GsKts_Out1_492, real hdot_Out1_593, real hdot_Out1_592, real hdotChgRate_Out1_693, real hdotChgRate_Out1_692, real altgammacmd_In1_6613, real altgammacmd_In1_6612;
|
486
|
Ctrans_AltitudeControl(AntEng_Out1_193,
|
487
|
AltCmd_Out1_293,
|
488
|
Alt_Out1_393,
|
489
|
GsKts_Out1_493,
|
490
|
hdot_Out1_593,
|
491
|
hdotChgRate_Out1_693,
|
492
|
altgammacmd_In1_6613,
|
493
|
self2,
|
494
|
self3)==>
|
495
|
Ctrans_AltitudeControl(AntEng_Out1_192,
|
496
|
AltCmd_Out1_292,
|
497
|
Alt_Out1_392,
|
498
|
GsKts_Out1_492,
|
499
|
hdot_Out1_592,
|
500
|
hdotChgRate_Out1_692,
|
501
|
altgammacmd_In1_6612,
|
502
|
self1,
|
503
|
self2)==>
|
504
|
init_AltitudeControl(self1) ==> spec_85(AntEng_Out1_193, AltCmd_Out1_293, Alt_Out1_393, GsKts_Out1_493, hdot_Out1_593, hdotChgRate_Out1_693, altgammacmd_In1_6613, self2)==>
|
505
|
spec_85(AntEng_Out1_193, AltCmd_Out1_293, Alt_Out1_393, GsKts_Out1_493, hdot_Out1_593, hdotChgRate_Out1_693, altgammacmd_In1_6613, self1)==>
|
506
|
(spec_90(AntEng_Out1_193, AltCmd_Out1_293, Alt_Out1_393, GsKts_Out1_493, hdot_Out1_593, hdotChgRate_Out1_693, altgammacmd_In1_6613, self3));
|
507
|
*/
|
508
|
/*@ lemma inv_init_1_AltitudeControl :
|
509
|
\forall struct AltitudeControl_mem self3, struct AltitudeControl_mem self2, real AntEng_Out1_193, real AltCmd_Out1_293, real Alt_Out1_393, real GsKts_Out1_493, real hdot_Out1_593, real hdotChgRate_Out1_693, real altgammacmd_In1_6613;
|
510
|
Ctrans_AltitudeControl(AntEng_Out1_193,
|
511
|
AltCmd_Out1_293,
|
512
|
Alt_Out1_393,
|
513
|
GsKts_Out1_493,
|
514
|
hdot_Out1_593,
|
515
|
hdotChgRate_Out1_693,
|
516
|
altgammacmd_In1_6613,
|
517
|
self2,
|
518
|
self3)==>
|
519
|
init_AltitudeControl(self2) ==> spec_85(AntEng_Out1_193, AltCmd_Out1_293, Alt_Out1_393, GsKts_Out1_493, hdot_Out1_593, hdotChgRate_Out1_693, altgammacmd_In1_6613, self2)==>
|
520
|
(spec_90(AntEng_Out1_193, AltCmd_Out1_293, Alt_Out1_393, GsKts_Out1_493, hdot_Out1_593, hdotChgRate_Out1_693, altgammacmd_In1_6613, self3));
|
521
|
*/
|
522
|
/*@ lemma inv_spec_AltitudeControl :
|
523
|
\forall struct AltitudeControl_mem self1, self2, real AntEng_Out1_19, real AltCmd_Out1_29, real Alt_Out1_39, real GsKts_Out1_49, real hdot_Out1_59, real hdotChgRate_Out1_69, real altgammacmd_In1_661;
|
524
|
inv_AltitudeControl(self1)==>
|
525
|
Ctrans_AltitudeControl(AntEng_Out1_19,
|
526
|
AltCmd_Out1_29,
|
527
|
Alt_Out1_39,
|
528
|
GsKts_Out1_49,
|
529
|
hdot_Out1_59,
|
530
|
hdotChgRate_Out1_69,
|
531
|
altgammacmd_In1_661,
|
532
|
self1,
|
533
|
self2)==>
|
534
|
spec_85(AntEng_Out1_19, AltCmd_Out1_29, Alt_Out1_39, GsKts_Out1_49, hdot_Out1_59, hdotChgRate_Out1_69, altgammacmd_In1_661, self1)==>
|
535
|
spec_90(AntEng_Out1_19, AltCmd_Out1_29, Alt_Out1_39, GsKts_Out1_49, hdot_Out1_59, hdotChgRate_Out1_69, altgammacmd_In1_661, self2);
|
536
|
*/
|
537
|
/*@ lemma inv_inv_AltitudeControl :
|
538
|
\forall struct AltitudeControl_mem self1, self2, real AntEng_Out1_19, real AltCmd_Out1_29, real Alt_Out1_39, real GsKts_Out1_49, real hdot_Out1_59, real hdotChgRate_Out1_69, real altgammacmd_In1_661;
|
539
|
inv_AltitudeControl(self1)==>
|
540
|
Ctrans_AltitudeControl(AntEng_Out1_19,
|
541
|
AltCmd_Out1_29,
|
542
|
Alt_Out1_39,
|
543
|
GsKts_Out1_49,
|
544
|
hdot_Out1_59,
|
545
|
hdotChgRate_Out1_69,
|
546
|
altgammacmd_In1_661,
|
547
|
self1,
|
548
|
self2)==>
|
549
|
spec_85(AntEng_Out1_19, AltCmd_Out1_29, Alt_Out1_39, GsKts_Out1_49, hdot_Out1_59, hdotChgRate_Out1_69, altgammacmd_In1_661, self1)==>
|
550
|
inv_AltitudeControl(self2);
|
551
|
*/
|
552
|
#define AltitudeControl_DECLARE(attr, inst)\
|
553
|
attr struct AltitudeControl_mem inst;\
|
554
|
VariableRateLimit_DECLARE(attr, inst ## _ni_1);
|
555
|
|
556
|
|
557
|
#define AltitudeControl_ALLOC(attr,inst)\
|
558
|
AltitudeControl_DECLARE(attr,inst);
|
559
|
|
560
|
|
561
|
/*@requires \valid(self);
|
562
|
ensures init_AltitudeControl(\at(*self, Here));
|
563
|
ensures inv_AltitudeControl(*self);
|
564
|
assigns *self;*/
|
565
|
extern void AltitudeControl_reset (struct AltitudeControl_mem *self);
|
566
|
|
567
|
/*@ requires \valid(altgammacmd_In1_661);
|
568
|
requires \valid(self);
|
569
|
requires \separated(altgammacmd_In1_661, self);
|
570
|
requires spec_85(AntEng_Out1_19, AltCmd_Out1_29, Alt_Out1_39, GsKts_Out1_49, hdot_Out1_59, hdotChgRate_Out1_69, *altgammacmd_In1_661, *self);
|
571
|
requires inv_AltitudeControl(*self);
|
572
|
ensures spec_90(AntEng_Out1_19, AltCmd_Out1_29, Alt_Out1_39, GsKts_Out1_49, hdot_Out1_59, hdotChgRate_Out1_69, *altgammacmd_In1_661, *self);
|
573
|
ensures inv_AltitudeControl(*self);
|
574
|
ensures Ctrans_AltitudeControl(AntEng_Out1_19,
|
575
|
AltCmd_Out1_29,
|
576
|
Alt_Out1_39,
|
577
|
GsKts_Out1_49,
|
578
|
hdot_Out1_59,
|
579
|
hdotChgRate_Out1_69,
|
580
|
*altgammacmd_In1_661,
|
581
|
\at(*self, Pre),
|
582
|
(*self));
|
583
|
|
584
|
assigns *altgammacmd_In1_661, *self;
|
585
|
|
586
|
*/
|
587
|
extern void AltitudeControl_step (double AntEng_Out1_19,
|
588
|
double AltCmd_Out1_29, double Alt_Out1_39,
|
589
|
double GsKts_Out1_49, double hdot_Out1_59,
|
590
|
double hdotChgRate_Out1_69,
|
591
|
double (*altgammacmd_In1_661),
|
592
|
struct AltitudeControl_mem *self);
|
593
|
|
594
|
/*@ predicate trans_top(integer AltEng,
|
595
|
real AltCmd,
|
596
|
real Altitude,
|
597
|
real gskts,
|
598
|
real hdot,
|
599
|
real hdotChgRate,
|
600
|
integer obs,
|
601
|
struct top_mem self1,
|
602
|
struct top_mem self2,
|
603
|
real altgammaCmd,
|
604
|
real tempAlt) =
|
605
|
|
606
|
(tempAlt == (AltEng?(1.):(0.))) &&
|
607
|
Ctrans_AltitudeControl((double) tempAlt,
|
608
|
(double) AltCmd,
|
609
|
(double) Altitude,
|
610
|
(double) gskts,
|
611
|
(double) hdot,
|
612
|
(double) hdotChgRate,
|
613
|
altgammaCmd,
|
614
|
self1.ni_0,
|
615
|
self2.ni_0) &&
|
616
|
((!obs) == (!(altgammaCmd == 0.)));
|
617
|
*/
|
618
|
/*@ predicate Ctrans_top(integer AltEng,
|
619
|
real AltCmd,
|
620
|
real Altitude,
|
621
|
real gskts,
|
622
|
real hdot,
|
623
|
real hdotChgRate,
|
624
|
integer obs,
|
625
|
struct top_mem self1,
|
626
|
struct top_mem self2) =
|
627
|
\exists real altgammaCmd;
|
628
|
\exists real tempAlt;
|
629
|
trans_top(AltEng,
|
630
|
AltCmd,
|
631
|
Altitude,
|
632
|
gskts,
|
633
|
hdot,
|
634
|
hdotChgRate,
|
635
|
obs,
|
636
|
self1,
|
637
|
self2,
|
638
|
altgammaCmd,
|
639
|
tempAlt);
|
640
|
*/
|
641
|
/*@ predicate init_top(struct top_mem self) =
|
642
|
|
643
|
init_AltitudeControl(self.ni_0);
|
644
|
*/
|
645
|
#define top_DECLARE(attr, inst)\
|
646
|
attr struct top_mem inst;\
|
647
|
AltitudeControl_DECLARE(attr, inst ## _ni_0);
|
648
|
|
649
|
|
650
|
#define top_ALLOC(attr,inst)\
|
651
|
top_DECLARE(attr,inst);
|
652
|
|
653
|
|
654
|
/*@requires \valid(self);
|
655
|
ensures init_top(\at(*self, Here));
|
656
|
assigns *self;*/
|
657
|
extern void top_reset (struct top_mem *self);
|
658
|
|
659
|
/*@ requires \valid(obs);
|
660
|
requires \valid(self);
|
661
|
requires \separated(obs, self);
|
662
|
ensures Ctrans_top(AltEng,
|
663
|
AltCmd,
|
664
|
Altitude,
|
665
|
gskts,
|
666
|
hdot,
|
667
|
hdotChgRate,
|
668
|
*obs,
|
669
|
\at(*self, Pre),
|
670
|
(*self));
|
671
|
assigns *obs, *self;
|
672
|
*/
|
673
|
extern void top_step (_Bool AltEng, double AltCmd, double Altitude,
|
674
|
double gskts, double hdot, double hdotChgRate,
|
675
|
_Bool (*obs),
|
676
|
struct top_mem *self);
|
677
|
|
678
|
|
679
|
#endif
|
680
|
|