Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec-tests / regression_tests / lustre_files / success / Stateflow / src_Single1 / Single1.lus @ eb639349

History | View | Annotate | Download (2.49 KB)

1
-- This file has been generated by cocoSim
2

    
3

    
4
-- System nodes
5

    
6

    
7

    
8

    
9
--During action for state :Single1_A
10
node Single1_A_du(x_1:real)
11

    
12
returns (x:real);
13

    
14

    
15
var 	x_2:real;
16

    
17

    
18
let
19

    
20

    
21

    
22
	x_2 
23
	=  x_1  + 1.;
24
	
25

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

    
30
tel
31

    
32

    
33

    
34

    
35

    
36
-- Entry action for state :Single1_A
37
node Single1_A_en(idSingle1_Single1_1:int;
38
	isInner:bool)
39

    
40
returns (idSingle1_Single1:int);
41

    
42

    
43
var 	idSingle1_Single1_2:int;
44

    
45

    
46
let
47

    
48

    
49

    
50
	-- set state as active 
51
	idSingle1_Single1_2 
52
	= 1790;
53
	
54

    
55
	(idSingle1_Single1) 
56
	= (idSingle1_Single1_2);
57
	
58

    
59
tel
60

    
61

    
62

    
63

    
64

    
65
-- Exit action for state :Single1_A
66
node Single1_A_ex(idSingle1_Single1_1:int;
67
	isInner:bool)
68

    
69
returns (idSingle1_Single1:int);
70

    
71

    
72
var 	idSingle1_Single1_2:int;
73

    
74

    
75
let
76

    
77

    
78

    
79
	-- set state as inactive 
80
	idSingle1_Single1_2
81
	 = if (not isInner) then 0 else idSingle1_Single1_1;
82

    
83

    
84
	(idSingle1_Single1) 
85
	= (idSingle1_Single1_1);
86
	
87

    
88
tel
89

    
90

    
91
--***************************************************State :Single1_Single1 Automaton***************************************************
92

    
93
node Single1_Single1_node(idSingle1_Single1_1:int;
94
	x_1:real)
95

    
96
returns (idSingle1_Single1:int;
97
	x:real);
98

    
99

    
100
let
101

    
102
	 automaton single1_single1
103

    
104
	state POINTSingle1_Single1:
105
	unless (idSingle1_Single1_1=0) restart POINT__TO__SINGLE1_A_1
106

    
107

    
108

    
109
	unless (idSingle1_Single1_1=1790) restart SINGLE1_A_IDL
110

    
111
	let
112

    
113
		(idSingle1_Single1, x) 
114
	= (idSingle1_Single1_1, x_1);
115
	
116

    
117
	tel
118

    
119

    
120

    
121
	state POINT__TO__SINGLE1_A_1:
122

    
123
	 var 	idSingle1_Single1_2:int;
124
	let
125

    
126
		-- transition trace :
127
	--POINT__To__Single1_A_1
128
		(idSingle1_Single1_2) 
129
	= Single1_A_en(idSingle1_Single1_1, false);
130
		
131

    
132
	(idSingle1_Single1) 
133
	=  (idSingle1_Single1_2);
134

    
135
	--add unused variables
136
	(x) 
137
	= (x_1);
138
	
139

    
140
	tel
141

    
142
	until true restart POINTSingle1_Single1
143

    
144

    
145

    
146
	state SINGLE1_A_IDL:
147

    
148
	 var 	x_2:real;
149
	let
150

    
151
		
152
	(x_2) 
153
	= Single1_A_du(x_1);
154

    
155
		
156

    
157

    
158
	(idSingle1_Single1, x) 
159
	= (idSingle1_Single1_1, x_2);
160
	
161

    
162
	tel
163

    
164
	until true restart POINTSingle1_Single1
165

    
166

    
167

    
168
tel
169

    
170

    
171
--***************************************************State :Single1_Single1 Automaton***************************************************
172

    
173
node Single1_Single1(noInput :bool)
174

    
175
returns (x:real);
176

    
177

    
178
var x_1: real;
179

    
180
	idSingle1_Single1, idSingle1_Single1_1: int;
181

    
182
	let
183

    
184
	x_1 = 0.0 -> pre x;
185

    
186
	idSingle1_Single1_1 = 0 -> pre idSingle1_Single1;
187

    
188
	
189

    
190

    
191

    
192
	(idSingle1_Single1, x)
193
	 = Single1_Single1_node(idSingle1_Single1_1, x_1);
194

    
195

    
196
--unused outputs
197
	
198

    
199
tel
200

    
201

    
202

    
203
node Single1 (i_virtual : real)
204
returns (x_1_1 : real); 
205
var
206
	Single1_1_1 : real;
207
	i_virtual_local : real;
208
let 
209
	Single1_1_1 =  Single1_Single1(true);
210
	x_1_1 = Single1_1_1;
211
	i_virtual_local= 0.0 -> 1.0;
212
tel
213