Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec-tests / regression_tests / lustre_files / success / Stateflow / src_Flowchart7 / Flowchart7.lus @ eb639349

History | View | Annotate | Download (4.6 KB)

1 eb639349 bourbouh
-- This file has been generated by cocoSim
2
3
4
-- System nodes
5
6
7
8
9
node Flowchart7_Flowchart7Junction833__To__Flowchart7_Flowchart7Junction834_1_Condition_Action(sec_1:int;
10
	min_1:int)
11
12
returns (sec:int;
13
	min:int);
14
15
16
var 	sec_2:int;
17
	min_2:int;
18
19
20
let
21
22
23
24
	sec_2 
25
	= 0;
26
	
27
28
	min_2 
29
	=  min_1  + 1;
30
	
31
32
	(sec, min) 
33
	= (sec_2, min_2);
34
	
35
36
tel
37
38
39
40
41
42
43
node POINT__To__Flowchart7_Flowchart7Junction832_1_Condition_Action(cent_1:int)
44
45
returns (cent:int);
46
47
48
var 	cent_2:int;
49
50
51
let
52
53
54
55
	cent_2 
56
	=  cent_1  + 1;
57
	
58
59
	(cent) 
60
	= (cent_2);
61
	
62
63
tel
64
65
66
67
68
69
70
node Flowchart7_Flowchart7Junction832__To__Flowchart7_Flowchart7Junction833_1_Condition_Action(cent_1:int;
71
	sec_1:int)
72
73
returns (cent:int;
74
	sec:int);
75
76
77
var 	cent_2:int;
78
	sec_2:int;
79
80
81
let
82
83
84
85
	cent_2 
86
	= 0;
87
	
88
89
	sec_2 
90
	=  sec_1  + 1;
91
	
92
93
	(cent, sec) 
94
	= (cent_2, sec_2);
95
	
96
97
tel
98
99
100
101
102
--***************************************************State :Flowchart7_Flowchart7 Automaton***************************************************
103
104
node Flowchart7_Flowchart7_node(idFlowchart7_Flowchart7_1:int;
105
	TIC:bool;
106
	cent_1:int;
107
	sec_1:int;
108
	min_1:int)
109
110
returns (idFlowchart7_Flowchart7:int;
111
	cent:int;
112
	sec:int;
113
	min:int);
114
115
116
let
117
118
	 automaton flowchart7_flowchart7
119
120
	state POINTFlowchart7_Flowchart7:
121
	unless (idFlowchart7_Flowchart7_1=0) and TIC restart POINT__TO__FLOWCHART7_FLOWCHART7JUNCTION832_1
122
123
124
125
	let
126
127
		(idFlowchart7_Flowchart7, cent, sec, min) 
128
	= (idFlowchart7_Flowchart7_1, cent_1, sec_1, min_1);
129
	
130
131
	tel
132
133
134
135
	state POINT__TO__FLOWCHART7_FLOWCHART7JUNCTION832_1:
136
137
	 var 	cent_2, cent_3, cent_4, cent_5, cent_6:int;
138
	sec_2, sec_3, sec_4:int;
139
	min_2:int;
140
	let
141
142
		
143
144
145
146
-- transition trace :
147
	--POINT__To__Junction832_1, Junction832__To__Junction833_1, Junction833__To__Junction834_1
148
		-- condition Action : cent++
149
		
150
		(cent_2) 
151
	= POINT__To__Flowchart7_Flowchart7Junction832_1_Condition_Action(cent_1);
152
		
153
154
		-- condition Action : cent=0;sec++
155
		
156
		(cent_3, sec_2) 
157
	= 
158
		 if ((  cent_2 =2 )) then 
159
		Flowchart7_Flowchart7Junction832__To__Flowchart7_Flowchart7Junction833_1_Condition_Action(cent_2, sec_1)
160
		 else (cent_2, sec_1);
161
		
162
163
		-- condition Action : sec=0;min++
164
		
165
		(sec_3, min_2) 
166
	= 
167
		 if ((  cent_2 =2 ) and (  sec_2 =3 )) then 
168
		Flowchart7_Flowchart7Junction833__To__Flowchart7_Flowchart7Junction834_1_Condition_Action(sec_2, min_1)
169
		 else (sec_2, min_1);
170
		
171
172
173
-- transition trace :
174
	--POINT__To__Junction832_1, Junction832__To__Junction833_1, Junction833__To__Junction834_2
175
		-- condition Action : cent++
176
		
177
		(cent_4) 
178
	= POINT__To__Flowchart7_Flowchart7Junction832_1_Condition_Action(cent_1);
179
		
180
181
		-- condition Action : cent=0;sec++
182
		
183
		(cent_5, sec_4) 
184
	= 
185
		 if ((  cent_4 =2 )) then 
186
		Flowchart7_Flowchart7Junction832__To__Flowchart7_Flowchart7Junction833_1_Condition_Action(cent_4, sec_1)
187
		 else (cent_4, sec_1);
188
		
189
190
191
-- transition trace :
192
	--POINT__To__Junction832_1, Junction832__To__Junction834_2
193
		-- condition Action : cent++
194
		
195
		(cent_6) 
196
	= POINT__To__Flowchart7_Flowchart7Junction832_1_Condition_Action(cent_1);
197
		
198
199
	(idFlowchart7_Flowchart7, cent, sec, min) 
200
	= 
201
		 if ((  cent_2 =2 ) and (  sec_2 =3 )) then 
202
		(idFlowchart7_Flowchart7_1, cent_3, sec_3, min_2)
203
		 else
204
		 if ((  cent_4 =2 )) then 
205
		(idFlowchart7_Flowchart7_1, cent_5, sec_4, min_1)
206
		 else
207
		 if ((  cent_4 =2 )) then 
208
		(idFlowchart7_Flowchart7_1, cent_5, sec_4, min_1)
209
		 else (idFlowchart7_Flowchart7_1, cent_6, sec_1, min_1);
210
211
212
	tel
213
214
	until true restart POINTFlowchart7_Flowchart7
215
216
217
218
tel
219
220
221
--***************************************************State :Flowchart7_Flowchart7 Automaton***************************************************
222
223
node Flowchart7_Flowchart7(TIC:bool)
224
225
returns (cent:int;
226
	sec:int;
227
	min:int);
228
229
230
var cent_1: int;
231
232
	sec_1: int;
233
234
	min_1: int;
235
236
	idFlowchart7_Flowchart7, idFlowchart7_Flowchart7_1: int;
237
238
	let
239
240
	cent_1 = 0 -> pre cent;
241
242
	sec_1 = 0 -> pre sec;
243
244
	min_1 = 0 -> pre min;
245
246
	idFlowchart7_Flowchart7_1 = 0 -> pre idFlowchart7_Flowchart7;
247
248
	
249
250
251
252
	(idFlowchart7_Flowchart7, cent, sec, min)
253
	 = 
254
255
	 if TIC then Flowchart7_Flowchart7_node(idFlowchart7_Flowchart7_1, TIC, cent_1, sec_1, min_1)
256
257
	 else (idFlowchart7_Flowchart7_1, cent_1, sec_1, min_1);
258
259
	
260
261
262
--unused outputs
263
	
264
265
tel
266
267
268
269
node Flowchart7 (TIC_1_1 : real)
270
returns (Out1_1_1 : int;
271
	Out2_2_1 : int;
272
	Out3_3_1 : int); 
273
var
274
	Flowchart7_1_1 : int; Flowchart7_2_1 : int; Flowchart7_3_1 : int;
275
	i_virtual_local : real;
276
	Flowchart7TIC_1_1_event: bool;
277
let 
278
	Flowchart7TIC_1_1_event = false -> ((pre(TIC_1_1) > 0.0 and TIC_1_1 <= 0.0) or (pre(TIC_1_1) <= 0.0 and TIC_1_1 > 0.0));
279
	(Flowchart7_1_1, Flowchart7_2_1, Flowchart7_3_1) =  Flowchart7_Flowchart7(Flowchart7TIC_1_1_event);
280
	Out1_1_1 = Flowchart7_1_1;
281
	Out2_2_1 = Flowchart7_2_1;
282
	Out3_3_1 = Flowchart7_3_1;
283
	i_virtual_local= 0.0 -> 1.0;
284
tel