Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec-tests / regression_tests / lustre_files / success / Stateflow / src_Flowchart1 / Flowchart1.lus @ eb639349

History | View | Annotate | Download (4.89 KB)

1
-- This file has been generated by cocoSim
2

    
3

    
4
-- System nodes
5

    
6

    
7

    
8

    
9
node POINT__To__Flowchart1_Flowchart1Junction745_1_Condition_Action(x_1:int)
10

    
11
returns (x:int);
12

    
13

    
14
var 	x_2:int;
15

    
16

    
17
let
18

    
19

    
20

    
21
	x_2 
22
	=  x_1  + 1;
23
	
24

    
25
	(x) 
26
	= (x_2);
27
	
28

    
29
tel
30

    
31

    
32

    
33

    
34

    
35

    
36
-- Entry action for state :Flowchart1_A
37
node Flowchart1_A_en(idFlowchart1_A_1:int;
38
	idFlowchart1_Flowchart1_1:int;
39
	x_1:int;
40
	isInner:bool)
41

    
42
returns (idFlowchart1_A:int;
43
	idFlowchart1_Flowchart1:int;
44
	x:int);
45

    
46

    
47
var 	idFlowchart1_A_2, idFlowchart1_A_3, idFlowchart1_A_4:int;
48
	idFlowchart1_Flowchart1_2, idFlowchart1_Flowchart1_3, idFlowchart1_Flowchart1_4:int;
49
	x_2, x_3, x_4:int;
50

    
51

    
52
let
53

    
54

    
55

    
56
	-- set state as active 
57
	idFlowchart1_Flowchart1_2 
58
	= 744;
59
	
60

    
61
	
62
-- transition trace :
63
	--POINT__To__Junction745_1
64
		-- condition Action : x++;
65
		
66
		(x_2) 
67
	= POINT__To__Flowchart1_Flowchart1Junction745_1_Condition_Action(x_1);
68
		
69

    
70
	(idFlowchart1_A_2, idFlowchart1_Flowchart1_3, x_3) 
71
	= 
72

    
73
	if ( idFlowchart1_A_1 = 0) then
74

    
75
	 (idFlowchart1_A_1, idFlowchart1_Flowchart1_2, x_2)
76

    
77
	 else(idFlowchart1_A_1, idFlowchart1_Flowchart1_2, x_1);
78

    
79
	
80

    
81
	(idFlowchart1_A_3, idFlowchart1_Flowchart1_4, x_4) 
82
	= 
83
		 if ( idFlowchart1_A_1 = 0) then 
84
		(idFlowchart1_A_2, idFlowchart1_Flowchart1_3, x_3)
85
		 else (idFlowchart1_A_1, idFlowchart1_Flowchart1_2, x_1);
86
-- case of state without states but contains transitions 
87
	idFlowchart1_A_4 
88
	= -1;
89
	
90

    
91
	(idFlowchart1_A, idFlowchart1_Flowchart1, x) 
92
	= (idFlowchart1_A_4, idFlowchart1_Flowchart1_4, x_4);
93
	
94

    
95
tel
96

    
97

    
98

    
99

    
100

    
101
-- Exit action for state :Flowchart1_A
102
node Flowchart1_A_ex(idFlowchart1_Flowchart1_1:int;
103
	isInner:bool)
104

    
105
returns (idFlowchart1_Flowchart1:int);
106

    
107

    
108
var 	idFlowchart1_Flowchart1_2:int;
109

    
110

    
111
let
112

    
113

    
114

    
115
	-- set state as inactive 
116
	idFlowchart1_Flowchart1_2
117
	 = if (not isInner) then 0 else idFlowchart1_Flowchart1_1;
118

    
119

    
120
	(idFlowchart1_Flowchart1) 
121
	= (idFlowchart1_Flowchart1_1);
122
	
123

    
124
tel
125

    
126

    
127
--***************************************************State :Flowchart1_A Automaton***************************************************
128

    
129
node Flowchart1_A_node(idFlowchart1_A_1:int;
130
	x_1:int)
131

    
132
returns (idFlowchart1_A:int;
133
	x:int);
134

    
135

    
136
let
137

    
138
	 automaton flowchart1_a
139

    
140
	state POINTFlowchart1_A:
141
	unless (idFlowchart1_A_1=0) restart POINT__TO__FLOWCHART1_FLOWCHART1JUNCTION745_1
142

    
143

    
144

    
145
	let
146

    
147
		(idFlowchart1_A, x) 
148
	= (idFlowchart1_A_1, x_1);
149
	
150

    
151
	tel
152

    
153

    
154

    
155
	state POINT__TO__FLOWCHART1_FLOWCHART1JUNCTION745_1:
156

    
157
	 var 	x_2:int;
158
	let
159

    
160
		-- transition trace :
161
	--POINT__To__Junction745_1
162
		-- condition Action : x++;
163
		
164
		(x_2) 
165
	= POINT__To__Flowchart1_Flowchart1Junction745_1_Condition_Action(x_1);
166
		
167

    
168
	(idFlowchart1_A, x) 
169
	=  (idFlowchart1_A_1, x_2);
170

    
171

    
172
	tel
173

    
174
	until true restart POINTFlowchart1_A
175

    
176

    
177

    
178
tel
179

    
180

    
181
--***************************************************State :Flowchart1_Flowchart1 Automaton***************************************************
182

    
183
node Flowchart1_Flowchart1_node(idFlowchart1_Flowchart1_1:int;
184
	idFlowchart1_A_1:int;
185
	x_1:int)
186

    
187
returns (idFlowchart1_Flowchart1:int;
188
	idFlowchart1_A:int;
189
	x:int);
190

    
191

    
192
let
193

    
194
	 automaton flowchart1_flowchart1
195

    
196
	state POINTFlowchart1_Flowchart1:
197
	unless (idFlowchart1_Flowchart1_1=0) restart POINT__TO__FLOWCHART1_A_1
198

    
199

    
200

    
201
	unless true  restart FLOWCHART1_FLOWCHART1_PARALLEL_IDL
202

    
203
	let
204

    
205
		(idFlowchart1_Flowchart1, idFlowchart1_A, x) 
206
	= (idFlowchart1_Flowchart1_1, idFlowchart1_A_1, x_1);
207
	
208

    
209
	tel
210

    
211

    
212

    
213
	state POINT__TO__FLOWCHART1_A_1:
214

    
215
	 var 	idFlowchart1_Flowchart1_2:int;
216
	idFlowchart1_A_2:int;
217
	x_2:int;
218
	let
219

    
220
		-- transition trace :
221
	--POINT__To__Flowchart1_A_1
222
		(idFlowchart1_A_2, idFlowchart1_Flowchart1_2, x_2) 
223
	= Flowchart1_A_en(idFlowchart1_A_1, idFlowchart1_Flowchart1_1, x_1, false);
224
		
225

    
226
	(idFlowchart1_Flowchart1, idFlowchart1_A, x) 
227
	=  (idFlowchart1_Flowchart1_2, idFlowchart1_A_2, x_2);
228

    
229

    
230
	tel
231

    
232
	until true restart POINTFlowchart1_Flowchart1
233

    
234

    
235

    
236
	state FLOWCHART1_FLOWCHART1_PARALLEL_IDL:
237

    
238
	 var 	idFlowchart1_A_2:int;
239
	x_2:int;
240
	let
241

    
242
		
243

    
244
		(idFlowchart1_A_2, x_2)
245
	= if not (idFlowchart1_A_1= 0 ) then Flowchart1_A_node(idFlowchart1_A_1, x_1)
246

    
247
		 else (idFlowchart1_A_1, x_1);
248

    
249
		
250

    
251
		
252

    
253
	(idFlowchart1_Flowchart1, idFlowchart1_A, x) 
254
	= (idFlowchart1_Flowchart1_1, idFlowchart1_A_2, x_2);
255
	
256

    
257
	tel
258

    
259
	until true restart POINTFlowchart1_Flowchart1
260

    
261

    
262

    
263
tel
264

    
265

    
266
--***************************************************State :Flowchart1_Flowchart1 Automaton***************************************************
267

    
268
node Flowchart1_Flowchart1(noInput :bool)
269

    
270
returns (x:int);
271

    
272

    
273
var x_1: int;
274

    
275
	idFlowchart1_Flowchart1, idFlowchart1_Flowchart1_1: int;
276

    
277
	idFlowchart1_A, idFlowchart1_A_1: int;
278

    
279
	let
280

    
281
	x_1 = 0 -> pre x;
282

    
283
	idFlowchart1_Flowchart1_1 = 0 -> pre idFlowchart1_Flowchart1;
284

    
285
	idFlowchart1_A_1 = 0 -> pre idFlowchart1_A;
286

    
287
	
288

    
289

    
290

    
291
	(idFlowchart1_Flowchart1, idFlowchart1_A, x)
292
	 = Flowchart1_Flowchart1_node(idFlowchart1_Flowchart1_1, idFlowchart1_A_1, x_1);
293

    
294

    
295
--unused outputs
296
	
297

    
298
tel
299

    
300

    
301

    
302
node Flowchart1 (i_virtual : real)
303
returns (Out1_1_1 : int); 
304
var
305
	Flowchart1_1_1 : int;
306
	i_virtual_local : real;
307
let 
308
	Flowchart1_1_1 =  Flowchart1_Flowchart1(true);
309
	Out1_1_1 = Flowchart1_1_1;
310
	i_virtual_local= 0.0 -> 1.0;
311
tel
312