Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec-tests / regression_tests / lustre_files / success / Stateflow / src_Flowchart8 / Flowchart8.lus @ eb639349

History | View | Annotate | Download (6.08 KB)

1
-- This file has been generated by cocoSim
2

    
3

    
4
-- System nodes
5

    
6

    
7

    
8

    
9
node Flowchart8_Flowchart8Junction849__To__Flowchart8_Flowchart8Junction850_1_Condition_Action(cent_1:int;
10
	sec_1:int)
11

    
12
returns (cent:int;
13
	sec:int);
14

    
15

    
16
var 	cent_2:int;
17
	sec_2:int;
18

    
19

    
20
let
21

    
22

    
23

    
24
	cent_2 
25
	= 0;
26
	
27

    
28
	sec_2 
29
	=  sec_1  + 1;
30
	
31

    
32
	(cent, sec) 
33
	= (cent_2, sec_2);
34
	
35

    
36
tel
37

    
38

    
39

    
40

    
41

    
42

    
43

    
44
node Flowchart8_A__To__Flowchart8_Flowchart8Junction849_1_Condition_Action(cent_1:int)
45

    
46
returns (cent:int);
47

    
48

    
49
var 	cent_2:int;
50

    
51

    
52
let
53

    
54

    
55

    
56
	cent_2 
57
	=  cent_1  + 1;
58
	
59

    
60
	(cent) 
61
	= (cent_2);
62
	
63

    
64
tel
65

    
66

    
67

    
68

    
69

    
70

    
71

    
72

    
73
node Flowchart8_Flowchart8Junction850__To__Flowchart8_Flowchart8Junction851_1_Condition_Action(sec_1:int;
74
	min_1:int)
75

    
76
returns (sec:int;
77
	min:int);
78

    
79

    
80
var 	sec_2:int;
81
	min_2:int;
82

    
83

    
84
let
85

    
86

    
87

    
88
	sec_2 
89
	= 0;
90
	
91

    
92
	min_2 
93
	=  min_1  + 1;
94
	
95

    
96
	(sec, min) 
97
	= (sec_2, min_2);
98
	
99

    
100
tel
101

    
102

    
103

    
104

    
105

    
106

    
107
-- Entry action for state :Flowchart8_A
108
node Flowchart8_A_en(idFlowchart8_Flowchart8_1:int;
109
	isInner:bool)
110

    
111
returns (idFlowchart8_Flowchart8:int);
112

    
113

    
114
var 	idFlowchart8_Flowchart8_2:int;
115

    
116

    
117
let
118

    
119

    
120

    
121
	-- set state as active 
122
	idFlowchart8_Flowchart8_2 
123
	= 844;
124
	
125

    
126
	(idFlowchart8_Flowchart8) 
127
	= (idFlowchart8_Flowchart8_2);
128
	
129

    
130
tel
131

    
132

    
133

    
134

    
135

    
136
-- Exit action for state :Flowchart8_A
137
node Flowchart8_A_ex(idFlowchart8_Flowchart8_1:int;
138
	isInner:bool)
139

    
140
returns (idFlowchart8_Flowchart8:int);
141

    
142

    
143
var 	idFlowchart8_Flowchart8_2:int;
144

    
145

    
146
let
147

    
148

    
149

    
150
	-- set state as inactive 
151
	idFlowchart8_Flowchart8_2
152
	 = if (not isInner) then 0 else idFlowchart8_Flowchart8_1;
153

    
154

    
155
	(idFlowchart8_Flowchart8) 
156
	= (idFlowchart8_Flowchart8_1);
157
	
158

    
159
tel
160

    
161

    
162
--***************************************************State :Flowchart8_Flowchart8 Automaton***************************************************
163

    
164
node Flowchart8_Flowchart8_node(idFlowchart8_Flowchart8_1:int;
165
	TIC:bool;
166
	cent_1:int;
167
	sec_1:int;
168
	min_1:int)
169

    
170
returns (idFlowchart8_Flowchart8:int;
171
	cent:int;
172
	sec:int;
173
	min:int);
174

    
175

    
176
let
177

    
178
	 automaton flowchart8_flowchart8
179

    
180
	state POINTFlowchart8_Flowchart8:
181
	unless (idFlowchart8_Flowchart8_1=0) restart POINT__TO__FLOWCHART8_A_1
182

    
183

    
184

    
185
	unless (idFlowchart8_Flowchart8_1=844) and TIC restart FLOWCHART8_A__TO__FLOWCHART8_FLOWCHART8JUNCTION849_1
186

    
187

    
188

    
189
	unless (idFlowchart8_Flowchart8_1=844) restart FLOWCHART8_A_IDL
190

    
191
	let
192

    
193
		(idFlowchart8_Flowchart8, cent, sec, min) 
194
	= (idFlowchart8_Flowchart8_1, cent_1, sec_1, min_1);
195
	
196

    
197
	tel
198

    
199

    
200

    
201
	state POINT__TO__FLOWCHART8_A_1:
202

    
203
	 var 	idFlowchart8_Flowchart8_2:int;
204
	let
205

    
206
		-- transition trace :
207
	--POINT__To__Flowchart8_A_1
208
		(idFlowchart8_Flowchart8_2) 
209
	= Flowchart8_A_en(idFlowchart8_Flowchart8_1, false);
210
		
211

    
212
	(idFlowchart8_Flowchart8) 
213
	=  (idFlowchart8_Flowchart8_2);
214

    
215
	--add unused variables
216
	(cent, min, sec) 
217
	= (cent_1, min_1, sec_1);
218
	
219

    
220
	tel
221

    
222
	until true restart POINTFlowchart8_Flowchart8
223

    
224

    
225

    
226
	state FLOWCHART8_A__TO__FLOWCHART8_FLOWCHART8JUNCTION849_1:
227

    
228
	 var 	cent_2, cent_3, cent_4, cent_5, cent_6:int;
229
	sec_2, sec_3, sec_4:int;
230
	min_2:int;
231
	let
232

    
233
		
234

    
235

    
236

    
237
-- transition trace :
238
	--Flowchart8_A__To__Junction849_1, Junction849__To__Junction850_1, Junction850__To__Junction851_1
239
		-- condition Action : cent++
240
		
241
		(cent_2) 
242
	= Flowchart8_A__To__Flowchart8_Flowchart8Junction849_1_Condition_Action(cent_1);
243
		
244

    
245
		-- condition Action : cent=0;sec++
246
		
247
		(cent_3, sec_2) 
248
	= 
249
		 if ((  cent_2 =2 )) then 
250
		Flowchart8_Flowchart8Junction849__To__Flowchart8_Flowchart8Junction850_1_Condition_Action(cent_2, sec_1)
251
		 else (cent_2, sec_1);
252
		
253

    
254
		-- condition Action : sec=0;min++
255
		
256
		(sec_3, min_2) 
257
	= 
258
		 if ((  cent_2 =2 ) and (  sec_2 =3 )) then 
259
		Flowchart8_Flowchart8Junction850__To__Flowchart8_Flowchart8Junction851_1_Condition_Action(sec_2, min_1)
260
		 else (sec_2, min_1);
261
		
262

    
263

    
264
-- transition trace :
265
	--Flowchart8_A__To__Junction849_1, Junction849__To__Junction850_1, Junction850__To__Junction851_2
266
		-- condition Action : cent++
267
		
268
		(cent_4) 
269
	= Flowchart8_A__To__Flowchart8_Flowchart8Junction849_1_Condition_Action(cent_1);
270
		
271

    
272
		-- condition Action : cent=0;sec++
273
		
274
		(cent_5, sec_4) 
275
	= 
276
		 if ((  cent_4 =2 )) then 
277
		Flowchart8_Flowchart8Junction849__To__Flowchart8_Flowchart8Junction850_1_Condition_Action(cent_4, sec_1)
278
		 else (cent_4, sec_1);
279
		
280

    
281

    
282
-- transition trace :
283
	--Flowchart8_A__To__Junction849_1, Junction849__To__Junction851_2
284
		-- condition Action : cent++
285
		
286
		(cent_6) 
287
	= Flowchart8_A__To__Flowchart8_Flowchart8Junction849_1_Condition_Action(cent_1);
288
		
289

    
290
	(idFlowchart8_Flowchart8, cent, sec, min) 
291
	= 
292
		 if ((  cent_2 =2 ) and (  sec_2 =3 )) then 
293
		(idFlowchart8_Flowchart8_1, cent_3, sec_3, min_2)
294
		 else
295
		 if ((  cent_4 =2 )) then 
296
		(idFlowchart8_Flowchart8_1, cent_5, sec_4, min_1)
297
		 else
298
		 if ((  cent_4 =2 )) then 
299
		(idFlowchart8_Flowchart8_1, cent_5, sec_4, min_1)
300
		 else (idFlowchart8_Flowchart8_1, cent_6, sec_1, min_1);
301

    
302

    
303
	tel
304

    
305
	until true restart POINTFlowchart8_Flowchart8
306

    
307

    
308

    
309
	state FLOWCHART8_A_IDL:
310

    
311
	 	let
312

    
313
		
314

    
315
	(idFlowchart8_Flowchart8, cent, sec, min) 
316
	= (idFlowchart8_Flowchart8_1, cent_1, sec_1, min_1);
317
	
318

    
319
	tel
320

    
321
	until true restart POINTFlowchart8_Flowchart8
322

    
323

    
324

    
325
tel
326

    
327

    
328
--***************************************************State :Flowchart8_Flowchart8 Automaton***************************************************
329

    
330
node Flowchart8_Flowchart8(TIC:bool)
331

    
332
returns (cent:int;
333
	sec:int;
334
	min:int);
335

    
336

    
337
var cent_1: int;
338

    
339
	sec_1: int;
340

    
341
	min_1: int;
342

    
343
	idFlowchart8_Flowchart8, idFlowchart8_Flowchart8_1: int;
344

    
345
	let
346

    
347
	cent_1 = 0 -> pre cent;
348

    
349
	sec_1 = 0 -> pre sec;
350

    
351
	min_1 = 0 -> pre min;
352

    
353
	idFlowchart8_Flowchart8_1 = 0 -> pre idFlowchart8_Flowchart8;
354

    
355
	
356

    
357

    
358

    
359
	(idFlowchart8_Flowchart8, cent, sec, min)
360
	 = 
361

    
362
	 if TIC then Flowchart8_Flowchart8_node(idFlowchart8_Flowchart8_1, TIC, cent_1, sec_1, min_1)
363

    
364
	 else (idFlowchart8_Flowchart8_1, cent_1, sec_1, min_1);
365

    
366
	
367

    
368

    
369
--unused outputs
370
	
371

    
372
tel
373

    
374

    
375

    
376
node Flowchart8 (In1_1_1 : real)
377
returns (cent_1_1 : int;
378
	sec_2_1 : int;
379
	Out3_3_1 : int); 
380
var
381
	Flowchart8_1_1 : int; Flowchart8_2_1 : int; Flowchart8_3_1 : int;
382
	i_virtual_local : real;
383
	Flowchart8In1_1_1_event: bool;
384
let 
385
	Flowchart8In1_1_1_event = false -> ((pre(In1_1_1) > 0.0 and In1_1_1 <= 0.0) or (pre(In1_1_1) <= 0.0 and In1_1_1 > 0.0));
386
	(Flowchart8_1_1, Flowchart8_2_1, Flowchart8_3_1) =  Flowchart8_Flowchart8(Flowchart8In1_1_1_event);
387
	cent_1_1 = Flowchart8_1_1;
388
	sec_2_1 = Flowchart8_2_1;
389
	Out3_3_1 = Flowchart8_3_1;
390
	i_virtual_local= 0.0 -> 1.0;
391
tel
392