Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec-tests / regression_tests / lustre_files / success / Stateflow / src_Hierarchy4 / Hierarchy4.lus @ eb639349

History | View | Annotate | Download (4.1 KB)

1
-- This file has been generated by cocoSim
2

    
3

    
4
-- System nodes
5

    
6

    
7

    
8

    
9

    
10

    
11
-- Entry action for state :Hierarchy4_B
12
node Hierarchy4_B_en(idHierarchy4_Hierarchy4_1:int;
13
	y_1:int;
14
	isInner:bool)
15

    
16
returns (idHierarchy4_Hierarchy4:int;
17
	y:int);
18

    
19

    
20
var 	idHierarchy4_Hierarchy4_2:int;
21
	y_2:int;
22

    
23

    
24
let
25

    
26

    
27

    
28
	-- set state as active 
29
	idHierarchy4_Hierarchy4_2 
30
	= 1022;
31
	
32

    
33
	y_2 
34
	= if (not isInner) then 2
35
	 else y_1;
36
	
37

    
38
	(idHierarchy4_Hierarchy4, y) 
39
	= (idHierarchy4_Hierarchy4_2, y_2);
40
	
41

    
42
tel
43

    
44

    
45

    
46

    
47

    
48
-- Exit action for state :Hierarchy4_B
49
node Hierarchy4_B_ex(idHierarchy4_Hierarchy4_1:int;
50
	isInner:bool)
51

    
52
returns (idHierarchy4_Hierarchy4:int);
53

    
54

    
55
var 	idHierarchy4_Hierarchy4_2:int;
56

    
57

    
58
let
59

    
60

    
61

    
62
	-- set state as inactive 
63
	idHierarchy4_Hierarchy4_2
64
	 = if (not isInner) then 0 else idHierarchy4_Hierarchy4_1;
65

    
66

    
67
	(idHierarchy4_Hierarchy4) 
68
	= (idHierarchy4_Hierarchy4_1);
69
	
70

    
71
tel
72

    
73

    
74

    
75

    
76

    
77

    
78
-- Entry action for state :Hierarchy4_A
79
node Hierarchy4_A_en(idHierarchy4_Hierarchy4_1:int;
80
	y_1:int;
81
	isInner:bool)
82

    
83
returns (idHierarchy4_Hierarchy4:int;
84
	y:int);
85

    
86

    
87
var 	idHierarchy4_Hierarchy4_2:int;
88
	y_2:int;
89

    
90

    
91
let
92

    
93

    
94

    
95
	-- set state as active 
96
	idHierarchy4_Hierarchy4_2 
97
	= 1021;
98
	
99

    
100
	y_2 
101
	= if (not isInner) then 1
102
	 else y_1;
103
	
104

    
105
	(idHierarchy4_Hierarchy4, y) 
106
	= (idHierarchy4_Hierarchy4_2, y_2);
107
	
108

    
109
tel
110

    
111

    
112

    
113

    
114

    
115
-- Exit action for state :Hierarchy4_A
116
node Hierarchy4_A_ex(idHierarchy4_Hierarchy4_1:int;
117
	isInner:bool)
118

    
119
returns (idHierarchy4_Hierarchy4:int);
120

    
121

    
122
var 	idHierarchy4_Hierarchy4_2:int;
123

    
124

    
125
let
126

    
127

    
128

    
129
	-- set state as inactive 
130
	idHierarchy4_Hierarchy4_2
131
	 = if (not isInner) then 0 else idHierarchy4_Hierarchy4_1;
132

    
133

    
134
	(idHierarchy4_Hierarchy4) 
135
	= (idHierarchy4_Hierarchy4_1);
136
	
137

    
138
tel
139

    
140

    
141
--***************************************************State :Hierarchy4_Hierarchy4 Automaton***************************************************
142

    
143
node Hierarchy4_Hierarchy4_node(idHierarchy4_Hierarchy4_1:int;
144
	x:int;
145
	y_1:int)
146

    
147
returns (idHierarchy4_Hierarchy4:int;
148
	y:int);
149

    
150

    
151
let
152

    
153
	 automaton hierarchy4_hierarchy4
154

    
155
	state POINTHierarchy4_Hierarchy4:
156
	unless (idHierarchy4_Hierarchy4_1=0) and ( x=0 ) restart POINT__TO__HIERARCHY4_A_1
157

    
158

    
159

    
160
	unless (idHierarchy4_Hierarchy4_1=0) and ( x!=0 ) restart POINT__TO__HIERARCHY4_B_2
161

    
162

    
163

    
164
	unless (idHierarchy4_Hierarchy4_1=1021) restart HIERARCHY4_A_IDL
165

    
166
	unless (idHierarchy4_Hierarchy4_1=1022) restart HIERARCHY4_B_IDL
167

    
168
	let
169

    
170
		(idHierarchy4_Hierarchy4, y) 
171
	= (idHierarchy4_Hierarchy4_1, y_1);
172
	
173

    
174
	tel
175

    
176

    
177

    
178
	state POINT__TO__HIERARCHY4_A_1:
179

    
180
	 var 	idHierarchy4_Hierarchy4_2:int;
181
	y_2:int;
182
	let
183

    
184
		-- transition trace :
185
	--POINT__To__Hierarchy4_A_1
186
		(idHierarchy4_Hierarchy4_2, y_2) 
187
	= Hierarchy4_A_en(idHierarchy4_Hierarchy4_1, y_1, false);
188
		
189

    
190
	(idHierarchy4_Hierarchy4, y) 
191
	=  (idHierarchy4_Hierarchy4_2, y_2);
192

    
193

    
194
	tel
195

    
196
	until true restart POINTHierarchy4_Hierarchy4
197

    
198

    
199

    
200
	state POINT__TO__HIERARCHY4_B_2:
201

    
202
	 var 	idHierarchy4_Hierarchy4_2:int;
203
	y_2:int;
204
	let
205

    
206
		-- transition trace :
207
	--POINT__To__Hierarchy4_B_2
208
		(idHierarchy4_Hierarchy4_2, y_2) 
209
	= Hierarchy4_B_en(idHierarchy4_Hierarchy4_1, y_1, false);
210
		
211

    
212
	(idHierarchy4_Hierarchy4, y) 
213
	=  (idHierarchy4_Hierarchy4_2, y_2);
214

    
215

    
216
	tel
217

    
218
	until true restart POINTHierarchy4_Hierarchy4
219

    
220

    
221

    
222
	state HIERARCHY4_A_IDL:
223

    
224
	 	let
225

    
226
		
227

    
228
	(idHierarchy4_Hierarchy4, y) 
229
	= (idHierarchy4_Hierarchy4_1, y_1);
230
	
231

    
232
	tel
233

    
234
	until true restart POINTHierarchy4_Hierarchy4
235

    
236

    
237

    
238
	state HIERARCHY4_B_IDL:
239

    
240
	 	let
241

    
242
		
243

    
244
	(idHierarchy4_Hierarchy4, y) 
245
	= (idHierarchy4_Hierarchy4_1, y_1);
246
	
247

    
248
	tel
249

    
250
	until true restart POINTHierarchy4_Hierarchy4
251

    
252

    
253

    
254
tel
255

    
256

    
257
--***************************************************State :Hierarchy4_Hierarchy4 Automaton***************************************************
258

    
259
node Hierarchy4_Hierarchy4(x:int)
260

    
261
returns (y:int);
262

    
263

    
264
var y_1: int;
265

    
266
	idHierarchy4_Hierarchy4, idHierarchy4_Hierarchy4_1: int;
267

    
268
	let
269

    
270
	y_1 = 0 -> pre y;
271

    
272
	idHierarchy4_Hierarchy4_1 = 0 -> pre idHierarchy4_Hierarchy4;
273

    
274
	
275

    
276

    
277

    
278
	(idHierarchy4_Hierarchy4, y)
279
	 = Hierarchy4_Hierarchy4_node(idHierarchy4_Hierarchy4_1, x, y_1);
280

    
281

    
282
--unused outputs
283
	
284

    
285
tel
286

    
287

    
288

    
289
node Hierarchy4 (In1_1_1 : int)
290
returns (Out1_1_1 : int); 
291
var
292
	Hierarchy4_1_1 : int;
293
	i_virtual_local : real;
294
let 
295
	Hierarchy4_1_1 =  Hierarchy4_Hierarchy4(In1_1_1);
296
	Out1_1_1 = Hierarchy4_1_1;
297
	i_virtual_local= 0.0 -> 1.0;
298
tel
299