## lustrec-tests / regression_tests / lustre_files / success / Simulink / src_many_files / if_multi_test.LUSTREC.lus @ b58cc410

History | View | Annotate | Download (10.2 KB)

1 |
-- This file has been generated by CoCoSim2. |
---|---|

2 | |

3 |
-- Compiler: Lustre compiler 2 (ToLustre.m) |

4 |
-- Time: 07-Nov-2018 18:06:26 |

5 |
node _make_clock(period : int; |

6 |
phase : int;) |

7 |
returns(clk : bool;); |

8 |
var count : int; |

9 |
let |

10 |
count = (((period - phase) -> ((pre count) + 1)) mod period); |

11 |
clk = (count = 0); |

12 |
tel |

13 | |

14 |
(* |

15 |
Original block name: if_multi_test/If Action |

16 |
Subsystem4 |

17 |
*) |

18 |
node IfActionSubsystem4_65_002_automaton(In2_1 : real; |

19 |
In2_2 : real; |

20 |
In2_3 : real; |

21 |
In3_1 : bool; |

22 |
_isEnabled : bool; |

23 |
__time_step : real; |

24 |
__nb_step : int;) |

25 |
returns(Out2_1 : bool; |

26 |
Out2_2 : bool; |

27 |
Out2_3 : bool; |

28 |
Out3_1 : real; |

29 |
Out3_2 : real; |

30 |
Out3_3 : real; |

31 |
Out4_1 : bool; |

32 |
Out4_2 : bool; |

33 |
Out4_3 : bool;); |

34 |
var pre_Out2_1 : bool; |

35 |
pre_Out2_2 : bool; |

36 |
pre_Out2_3 : bool; |

37 |
pre_Out3_1 : real; |

38 |
pre_Out3_2 : real; |

39 |
pre_Out3_3 : real; |

40 |
pre_Out4_1 : bool; |

41 |
pre_Out4_2 : bool; |

42 |
pre_Out4_3 : bool; |

43 |
let |

44 |
pre_Out2_1 = if (__nb_step > 0) then |

45 |
(pre Out2_1) |

46 |
else false; |

47 |
pre_Out2_2 = if (__nb_step > 0) then |

48 |
(pre Out2_2) |

49 |
else false; |

50 |
pre_Out2_3 = if (__nb_step > 0) then |

51 |
(pre Out2_3) |

52 |
else false; |

53 |
pre_Out3_1 = if (__nb_step > 0) then |

54 |
(pre Out3_1) |

55 |
else 0.000000000000000; |

56 |
pre_Out3_2 = if (__nb_step > 0) then |

57 |
(pre Out3_2) |

58 |
else 0.000000000000000; |

59 |
pre_Out3_3 = if (__nb_step > 0) then |

60 |
(pre Out3_3) |

61 |
else 0.000000000000000; |

62 |
pre_Out4_1 = if (__nb_step > 0) then |

63 |
(pre Out4_1) |

64 |
else false; |

65 |
pre_Out4_2 = if (__nb_step > 0) then |

66 |
(pre Out4_2) |

67 |
else false; |

68 |
pre_Out4_3 = if (__nb_step > 0) then |

69 |
(pre Out4_3) |

70 |
else false; |

71 |
automaton enabled_IfActionSubsystem4_65_002 |

72 |
state Active_IfActionSubsystem4_65_002: |

73 |
unless (not _isEnabled) restart Inactive_IfActionSubsystem4_65_002 |

74 |
let |

75 |
(Out2_1, Out2_2, Out2_3, Out3_1, Out3_2, Out3_3, Out4_1, Out4_2, Out4_3) = IfActionSubsystem4_65_002(In2_1, In2_2, In2_3, In3_1, __time_step, __nb_step); |

76 |
tel |

77 | |

78 |
state Inactive_IfActionSubsystem4_65_002: |

79 |
unless _isEnabled resume Active_IfActionSubsystem4_65_002 |

80 |
let |

81 |
Out2_1 = pre_Out2_1; |

82 |
Out2_2 = pre_Out2_2; |

83 |
Out2_3 = pre_Out2_3; |

84 |
Out3_1 = pre_Out3_1; |

85 |
Out3_2 = pre_Out3_2; |

86 |
Out3_3 = pre_Out3_3; |

87 |
Out4_1 = pre_Out4_1; |

88 |
Out4_2 = pre_Out4_2; |

89 |
Out4_3 = pre_Out4_3; |

90 |
tel |

91 | |

92 | |

93 |
tel |

94 | |

95 |
(* |

96 |
Original block name: if_multi_test/If Action |

97 |
Subsystem4 |

98 |
*) |

99 |
node IfActionSubsystem4_65_002(In2_1 : real; |

100 |
In2_2 : real; |

101 |
In2_3 : real; |

102 |
In3_1 : bool; |

103 |
__time_step : real; |

104 |
__nb_step : int;) |

105 |
returns(Out2_1 : bool; |

106 |
Out2_2 : bool; |

107 |
Out2_3 : bool; |

108 |
Out3_1 : real; |

109 |
Out3_2 : real; |

110 |
Out3_3 : real; |

111 |
Out4_1 : bool; |

112 |
Out4_2 : bool; |

113 |
Out4_3 : bool;); |

114 |
var LogicalOperator_1 : bool; |

115 |
LogicalOperator_2 : bool; |

116 |
LogicalOperator_3 : bool; |

117 |
RelationalOperator_1 : bool; |

118 |
RelationalOperator_2 : bool; |

119 |
RelationalOperator_3 : bool; |

120 |
let |

121 |
LogicalOperator_1 = ( RelationalOperator_1 and In3_1 ); |

122 |
LogicalOperator_2 = ( RelationalOperator_2 and In3_1 ); |

123 |
LogicalOperator_3 = ( RelationalOperator_3 and In3_1 ); |

124 |
RelationalOperator_1 = (In2_1 <= In2_1); |

125 |
RelationalOperator_2 = (In2_2 <= In2_2); |

126 |
RelationalOperator_3 = (In2_3 <= In2_3); |

127 |
Out2_1 = RelationalOperator_1; |

128 |
Out2_2 = RelationalOperator_2; |

129 |
Out2_3 = RelationalOperator_3; |

130 |
Out3_1 = In2_1; |

131 |
Out3_2 = In2_2; |

132 |
Out3_3 = In2_3; |

133 |
Out4_1 = LogicalOperator_1; |

134 |
Out4_2 = LogicalOperator_2; |

135 |
Out4_3 = LogicalOperator_3; |

136 |
tel |

137 | |

138 |
(* |

139 |
Original block name: if_multi_test/If Action |

140 |
Subsystem5 |

141 |
*) |

142 |
node IfActionSubsystem5_84_003_automaton(In1_1 : real; |

143 |
In1_2 : real; |

144 |
In1_3 : real; |

145 |
_isEnabled : bool; |

146 |
__time_step : real; |

147 |
__nb_step : int;) |

148 |
returns(Out1_1 : real; |

149 |
Out1_2 : real; |

150 |
Out1_3 : real;); |

151 |
var pre_Out1_1 : real; |

152 |
pre_Out1_2 : real; |

153 |
pre_Out1_3 : real; |

154 |
let |

155 |
pre_Out1_1 = if (__nb_step > 0) then |

156 |
(pre Out1_1) |

157 |
else 0.000000000000000; |

158 |
pre_Out1_2 = if (__nb_step > 0) then |

159 |
(pre Out1_2) |

160 |
else 0.000000000000000; |

161 |
pre_Out1_3 = if (__nb_step > 0) then |

162 |
(pre Out1_3) |

163 |
else 0.000000000000000; |

164 |
automaton enabled_IfActionSubsystem5_84_003 |

165 |
state Active_IfActionSubsystem5_84_003: |

166 |
unless (not _isEnabled) restart Inactive_IfActionSubsystem5_84_003 |

167 |
let |

168 |
(Out1_1, Out1_2, Out1_3) = IfActionSubsystem5_84_003(In1_1, In1_2, In1_3, __time_step, __nb_step); |

169 |
tel |

170 | |

171 |
state Inactive_IfActionSubsystem5_84_003: |

172 |
unless _isEnabled resume Active_IfActionSubsystem5_84_003 |

173 |
let |

174 |
Out1_1 = pre_Out1_1; |

175 |
Out1_2 = pre_Out1_2; |

176 |
Out1_3 = pre_Out1_3; |

177 |
tel |

178 | |

179 | |

180 |
tel |

181 | |

182 |
(* |

183 |
Original block name: if_multi_test/If Action |

184 |
Subsystem5 |

185 |
*) |

186 |
node IfActionSubsystem5_84_003(In1_1 : real; |

187 |
In1_2 : real; |

188 |
In1_3 : real; |

189 |
__time_step : real; |

190 |
__nb_step : int;) |

191 |
returns(Out1_1 : real; |

192 |
Out1_2 : real; |

193 |
Out1_3 : real;); |

194 |
let |

195 |
Out1_1 = In1_1; |

196 |
Out1_2 = In1_2; |

197 |
Out1_3 = In1_3; |

198 |
tel |

199 | |

200 |
(* |

201 |
Original block name: if_multi_test/If Action |

202 |
Subsystem6 |

203 |
*) |

204 |
node IfActionSubsystem6_89_003_automaton(In1_1 : bool; |

205 |
_isEnabled : bool; |

206 |
__time_step : real; |

207 |
__nb_step : int;) |

208 |
returns(Out1_1 : bool;); |

209 |
var pre_Out1_1 : bool; |

210 |
let |

211 |
pre_Out1_1 = if (__nb_step > 0) then |

212 |
(pre Out1_1) |

213 |
else false; |

214 |
automaton enabled_IfActionSubsystem6_89_003 |

215 |
state Active_IfActionSubsystem6_89_003: |

216 |
unless (not _isEnabled) restart Inactive_IfActionSubsystem6_89_003 |

217 |
let |

218 |
Out1_1 = IfActionSubsystem6_89_003(In1_1, __time_step, __nb_step); |

219 |
tel |

220 | |

221 |
state Inactive_IfActionSubsystem6_89_003: |

222 |
unless _isEnabled resume Active_IfActionSubsystem6_89_003 |

223 |
let |

224 |
Out1_1 = pre_Out1_1; |

225 |
tel |

226 | |

227 | |

228 |
tel |

229 | |

230 |
(* |

231 |
Original block name: if_multi_test/If Action |

232 |
Subsystem6 |

233 |
*) |

234 |
node IfActionSubsystem6_89_003(In1_1 : bool; |

235 |
__time_step : real; |

236 |
__nb_step : int;) |

237 |
returns(Out1_1 : bool;); |

238 |
let |

239 |
Out1_1 = In1_1; |

240 |
tel |

241 | |

242 |
(* |

243 |
Original block name: if_multi_test/If Action |

244 |
Subsystem7 |

245 |
*) |

246 |
node IfActionSubsystem7_94_002_automaton(In1_1 : real; |

247 |
In1_2 : real; |

248 |
In1_3 : real; |

249 |
In1_4 : real; |

250 |
_isEnabled : bool; |

251 |
__time_step : real; |

252 |
__nb_step : int;) |

253 |
returns(Out1_1 : real; |

254 |
Out1_2 : real; |

255 |
Out1_3 : real; |

256 |
Out1_4 : real;); |

257 |
var pre_Out1_1 : real; |

258 |
pre_Out1_2 : real; |

259 |
pre_Out1_3 : real; |

260 |
pre_Out1_4 : real; |

261 |
let |

262 |
pre_Out1_1 = if (__nb_step > 0) then |

263 |
(pre Out1_1) |

264 |
else 0.000000000000000; |

265 |
pre_Out1_2 = if (__nb_step > 0) then |

266 |
(pre Out1_2) |

267 |
else 0.000000000000000; |

268 |
pre_Out1_3 = if (__nb_step > 0) then |

269 |
(pre Out1_3) |

270 |
else 0.000000000000000; |

271 |
pre_Out1_4 = if (__nb_step > 0) then |

272 |
(pre Out1_4) |

273 |
else 0.000000000000000; |

274 |
automaton enabled_IfActionSubsystem7_94_002 |

275 |
state Active_IfActionSubsystem7_94_002: |

276 |
unless (not _isEnabled) restart Inactive_IfActionSubsystem7_94_002 |

277 |
let |

278 |
(Out1_1, Out1_2, Out1_3, Out1_4) = IfActionSubsystem7_94_002(In1_1, In1_2, In1_3, In1_4, __time_step, __nb_step); |

279 |
tel |

280 | |

281 |
state Inactive_IfActionSubsystem7_94_002: |

282 |
unless _isEnabled resume Active_IfActionSubsystem7_94_002 |

283 |
let |

284 |
Out1_1 = pre_Out1_1; |

285 |
Out1_2 = pre_Out1_2; |

286 |
Out1_3 = pre_Out1_3; |

287 |
Out1_4 = pre_Out1_4; |

288 |
tel |

289 | |

290 | |

291 |
tel |

292 | |

293 |
(* |

294 |
Original block name: if_multi_test/If Action |

295 |
Subsystem7 |

296 |
*) |

297 |
node IfActionSubsystem7_94_002(In1_1 : real; |

298 |
In1_2 : real; |

299 |
In1_3 : real; |

300 |
In1_4 : real; |

301 |
__time_step : real; |

302 |
__nb_step : int;) |

303 |
returns(Out1_1 : real; |

304 |
Out1_2 : real; |

305 |
Out1_3 : real; |

306 |
Out1_4 : real;); |

307 |
let |

308 |
Out1_1 = In1_1; |

309 |
Out1_2 = In1_2; |

310 |
Out1_3 = In1_3; |

311 |
Out1_4 = In1_4; |

312 |
tel |

313 | |

314 |
(* |

315 |
Original block name: if_multi_test |

316 |
*) |

317 |
node if_multi_test(In3_1 : real; |

318 |
In3_2 : real; |

319 |
In3_3 : real; |

320 |
In4_1 : bool; |

321 |
In5_1 : real; |

322 |
In5_2 : real; |

323 |
In5_3 : real; |

324 |
In5_4 : real;) |

325 |
returns(Out5_1 : bool; |

326 |
Out5_2 : bool; |

327 |
Out5_3 : bool; |

328 |
Out6_1 : real; |

329 |
Out6_2 : real; |

330 |
Out6_3 : real; |

331 |
Out7_1 : real; |

332 |
Out7_2 : real; |

333 |
Out7_3 : real; |

334 |
Out8_1 : bool; |

335 |
Out8_2 : bool; |

336 |
Out8_3 : bool; |

337 |
Out9_1 : bool; |

338 |
Out10_1 : real; |

339 |
Out10_2 : real; |

340 |
Out10_3 : real; |

341 |
Out10_4 : real;); |

342 |
var ExecutionCond_of_IfActionSubsystem4_65_002 : bool; |

343 |
IfActionSubsystem4_1 : bool; |

344 |
IfActionSubsystem4_2 : bool; |

345 |
IfActionSubsystem4_3 : bool; |

346 |
IfActionSubsystem4_4 : real; |

347 |
IfActionSubsystem4_5 : real; |

348 |
IfActionSubsystem4_6 : real; |

349 |
IfActionSubsystem4_7 : bool; |

350 |
IfActionSubsystem4_8 : bool; |

351 |
IfActionSubsystem4_9 : bool; |

352 |
ExecutionCond_of_IfActionSubsystem5_84_003 : bool; |

353 |
IfActionSubsystem5_1 : real; |

354 |
IfActionSubsystem5_2 : real; |

355 |
IfActionSubsystem5_3 : real; |

356 |
ExecutionCond_of_IfActionSubsystem6_89_003 : bool; |

357 |
IfActionSubsystem6_1 : bool; |

358 |
ExecutionCond_of_IfActionSubsystem7_94_002 : bool; |

359 |
IfActionSubsystem7_1 : real; |

360 |
IfActionSubsystem7_2 : real; |

361 |
IfActionSubsystem7_3 : real; |

362 |
IfActionSubsystem7_4 : real; |

363 |
If1_1 : bool; |

364 |
If1_2 : bool; |

365 |
If1_3 : bool; |

366 |
If1_4 : bool; |

367 |
__time_step : real; |

368 |
__nb_step : int; |

369 |
_clk_0_1 : bool clock; |

370 |
let |

371 |
ExecutionCond_of_IfActionSubsystem4_65_002 = If1_1; |

372 |
(IfActionSubsystem4_1, IfActionSubsystem4_2, IfActionSubsystem4_3, IfActionSubsystem4_4, IfActionSubsystem4_5, IfActionSubsystem4_6, IfActionSubsystem4_7, IfActionSubsystem4_8, IfActionSubsystem4_9) = IfActionSubsystem4_65_002_automaton(In3_1, In3_2, In3_3, In4_1, ExecutionCond_of_IfActionSubsystem4_65_002, __time_step, __nb_step); |

373 |
ExecutionCond_of_IfActionSubsystem5_84_003 = If1_4; |

374 |
(IfActionSubsystem5_1, IfActionSubsystem5_2, IfActionSubsystem5_3) = IfActionSubsystem5_84_003_automaton(In3_1, In3_2, In3_3, ExecutionCond_of_IfActionSubsystem5_84_003, __time_step, __nb_step); |

375 |
ExecutionCond_of_IfActionSubsystem6_89_003 = If1_2; |

376 |
IfActionSubsystem6_1 = IfActionSubsystem6_89_003_automaton(In4_1, ExecutionCond_of_IfActionSubsystem6_89_003, __time_step, __nb_step); |

377 |
ExecutionCond_of_IfActionSubsystem7_94_002 = If1_3; |

378 |
(IfActionSubsystem7_1, IfActionSubsystem7_2, IfActionSubsystem7_3, IfActionSubsystem7_4) = IfActionSubsystem7_94_002_automaton(In5_1, In5_2, In5_3, In5_4, ExecutionCond_of_IfActionSubsystem7_94_002, __time_step, __nb_step); |

379 |
(If1_1, If1_2, If1_3, If1_4) = if In3_2 = 0.000000000000000 then |

380 |
(true, false, false, false) |

381 |
else if In5_2 < 3.000000000000000 then |

382 |
(false, true, false, false) |

383 |
else if ( - In5_1 > In3_3 ) and In5_2 > 0.000000000000000 then |

384 |
(false, false, true, false) |

385 |
else (false, false, false, true); |

386 |
Out5_1 = IfActionSubsystem4_1; |

387 |
Out5_2 = IfActionSubsystem4_2; |

388 |
Out5_3 = IfActionSubsystem4_3; |

389 |
Out6_1 = IfActionSubsystem5_1; |

390 |
Out6_2 = IfActionSubsystem5_2; |

391 |
Out6_3 = IfActionSubsystem5_3; |

392 |
Out7_1 = IfActionSubsystem4_4; |

393 |
Out7_2 = IfActionSubsystem4_5; |

394 |
Out7_3 = IfActionSubsystem4_6; |

395 |
Out8_1 = IfActionSubsystem4_7; |

396 |
Out8_2 = IfActionSubsystem4_8; |

397 |
Out8_3 = IfActionSubsystem4_9; |

398 |
Out9_1 = IfActionSubsystem6_1; |

399 |
Out10_1 = IfActionSubsystem7_1; |

400 |
Out10_2 = IfActionSubsystem7_2; |

401 |
Out10_3 = IfActionSubsystem7_3; |

402 |
Out10_4 = IfActionSubsystem7_4; |

403 |
__time_step = (0.0 -> ((pre __time_step) + 1.000000000000000)); |

404 |
__nb_step = (0 -> ((pre __nb_step) + 1)); |

405 |
_clk_0_1 = _make_clock(0, 1); |

406 |
tel |

407 |