First NIT release and new clean mercurial repository
[nit.git] / c_src / partial_order._sep.c
1 #include "partial_order._sep.h"
2 val_t partial_order___PartialOrder___roots(val_t self) {
3 struct trace_t trace = {NULL, "partial_order::PartialOrder::roots (src/metamodel//partial_order.nit:30,2--31:30)"};
4 trace.prev = tracehead; tracehead = &trace;
5 tracehead = trace.prev;
6 return ATTR_partial_order___PartialOrder____roots( self) /*PartialOrder::_roots*/;
7 }
8 val_t partial_order___PartialOrder___is_empty(val_t self) {
9 struct trace_t trace = {NULL, "partial_order::PartialOrder::is_empty (src/metamodel//partial_order.nit:35,2--49)"};
10 val_t variable0;
11 trace.prev = tracehead; tracehead = &trace;
12 variable0 = ATTR_partial_order___PartialOrder____elements( self) /*PartialOrder::_elements*/;
13 variable0 = ((abstract_collection___Collection___is_empty_t)CALL(variable0,COLOR_abstract_collection___Collection___is_empty))(variable0) /*Map::is_empty*/;
14 goto return_label0;
15 return_label0: while(false);
16 tracehead = trace.prev;
17 return variable0;
18 }
19 val_t partial_order___PartialOrder___length(val_t self) {
20 struct trace_t trace = {NULL, "partial_order::PartialOrder::length (src/metamodel//partial_order.nit:37,2--45)"};
21 val_t variable0;
22 trace.prev = tracehead; tracehead = &trace;
23 variable0 = ATTR_partial_order___PartialOrder____elements( self) /*PartialOrder::_elements*/;
24 variable0 = ((abstract_collection___Collection___length_t)CALL(variable0,COLOR_abstract_collection___Collection___length))(variable0) /*Map::length*/;
25 goto return_label1;
26 return_label1: while(false);
27 tracehead = trace.prev;
28 return variable0;
29 }
30 val_t partial_order___PartialOrder___first(val_t self) {
31 struct trace_t trace = {NULL, "partial_order::PartialOrder::first (src/metamodel//partial_order.nit:39,2--48)"};
32 val_t variable0;
33 trace.prev = tracehead; tracehead = &trace;
34 variable0 = ATTR_partial_order___PartialOrder____elements_list( self) /*PartialOrder::_elements_list*/;
35 variable0 = ((abstract_collection___IndexedCollection___first_t)CALL(variable0,COLOR_abstract_collection___Collection___first))(variable0) /*Array::first*/;
36 goto return_label2;
37 return_label2: while(false);
38 tracehead = trace.prev;
39 return variable0;
40 }
41 val_t partial_order___PartialOrder___has(val_t self, val_t param0) {
42 struct trace_t trace = {NULL, "partial_order::PartialOrder::has (src/metamodel//partial_order.nit:41,2--48)"};
43 val_t variable0;
44 val_t variable1;
45 trace.prev = tracehead; tracehead = &trace;
46 variable0 = param0;
47 variable1 = ATTR_partial_order___PartialOrder____elements( self) /*PartialOrder::_elements*/;
48 variable1 = ((abstract_collection___Map___has_key_t)CALL(variable1,COLOR_abstract_collection___Map___has_key))(variable1, variable0 /*e*/) /*Map::has_key*/;
49 goto return_label3;
50 return_label3: while(false);
51 tracehead = trace.prev;
52 return variable1;
53 }
54 val_t partial_order___PartialOrder___has_only(val_t self, val_t param0) {
55 struct trace_t trace = {NULL, "partial_order::PartialOrder::has_only (src/metamodel//partial_order.nit:43,2--80)"};
56 val_t variable0;
57 val_t variable1;
58 val_t variable2;
59 trace.prev = tracehead; tracehead = &trace;
60 variable0 = param0;
61 variable1 = ATTR_partial_order___PartialOrder____elements( self) /*PartialOrder::_elements*/;
62 variable1 = ((abstract_collection___Collection___length_t)CALL(variable1,COLOR_abstract_collection___Collection___length))(variable1) /*Map::length*/;
63 variable1 = TAG_Bool((variable1)==( TAG_Int(1)));
64 variable2 = variable1;
65 if (UNTAG_Bool(variable2)) { /* and */
66 variable2 = ATTR_partial_order___PartialOrder____elements( self) /*PartialOrder::_elements*/;
67 variable2 = ((abstract_collection___Collection___first_t)CALL(variable2,COLOR_abstract_collection___Collection___first))(variable2) /*Map::first*/;
68 variable2 = TAG_Bool((variable2 == variable0 /*e*/) || ((variable2 != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL(variable2,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN(variable2, variable0 /*e*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL(variable2,COLOR_kernel___Object_____eqeq))(variable2, variable0 /*e*/) /*PartialOrderElement::==*/)))));
69 }
70 variable1 = variable2;
71 goto return_label4;
72 return_label4: while(false);
73 tracehead = trace.prev;
74 return variable1;
75 }
76 val_t partial_order___PartialOrder___count(val_t self, val_t param0) {
77 struct trace_t trace = {NULL, "partial_order::PartialOrder::count (src/metamodel//partial_order.nit:45,2--50:11)"};
78 val_t variable0;
79 val_t variable1;
80 trace.prev = tracehead; tracehead = &trace;
81 variable0 = param0;
82 variable1 = ((partial_order___PartialOrder___has_t)CALL( self,COLOR_abstract_collection___Collection___has))( self, variable0 /*e*/) /*PartialOrder::has*/;
83 if (UNTAG_Bool(variable1)) { /*if*/
84 variable1 = TAG_Int(1);
85 goto return_label5;
86 } else { /*if*/
87 variable1 = TAG_Int(0);
88 goto return_label5;
89 }
90 return_label5: while(false);
91 tracehead = trace.prev;
92 return variable1;
93 }
94 val_t partial_order___PartialOrder___iterator(val_t self) {
95 struct trace_t trace = {NULL, "partial_order::PartialOrder::iterator (src/metamodel//partial_order.nit:54,2--54)"};
96 val_t variable0;
97 trace.prev = tracehead; tracehead = &trace;
98 variable0 = ATTR_partial_order___PartialOrder____elements_list( self) /*PartialOrder::_elements_list*/;
99 variable0 = ((array___AbstractArray___iterator_t)CALL(variable0,COLOR_abstract_collection___Collection___iterator))(variable0) /*Array::iterator*/;
100 goto return_label6;
101 return_label6: while(false);
102 tracehead = trace.prev;
103 return variable0;
104 }
105 val_t partial_order___PartialOrder_____bra(val_t self, val_t param0) {
106 struct trace_t trace = {NULL, "partial_order::PartialOrder::[] (src/metamodel//partial_order.nit:58,2--64:14)"};
107 val_t variable0;
108 val_t variable1;
109 trace.prev = tracehead; tracehead = &trace;
110 variable0 = param0;
111 variable1 = ATTR_partial_order___PartialOrder____elements( self) /*PartialOrder::_elements*/;
112 variable1 = ((abstract_collection___Map___has_key_t)CALL(variable1,COLOR_abstract_collection___Map___has_key))(variable1, variable0 /*e*/) /*Map::has_key*/;
113 if (UNTAG_Bool(variable1)) { /*if*/
114 variable1 = ATTR_partial_order___PartialOrder____elements( self) /*PartialOrder::_elements*/;
115 variable1 = ((abstract_collection___Map_____bra_t)CALL(variable1,COLOR_abstract_collection___Map_____bra))(variable1, variable0 /*e*/) /*Map::[]*/;
116 goto return_label7;
117 } else { /*if*/
118 variable1 = NIT_NULL /*null*/;
119 goto return_label7;
120 }
121 return_label7: while(false);
122 tracehead = trace.prev;
123 return variable1;
124 }
125 val_t partial_order___PartialOrder___to_dot(val_t self) {
126 struct trace_t trace = {NULL, "partial_order::PartialOrder::to_dot (src/metamodel//partial_order.nit:68,2--80:10)"};
127 val_t variable0;
128 val_t variable1;
129 val_t variable2;
130 val_t variable3;
131 val_t variable4;
132 val_t variable5;
133 trace.prev = tracehead; tracehead = &trace;
134 variable1 = NEW_string___String___init(); /*new String*/
135 variable0 = variable1;
136 variable1 = ((partial_order___PartialOrder___to_dot_header_t)CALL( self,COLOR_partial_order___PartialOrder___to_dot_header))( self) /*PartialOrder::to_dot_header*/;
137 ((string___String___append_t)CALL( variable0 /*s*/,COLOR_abstract_collection___IndexedCollection___append))( variable0 /*s*/, variable1) /*String::append*/;
138 variable1 = ATTR_partial_order___PartialOrder____elements( self) /*PartialOrder::_elements*/;
139 variable1 = ((abstract_collection___Map___iterator_t)CALL(variable1,COLOR_abstract_collection___Collection___iterator))(variable1) /*Map::iterator*/;
140 while (true) { /*for*/
141 variable2 = ((abstract_collection___Iterator___is_ok_t)CALL(variable1,COLOR_abstract_collection___Iterator___is_ok))(variable1) /*MapIterator::is_ok*/;
142 if (!UNTAG_Bool(variable2)) break; /*for*/
143 variable2 = ((abstract_collection___Iterator___item_t)CALL(variable1,COLOR_abstract_collection___Iterator___item))(variable1) /*MapIterator::item*/;
144 variable3 = ((partial_order___PartialOrderElement___value_t)CALL( variable2 /*e*/,COLOR_partial_order___PartialOrderElement___value))( variable2 /*e*/) /*PartialOrderElement::value*/;
145 variable3 = ((partial_order___PartialOrder___to_dot_node_t)CALL( self,COLOR_partial_order___PartialOrder___to_dot_node))( self, variable3) /*PartialOrder::to_dot_node*/;
146 ((string___String___append_t)CALL( variable0 /*s*/,COLOR_abstract_collection___IndexedCollection___append))( variable0 /*s*/, variable3) /*String::append*/;
147 variable3 = ((partial_order___PartialOrderElement___direct_greaters_t)CALL( variable2 /*e*/,COLOR_partial_order___PartialOrderElement___direct_greaters))( variable2 /*e*/) /*PartialOrderElement::direct_greaters*/;
148 variable3 = ((array___AbstractArray___iterator_t)CALL(variable3,COLOR_abstract_collection___Collection___iterator))(variable3) /*Array::iterator*/;
149 while (true) { /*for*/
150 variable4 = ((array___ArrayIterator___is_ok_t)CALL(variable3,COLOR_abstract_collection___Iterator___is_ok))(variable3) /*ArrayIterator::is_ok*/;
151 if (!UNTAG_Bool(variable4)) break; /*for*/
152 variable4 = ((array___ArrayIterator___item_t)CALL(variable3,COLOR_abstract_collection___Iterator___item))(variable3) /*ArrayIterator::item*/;
153 variable5 = ((partial_order___PartialOrderElement___value_t)CALL( variable2 /*e*/,COLOR_partial_order___PartialOrderElement___value))( variable2 /*e*/) /*PartialOrderElement::value*/;
154 variable5 = ((partial_order___PartialOrder___to_dot_edge_t)CALL( self,COLOR_partial_order___PartialOrder___to_dot_edge))( self, variable5, variable4 /*d*/) /*PartialOrder::to_dot_edge*/;
155 ((string___String___append_t)CALL( variable0 /*s*/,COLOR_abstract_collection___IndexedCollection___append))( variable0 /*s*/, variable5) /*String::append*/;
156 continue_10: while(0);
157 ((array___ArrayIterator___next_t)CALL(variable3,COLOR_abstract_collection___Iterator___next))(variable3) /*ArrayIterator::next*/;
158 }
159 break_10: while(0);
160 continue_9: while(0);
161 ((abstract_collection___Iterator___next_t)CALL(variable1,COLOR_abstract_collection___Iterator___next))(variable1) /*MapIterator::next*/;
162 }
163 break_9: while(0);
164 variable1 = NEW_string___String___with_native(BOX_NativeString("}\n"), TAG_Int(2)); /*new String*/
165 ((string___String___append_t)CALL( variable0 /*s*/,COLOR_abstract_collection___IndexedCollection___append))( variable0 /*s*/, variable1) /*String::append*/;
166 variable0 = variable0 /*s*/;
167 goto return_label8;
168 return_label8: while(false);
169 tracehead = trace.prev;
170 return variable0;
171 }
172 val_t partial_order___PartialOrder___to_dot_header(val_t self) {
173 struct trace_t trace = {NULL, "partial_order::PartialOrder::to_dot_header (src/metamodel//partial_order.nit:83,2--86:46)"};
174 val_t variable0;
175 trace.prev = tracehead; tracehead = &trace;
176 variable0 = NEW_string___String___with_native(BOX_NativeString("digraph G {\ngraph [rankdir=BT];\n"), TAG_Int(32)); /*new String*/
177 goto return_label11;
178 return_label11: while(false);
179 tracehead = trace.prev;
180 return variable0;
181 }
182 val_t partial_order___PartialOrder___to_dot_node(val_t self, val_t param0) {
183 struct trace_t trace = {NULL, "partial_order::PartialOrder::to_dot_node (src/metamodel//partial_order.nit:89,2--92:21)"};
184 val_t variable0;
185 val_t variable1;
186 val_t variable2;
187 val_t variable3;
188 val_t variable4;
189 val_t variable5;
190 val_t variable6;
191 trace.prev = tracehead; tracehead = &trace;
192 variable0 = param0;
193 variable1 = NEW_string___String___init(); /*new String*/
194 variable2 = NEW_string___String___with_native(BOX_NativeString("\""), TAG_Int(1)); /*new String*/
195 variable3 = variable2;
196 ((string___String___append_t)CALL(variable1,COLOR_abstract_collection___IndexedCollection___append))(variable1, variable3) /*String::append*/;
197 variable4 = variable0 /*e*/;
198 variable4 = ((string___String___to_s_t)CALL(variable4,COLOR_string___Object___to_s))(variable4) /*String::to_s*/;
199 ((string___String___append_t)CALL(variable1,COLOR_abstract_collection___IndexedCollection___append))(variable1, variable4) /*String::append*/;
200 variable5 = NEW_string___String___with_native(BOX_NativeString("\";\n"), TAG_Int(3)); /*new String*/
201 variable6 = variable5;
202 ((string___String___append_t)CALL(variable1,COLOR_abstract_collection___IndexedCollection___append))(variable1, variable6) /*String::append*/;
203 goto return_label12;
204 return_label12: while(false);
205 tracehead = trace.prev;
206 return variable1;
207 }
208 val_t partial_order___PartialOrder___to_dot_edge(val_t self, val_t param0, val_t param1) {
209 struct trace_t trace = {NULL, "partial_order::PartialOrder::to_dot_edge (src/metamodel//partial_order.nit:95,2--98:34)"};
210 val_t variable0;
211 val_t variable1;
212 val_t variable2;
213 val_t variable3;
214 val_t variable4;
215 val_t variable5;
216 val_t variable6;
217 val_t variable7;
218 val_t variable8;
219 val_t variable9;
220 val_t variable10;
221 trace.prev = tracehead; tracehead = &trace;
222 variable0 = param0;
223 variable1 = param1;
224 variable2 = NEW_string___String___init(); /*new String*/
225 variable3 = NEW_string___String___with_native(BOX_NativeString("\""), TAG_Int(1)); /*new String*/
226 variable4 = variable3;
227 ((string___String___append_t)CALL(variable2,COLOR_abstract_collection___IndexedCollection___append))(variable2, variable4) /*String::append*/;
228 variable5 = variable0 /*e1*/;
229 variable5 = ((string___String___to_s_t)CALL(variable5,COLOR_string___Object___to_s))(variable5) /*String::to_s*/;
230 ((string___String___append_t)CALL(variable2,COLOR_abstract_collection___IndexedCollection___append))(variable2, variable5) /*String::append*/;
231 variable6 = NEW_string___String___with_native(BOX_NativeString("\" -> \""), TAG_Int(6)); /*new String*/
232 variable7 = variable6;
233 ((string___String___append_t)CALL(variable2,COLOR_abstract_collection___IndexedCollection___append))(variable2, variable7) /*String::append*/;
234 variable8 = variable1 /*e2*/;
235 variable8 = ((string___String___to_s_t)CALL(variable8,COLOR_string___Object___to_s))(variable8) /*String::to_s*/;
236 ((string___String___append_t)CALL(variable2,COLOR_abstract_collection___IndexedCollection___append))(variable2, variable8) /*String::append*/;
237 variable9 = NEW_string___String___with_native(BOX_NativeString("\";\n"), TAG_Int(3)); /*new String*/
238 variable10 = variable9;
239 ((string___String___append_t)CALL(variable2,COLOR_abstract_collection___IndexedCollection___append))(variable2, variable10) /*String::append*/;
240 goto return_label13;
241 return_label13: while(false);
242 tracehead = trace.prev;
243 return variable2;
244 }
245 val_t partial_order___PartialOrder___select_smallests(val_t self, val_t param0) {
246 struct trace_t trace = {NULL, "partial_order::PartialOrder::select_smallests (src/metamodel//partial_order.nit:101,2--119:12)"};
247 val_t variable0;
248 val_t variable1;
249 val_t variable2;
250 val_t variable3;
251 val_t variable4;
252 val_t variable5;
253 val_t variable6;
254 trace.prev = tracehead; tracehead = &trace;
255 variable0 = param0;
256 variable1 = TAG_Bool(( variable0 /*c*/ == NIT_NULL /*null*/) || (( variable0 /*c*/ != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL( variable0 /*c*/,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable0 /*c*/, NIT_NULL /*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL( variable0 /*c*/,COLOR_kernel___Object_____eqeq))( variable0 /*c*/, NIT_NULL /*null*/) /*Collection::==*/)))));
257 if (UNTAG_Bool(variable1)) { /*if*/
258 variable1 = NEW_array___Array___init(); /*new Array[E]*/
259 goto return_label14;
260 }
261 variable1 = ((partial_order___PartialOrder___has_all_t)CALL( self,COLOR_partial_order___PartialOrder___has_all))( self, variable0 /*c*/) /*PartialOrder::has_all*/;
262 if (!UNTAG_Bool(variable1)) { fprintf(stderr, "Assert failed: src/metamodel//partial_order.nit:105,3--18\n"); nit_exit(1);}
263 variable2 = ((abstract_collection___Collection___length_t)CALL( variable0 /*c*/,COLOR_abstract_collection___Collection___length))( variable0 /*c*/) /*Collection::length*/;
264 variable3 = NEW_array___Array___with_capacity(variable2); /*new Array[E]*/
265 variable2 = variable3;
266 variable1 = variable2;
267 variable3 = ((abstract_collection___Collection___length_t)CALL( variable0 /*c*/,COLOR_abstract_collection___Collection___length))( variable0 /*c*/) /*Collection::length*/;
268 variable4 = NEW_array___Array___with_capacity(variable3); /*new Array[E]*/
269 variable3 = variable4;
270 variable2 = variable3;
271 variable3 = ((abstract_collection___Collection___iterator_t)CALL( variable0 /*c*/,COLOR_abstract_collection___Collection___iterator))( variable0 /*c*/) /*Collection::iterator*/;
272 while (true) { /*for*/
273 variable4 = ((abstract_collection___Iterator___is_ok_t)CALL(variable3,COLOR_abstract_collection___Iterator___is_ok))(variable3) /*Iterator::is_ok*/;
274 if (!UNTAG_Bool(variable4)) break; /*for*/
275 variable4 = ((abstract_collection___Iterator___item_t)CALL(variable3,COLOR_abstract_collection___Iterator___item))(variable3) /*Iterator::item*/;
276 variable6 = ((partial_order___PartialOrder___add_to_smallests_t)CALL( self,COLOR_partial_order___PartialOrder___add_to_smallests))( self, variable4 /*e*/, variable1 /*res*/, variable2 /*tmp*/) /*PartialOrder::add_to_smallests*/;
277 variable5 = variable6;
278 if (UNTAG_Bool( variable5 /*r*/)) { /*if*/
279 variable6 = variable2 /*tmp*/;
280 variable2 = variable1 /*res*/ /*tmp=*/;
281 variable1 = variable6 /*t*/ /*res=*/;
282 }
283 continue_15: while(0);
284 ((abstract_collection___Iterator___next_t)CALL(variable3,COLOR_abstract_collection___Iterator___next))(variable3) /*Iterator::next*/;
285 }
286 break_15: while(0);
287 variable1 = variable1 /*res*/;
288 goto return_label14;
289 return_label14: while(false);
290 tracehead = trace.prev;
291 return variable1;
292 }
293 val_t partial_order___PartialOrder___add(val_t self, val_t param0, val_t param1) {
294 struct trace_t trace = {NULL, "partial_order::PartialOrder::add (src/metamodel//partial_order.nit:122,2--134:12)"};
295 val_t variable0;
296 val_t variable1;
297 val_t variable2;
298 val_t variable3;
299 val_t variable4;
300 val_t variable5;
301 trace.prev = tracehead; tracehead = &trace;
302 variable0 = param0;
303 variable1 = param1;
304 variable2 = ((partial_order___PartialOrder___has_t)CALL( self,COLOR_abstract_collection___Collection___has))( self, variable0 /*e*/) /*PartialOrder::has*/;
305 if (!UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable2)))) { fprintf(stderr, "Assert failed: src/metamodel//partial_order.nit:125,3--18\n"); nit_exit(1);}
306 variable2 = TAG_Bool(( variable1 /*supers*/ == NIT_NULL /*null*/) || (( variable1 /*supers*/ != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL( variable1 /*supers*/,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable1 /*supers*/, NIT_NULL /*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL( variable1 /*supers*/,COLOR_kernel___Object_____eqeq))( variable1 /*supers*/, NIT_NULL /*null*/) /*Collection::==*/)))));
307 variable3 = variable2;
308 if (!UNTAG_Bool(variable3)) { /* or */
309 variable3 = ((partial_order___PartialOrder___has_all_t)CALL( self,COLOR_partial_order___PartialOrder___has_all))( self, variable1 /*supers*/) /*PartialOrder::has_all*/;
310 }
311 variable2 = variable3;
312 if (!UNTAG_Bool(variable2)) { fprintf(stderr, "Assert failed: src/metamodel//partial_order.nit:126,3--41\n"); nit_exit(1);}
313 variable3 = ((partial_order___PartialOrder___select_smallests_t)CALL( self,COLOR_partial_order___PartialOrder___select_smallests))( self, variable1 /*supers*/) /*PartialOrder::select_smallests*/;
314 variable2 = variable3;
315 variable4 = ((partial_order___PartialOrder___new_poe_t)CALL( self,COLOR_partial_order___PartialOrder___new_poe))( self, variable0 /*e*/, variable2 /*directs*/) /*PartialOrder::new_poe*/;
316 variable3 = variable4;
317 variable4 = ATTR_partial_order___PartialOrder____elements( self) /*PartialOrder::_elements*/;
318 ((abstract_collection___Map_____braeq_t)CALL(variable4,COLOR_abstract_collection___Map_____braeq))(variable4, variable0 /*e*/, variable3 /*poe*/) /*Map::[]=*/;
319 variable4 = ATTR_partial_order___PartialOrder____elements_list( self) /*PartialOrder::_elements_list*/;
320 ((array___AbstractArray___add_t)CALL(variable4,COLOR_abstract_collection___SimpleCollection___add))(variable4, variable0 /*e*/) /*Array::add*/;
321 variable4 = TAG_Bool(( variable1 /*supers*/ == NIT_NULL /*null*/) || (( variable1 /*supers*/ != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL( variable1 /*supers*/,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable1 /*supers*/, NIT_NULL /*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL( variable1 /*supers*/,COLOR_kernel___Object_____eqeq))( variable1 /*supers*/, NIT_NULL /*null*/) /*Collection::==*/)))));
322 variable5 = variable4;
323 if (!UNTAG_Bool(variable5)) { /* or */
324 variable5 = ((abstract_collection___Collection___is_empty_t)CALL( variable1 /*supers*/,COLOR_abstract_collection___Collection___is_empty))( variable1 /*supers*/) /*Collection::is_empty*/;
325 }
326 variable4 = variable5;
327 if (UNTAG_Bool(variable4)) { /*if*/
328 variable4 = ATTR_partial_order___PartialOrder____roots( self) /*PartialOrder::_roots*/;
329 ((array___AbstractArray___add_t)CALL(variable4,COLOR_abstract_collection___SimpleCollection___add))(variable4, variable0 /*e*/) /*Array::add*/;
330 }
331 variable2 = variable3 /*poe*/;
332 goto return_label16;
333 return_label16: while(false);
334 tracehead = trace.prev;
335 return variable2;
336 }
337 val_t partial_order___PartialOrder___has_all(val_t self, val_t param0) {
338 struct trace_t trace = {NULL, "partial_order::PartialOrder::has_all (src/metamodel//partial_order.nit:137,2--145:13)"};
339 val_t variable0;
340 val_t variable1;
341 val_t variable2;
342 val_t variable3;
343 trace.prev = tracehead; tracehead = &trace;
344 variable0 = param0;
345 variable1 = ((abstract_collection___Collection___iterator_t)CALL( variable0 /*e*/,COLOR_abstract_collection___Collection___iterator))( variable0 /*e*/) /*Collection::iterator*/;
346 while (true) { /*for*/
347 variable2 = ((abstract_collection___Iterator___is_ok_t)CALL(variable1,COLOR_abstract_collection___Iterator___is_ok))(variable1) /*Iterator::is_ok*/;
348 if (!UNTAG_Bool(variable2)) break; /*for*/
349 variable2 = ((abstract_collection___Iterator___item_t)CALL(variable1,COLOR_abstract_collection___Iterator___item))(variable1) /*Iterator::item*/;
350 variable3 = ((partial_order___PartialOrder___has_t)CALL( self,COLOR_abstract_collection___Collection___has))( self, variable2 /*i*/) /*PartialOrder::has*/;
351 if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable3)))) { /*if*/
352 variable1 = TAG_Bool(false);
353 goto return_label17;
354 }
355 continue_18: while(0);
356 ((abstract_collection___Iterator___next_t)CALL(variable1,COLOR_abstract_collection___Iterator___next))(variable1) /*Iterator::next*/;
357 }
358 break_18: while(0);
359 variable1 = TAG_Bool(true);
360 goto return_label17;
361 return_label17: while(false);
362 tracehead = trace.prev;
363 return variable1;
364 }
365 val_t partial_order___PartialOrder___new_poe(val_t self, val_t param0, val_t param1) {
366 struct trace_t trace = {NULL, "partial_order::PartialOrder::new_poe (src/metamodel//partial_order.nit:148,2--151:52)"};
367 val_t variable0;
368 val_t variable1;
369 val_t variable2;
370 trace.prev = tracehead; tracehead = &trace;
371 variable0 = param0;
372 variable1 = param1;
373 variable2 = NEW_partial_order___PartialOrderElement___init( self, variable0 /*e*/, variable1 /*directs*/); /*new PartialOrderElement[E]*/
374 goto return_label19;
375 return_label19: while(false);
376 tracehead = trace.prev;
377 return variable2;
378 }
379 val_t partial_order___PartialOrder___add_to_smallests(val_t self, val_t param0, val_t param1, val_t param2) {
380 struct trace_t trace = {NULL, "partial_order::PartialOrder::add_to_smallests (src/metamodel//partial_order.nit:154,2--172:13)"};
381 val_t variable0;
382 val_t variable1;
383 val_t variable2;
384 val_t variable3;
385 val_t variable4;
386 val_t variable5;
387 val_t variable6;
388 trace.prev = tracehead; tracehead = &trace;
389 variable0 = param0;
390 variable1 = param1;
391 variable2 = param2;
392 ((array___AbstractArray___clear_t)CALL( variable2 /*to*/,COLOR_abstract_collection___RemovableCollection___clear))( variable2 /*to*/) /*Array::clear*/;
393 variable4 = ((partial_order___PartialOrder_____bra_t)CALL( self,COLOR_partial_order___PartialOrder_____bra))( self, variable0 /*e*/) /*PartialOrder::[]*/;
394 variable3 = variable4;
395 variable4 = ((array___AbstractArray___iterator_t)CALL( variable1 /*from*/,COLOR_abstract_collection___Collection___iterator))( variable1 /*from*/) /*Array::iterator*/;
396 while (true) { /*for*/
397 variable5 = ((array___ArrayIterator___is_ok_t)CALL(variable4,COLOR_abstract_collection___Iterator___is_ok))(variable4) /*ArrayIterator::is_ok*/;
398 if (!UNTAG_Bool(variable5)) break; /*for*/
399 variable5 = ((array___ArrayIterator___item_t)CALL(variable4,COLOR_abstract_collection___Iterator___item))(variable4) /*ArrayIterator::item*/;
400 variable6 = ((partial_order___PartialOrderElement_____g_t)CALL( variable3 /*poe*/,COLOR_partial_order___PartialOrderElement_____g))( variable3 /*poe*/, variable5 /*i*/) /*PartialOrderElement::>*/;
401 if (UNTAG_Bool(variable6)) { /*if*/
402 variable3 = TAG_Bool(false);
403 goto return_label20;
404 }
405 variable6 = ((partial_order___PartialOrderElement_____l_t)CALL( variable3 /*poe*/,COLOR_partial_order___PartialOrderElement_____l))( variable3 /*poe*/, variable5 /*i*/) /*PartialOrderElement::<*/;
406 if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable6)))) { /*if*/
407 ((array___AbstractArray___add_t)CALL( variable2 /*to*/,COLOR_abstract_collection___SimpleCollection___add))( variable2 /*to*/, variable5 /*i*/) /*Array::add*/;
408 }
409 continue_21: while(0);
410 ((array___ArrayIterator___next_t)CALL(variable4,COLOR_abstract_collection___Iterator___next))(variable4) /*ArrayIterator::next*/;
411 }
412 break_21: while(0);
413 ((array___AbstractArray___add_t)CALL( variable2 /*to*/,COLOR_abstract_collection___SimpleCollection___add))( variable2 /*to*/, variable0 /*e*/) /*Array::add*/;
414 variable3 = TAG_Bool(true);
415 goto return_label20;
416 return_label20: while(false);
417 tracehead = trace.prev;
418 return variable3;
419 }
420 void partial_order___PartialOrder___compute_smallers_for(val_t self, val_t param0, val_t param1) {
421 struct trace_t trace = {NULL, "partial_order::PartialOrder::compute_smallers_for (src/metamodel//partial_order.nit:175,2--180:19)"};
422 val_t variable0;
423 val_t variable1;
424 val_t variable2;
425 val_t variable3;
426 val_t variable4;
427 val_t variable5;
428 trace.prev = tracehead; tracehead = &trace;
429 variable0 = param0;
430 variable1 = param1;
431 variable3 = ((partial_order___PartialOrderElement___value_t)CALL( variable0 /*poe*/,COLOR_partial_order___PartialOrderElement___value))( variable0 /*poe*/) /*PartialOrderElement::value*/;
432 variable2 = variable3;
433 variable3 = ATTR_partial_order___PartialOrder____elements( self) /*PartialOrder::_elements*/;
434 variable3 = ((abstract_collection___Map___iterator_t)CALL(variable3,COLOR_abstract_collection___Collection___iterator))(variable3) /*Map::iterator*/;
435 while (true) { /*for*/
436 variable4 = ((abstract_collection___Iterator___is_ok_t)CALL(variable3,COLOR_abstract_collection___Iterator___is_ok))(variable3) /*MapIterator::is_ok*/;
437 if (!UNTAG_Bool(variable4)) break; /*for*/
438 variable4 = ((abstract_collection___Iterator___item_t)CALL(variable3,COLOR_abstract_collection___Iterator___item))(variable3) /*MapIterator::item*/;
439 variable5 = ((partial_order___PartialOrderElement_____l_t)CALL( variable4 /*s*/,COLOR_partial_order___PartialOrderElement_____l))( variable4 /*s*/, variable2 /*e*/) /*PartialOrderElement::<*/;
440 if (UNTAG_Bool(variable5)) { /*if*/
441 variable5 = ((partial_order___PartialOrderElement___value_t)CALL( variable4 /*s*/,COLOR_partial_order___PartialOrderElement___value))( variable4 /*s*/) /*PartialOrderElement::value*/;
442 ((abstract_collection___SimpleCollection___add_t)CALL( variable1 /*set*/,COLOR_abstract_collection___SimpleCollection___add))( variable1 /*set*/, variable5) /*Set::add*/;
443 }
444 continue_23: while(0);
445 ((abstract_collection___Iterator___next_t)CALL(variable3,COLOR_abstract_collection___Iterator___next))(variable3) /*MapIterator::next*/;
446 }
447 break_23: while(0);
448 tracehead = trace.prev;
449 return;
450 }
451 void partial_order___PartialOrder___init(val_t self, int* init_table) {
452 struct trace_t trace = {NULL, "partial_order::PartialOrder::init (src/metamodel//partial_order.nit:185,2--189:22)"};
453 val_t variable0;
454 trace.prev = tracehead; tracehead = &trace;
455 if (init_table[VAL2OBJ( self)->vft[INIT_TABLE_POS_PartialOrder].i]) return;
456 variable0 = NEW_hash___HashMap___init(); /*new HashMap[E, PartialOrderElement[E]]*/
457 ATTR_partial_order___PartialOrder____elements( self) /*PartialOrder::_elements*/ = variable0;
458 variable0 = NEW_array___Array___init(); /*new Array[E]*/
459 ATTR_partial_order___PartialOrder____elements_list( self) /*PartialOrder::_elements_list*/ = variable0;
460 variable0 = NEW_array___Array___init(); /*new Array[E]*/
461 ATTR_partial_order___PartialOrder____roots( self) /*PartialOrder::_roots*/ = variable0;
462 init_table[VAL2OBJ( self)->vft[INIT_TABLE_POS_PartialOrder].i] = 1;
463 tracehead = trace.prev;
464 return;
465 }
466 val_t partial_order___PartialOrderElement___order(val_t self) {
467 struct trace_t trace = {NULL, "partial_order::PartialOrderElement::order (src/metamodel//partial_order.nit:194,2--195:37)"};
468 trace.prev = tracehead; tracehead = &trace;
469 tracehead = trace.prev;
470 return ATTR_partial_order___PartialOrderElement____order( self) /*PartialOrderElement::_order*/;
471 }
472 val_t partial_order___PartialOrderElement___value(val_t self) {
473 struct trace_t trace = {NULL, "partial_order::PartialOrderElement::value (src/metamodel//partial_order.nit:197,2--198:24)"};
474 trace.prev = tracehead; tracehead = &trace;
475 tracehead = trace.prev;
476 return ATTR_partial_order___PartialOrderElement____value( self) /*PartialOrderElement::_value*/;
477 }
478 val_t partial_order___PartialOrderElement___rank(val_t self) {
479 struct trace_t trace = {NULL, "partial_order::PartialOrderElement::rank (src/metamodel//partial_order.nit:200,2--204:25)"};
480 trace.prev = tracehead; tracehead = &trace;
481 tracehead = trace.prev;
482 return ATTR_partial_order___PartialOrderElement____rank( self) /*PartialOrderElement::_rank*/;
483 }
484 val_t partial_order___PartialOrderElement___direct_greaters(val_t self) {
485 struct trace_t trace = {NULL, "partial_order::PartialOrderElement::direct_greaters (src/metamodel//partial_order.nit:206,2--207:40)"};
486 trace.prev = tracehead; tracehead = &trace;
487 tracehead = trace.prev;
488 return ATTR_partial_order___PartialOrderElement____direct_greaters( self) /*PartialOrderElement::_direct_greaters*/;
489 }
490 val_t partial_order___PartialOrderElement___direct_smallers(val_t self) {
491 struct trace_t trace = {NULL, "partial_order::PartialOrderElement::direct_smallers (src/metamodel//partial_order.nit:209,2--210:40)"};
492 trace.prev = tracehead; tracehead = &trace;
493 tracehead = trace.prev;
494 return ATTR_partial_order___PartialOrderElement____direct_smallers( self) /*PartialOrderElement::_direct_smallers*/;
495 }
496 val_t partial_order___PartialOrderElement___greaters(val_t self) {
497 struct trace_t trace = {NULL, "partial_order::PartialOrderElement::greaters (src/metamodel//partial_order.nit:212,2--213:31)"};
498 trace.prev = tracehead; tracehead = &trace;
499 tracehead = trace.prev;
500 return ATTR_partial_order___PartialOrderElement____greaters( self) /*PartialOrderElement::_greaters*/;
501 }
502 val_t partial_order___PartialOrderElement___greaters_and_self(val_t self) {
503 struct trace_t trace = {NULL, "partial_order::PartialOrderElement::greaters_and_self (src/metamodel//partial_order.nit:218,2--225:33)"};
504 val_t variable0;
505 val_t variable1;
506 trace.prev = tracehead; tracehead = &trace;
507 variable0 = ATTR_partial_order___PartialOrderElement____greaters_and_self_cache( self) /*PartialOrderElement::_greaters_and_self_cache*/;
508 variable0 = TAG_Bool((variable0 == NIT_NULL /*null*/) || ((variable0 != NIT_NULL) && UNTAG_Bool(((array___AbstractArray_____eqeq_t)CALL(variable0,COLOR_kernel___Object_____eqeq))(variable0, NIT_NULL /*null*/) /*Array::==*/)));
509 if (UNTAG_Bool(variable0)) { /*if*/
510 variable0 = ATTR_partial_order___PartialOrderElement____greaters( self) /*PartialOrderElement::_greaters*/;
511 variable0 = ((array___Collection___to_a_t)CALL(variable0,COLOR_array___Collection___to_a))(variable0) /*Set::to_a*/;
512 ATTR_partial_order___PartialOrderElement____greaters_and_self_cache( self) /*PartialOrderElement::_greaters_and_self_cache*/ = variable0;
513 variable0 = ATTR_partial_order___PartialOrderElement____greaters_and_self_cache( self) /*PartialOrderElement::_greaters_and_self_cache*/;
514 variable1 = ATTR_partial_order___PartialOrderElement____value( self) /*PartialOrderElement::_value*/;
515 ((array___AbstractArray___add_t)CALL(variable0,COLOR_abstract_collection___SimpleCollection___add))(variable0, variable1) /*Array::add*/;
516 }
517 variable0 = ATTR_partial_order___PartialOrderElement____greaters_and_self_cache( self) /*PartialOrderElement::_greaters_and_self_cache*/;
518 goto return_label25;
519 return_label25: while(false);
520 tracehead = trace.prev;
521 return variable0;
522 }
523 val_t partial_order___PartialOrderElement___smallers(val_t self) {
524 struct trace_t trace = {NULL, "partial_order::PartialOrderElement::smallers (src/metamodel//partial_order.nit:234,2--241:24)"};
525 val_t variable0;
526 val_t variable1;
527 trace.prev = tracehead; tracehead = &trace;
528 variable0 = ATTR_partial_order___PartialOrderElement____smallers_last_length( self) /*PartialOrderElement::_smallers_last_length*/;
529 variable1 = ATTR_partial_order___PartialOrderElement____order( self) /*PartialOrderElement::_order*/;
530 variable1 = ((partial_order___PartialOrder___length_t)CALL(variable1,COLOR_abstract_collection___Collection___length))(variable1) /*PartialOrder::length*/;
531 variable0 = TAG_Bool(UNTAG_Int(variable0)<UNTAG_Int(variable1));
532 if (UNTAG_Bool(variable0)) { /*if*/
533 variable0 = ATTR_partial_order___PartialOrderElement____order( self) /*PartialOrderElement::_order*/;
534 variable1 = ATTR_partial_order___PartialOrderElement____smallers_cache( self) /*PartialOrderElement::_smallers_cache*/;
535 ((partial_order___PartialOrder___compute_smallers_for_t)CALL(variable0,COLOR_partial_order___PartialOrder___compute_smallers_for))(variable0, self, variable1) /*PartialOrder::compute_smallers_for*/;
536 variable0 = ATTR_partial_order___PartialOrderElement____order( self) /*PartialOrderElement::_order*/;
537 variable0 = ((partial_order___PartialOrder___length_t)CALL(variable0,COLOR_abstract_collection___Collection___length))(variable0) /*PartialOrder::length*/;
538 ATTR_partial_order___PartialOrderElement____smallers_last_length( self) /*PartialOrderElement::_smallers_last_length*/ = variable0;
539 }
540 variable0 = ATTR_partial_order___PartialOrderElement____smallers_cache( self) /*PartialOrderElement::_smallers_cache*/;
541 goto return_label26;
542 return_label26: while(false);
543 tracehead = trace.prev;
544 return variable0;
545 }
546 val_t partial_order___PartialOrderElement___linear_extension(val_t self) {
547 struct trace_t trace = {NULL, "partial_order::PartialOrderElement::linear_extension (src/metamodel//partial_order.nit:247,2--269:32)"};
548 val_t variable0;
549 val_t variable1;
550 val_t variable2;
551 val_t variable3;
552 val_t variable4;
553 val_t variable5;
554 val_t variable6;
555 val_t variable7;
556 trace.prev = tracehead; tracehead = &trace;
557 variable0 = ATTR_partial_order___PartialOrderElement____linear_extension_cache( self) /*PartialOrderElement::_linear_extension_cache*/;
558 variable0 = TAG_Bool((variable0 == NIT_NULL /*null*/) || ((variable0 != NIT_NULL) && UNTAG_Bool(((array___AbstractArray_____eqeq_t)CALL(variable0,COLOR_kernel___Object_____eqeq))(variable0, NIT_NULL /*null*/) /*Array::==*/)));
559 if (UNTAG_Bool(variable0)) { /*if*/
560 variable1 = NEW_array___Array___init(); /*new Array[E]*/
561 variable0 = variable1;
562 variable2 = NEW_array___Array___init(); /*new Array[E]*/
563 variable1 = variable2;
564 variable2 = ((partial_order___PartialOrderElement___value_t)CALL( self,COLOR_partial_order___PartialOrderElement___value))( self) /*PartialOrderElement::value*/;
565 ((array___AbstractArray___add_t)CALL( variable0 /*res*/,COLOR_abstract_collection___SimpleCollection___add))( variable0 /*res*/, variable2) /*Array::add*/;
566 variable2 = ((partial_order___PartialOrderElement___direct_greaters_t)CALL( self,COLOR_partial_order___PartialOrderElement___direct_greaters))( self) /*PartialOrderElement::direct_greaters*/;
567 variable2 = ((array___AbstractArray___iterator_t)CALL(variable2,COLOR_abstract_collection___Collection___iterator))(variable2) /*Array::iterator*/;
568 while (true) { /*for*/
569 variable3 = ((array___ArrayIterator___is_ok_t)CALL(variable2,COLOR_abstract_collection___Iterator___is_ok))(variable2) /*ArrayIterator::is_ok*/;
570 if (!UNTAG_Bool(variable3)) break; /*for*/
571 variable3 = ((array___ArrayIterator___item_t)CALL(variable2,COLOR_abstract_collection___Iterator___item))(variable2) /*ArrayIterator::item*/;
572 variable5 = ((partial_order___PartialOrderElement___order_t)CALL( self,COLOR_partial_order___PartialOrderElement___order))( self) /*PartialOrderElement::order*/;
573 variable5 = ((partial_order___PartialOrder_____bra_t)CALL(variable5,COLOR_partial_order___PartialOrder_____bra))(variable5, variable3 /*s*/) /*PartialOrder::[]*/;
574 variable5 = ((partial_order___PartialOrderElement___linear_extension_t)CALL(variable5,COLOR_partial_order___PartialOrderElement___linear_extension))(variable5) /*PartialOrderElement::linear_extension*/;
575 variable4 = variable5;
576 ((array___AbstractArray___clear_t)CALL( variable1 /*res2*/,COLOR_abstract_collection___RemovableCollection___clear))( variable1 /*res2*/) /*Array::clear*/;
577 variable5 = ((array___AbstractArray___iterator_t)CALL( variable0 /*res*/,COLOR_abstract_collection___Collection___iterator))( variable0 /*res*/) /*Array::iterator*/;
578 while (true) { /*for*/
579 variable6 = ((array___ArrayIterator___is_ok_t)CALL(variable5,COLOR_abstract_collection___Iterator___is_ok))(variable5) /*ArrayIterator::is_ok*/;
580 if (!UNTAG_Bool(variable6)) break; /*for*/
581 variable6 = ((array___ArrayIterator___item_t)CALL(variable5,COLOR_abstract_collection___Iterator___item))(variable5) /*ArrayIterator::item*/;
582 variable7 = ((array___AbstractArray___has_t)CALL( variable4 /*sl*/,COLOR_abstract_collection___Collection___has))( variable4 /*sl*/, variable6 /*e*/) /*Array::has*/;
583 if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable7)))) { /*if*/
584 ((array___AbstractArray___add_t)CALL( variable1 /*res2*/,COLOR_abstract_collection___SimpleCollection___add))( variable1 /*res2*/, variable6 /*e*/) /*Array::add*/;
585 }
586 continue_29: while(0);
587 ((array___ArrayIterator___next_t)CALL(variable5,COLOR_abstract_collection___Iterator___next))(variable5) /*ArrayIterator::next*/;
588 }
589 break_29: while(0);
590 ((abstract_collection___IndexedCollection___append_t)CALL( variable1 /*res2*/,COLOR_abstract_collection___IndexedCollection___append))( variable1 /*res2*/, variable4 /*sl*/) /*Array::append*/;
591 variable5 = variable0 /*res*/;
592 variable0 = variable1 /*res2*/ /*res=*/;
593 variable1 = variable5 /*tmp*/ /*res2=*/;
594 continue_28: while(0);
595 ((array___ArrayIterator___next_t)CALL(variable2,COLOR_abstract_collection___Iterator___next))(variable2) /*ArrayIterator::next*/;
596 }
597 break_28: while(0);
598 ATTR_partial_order___PartialOrderElement____linear_extension_cache( self) /*PartialOrderElement::_linear_extension_cache*/ = variable0 /*res*/;
599 }
600 variable0 = ATTR_partial_order___PartialOrderElement____linear_extension_cache( self) /*PartialOrderElement::_linear_extension_cache*/;
601 goto return_label27;
602 return_label27: while(false);
603 tracehead = trace.prev;
604 return variable0;
605 }
606 val_t partial_order___PartialOrderElement___reverse_linear_extension(val_t self) {
607 struct trace_t trace = {NULL, "partial_order::PartialOrderElement::reverse_linear_extension (src/metamodel//partial_order.nit:275,2--288:32)"};
608 val_t variable0;
609 val_t variable1;
610 val_t variable2;
611 val_t variable3;
612 val_t variable4;
613 trace.prev = tracehead; tracehead = &trace;
614 variable0 = ATTR_partial_order___PartialOrderElement____reverse_linear_extension_cache( self) /*PartialOrderElement::_reverse_linear_extension_cache*/;
615 variable0 = TAG_Bool((variable0 == NIT_NULL /*null*/) || ((variable0 != NIT_NULL) && UNTAG_Bool(((array___AbstractArray_____eqeq_t)CALL(variable0,COLOR_kernel___Object_____eqeq))(variable0, NIT_NULL /*null*/) /*Array::==*/)));
616 if (UNTAG_Bool(variable0)) { /*if*/
617 variable1 = NEW_hash___HashSet___init(); /*new HashSet[E]*/
618 variable0 = variable1;
619 variable1 = ((partial_order___PartialOrderElement___direct_greaters_t)CALL( self,COLOR_partial_order___PartialOrderElement___direct_greaters))( self) /*PartialOrderElement::direct_greaters*/;
620 variable1 = ((array___AbstractArray___iterator_t)CALL(variable1,COLOR_abstract_collection___Collection___iterator))(variable1) /*Array::iterator*/;
621 while (true) { /*for*/
622 variable2 = ((array___ArrayIterator___is_ok_t)CALL(variable1,COLOR_abstract_collection___Iterator___is_ok))(variable1) /*ArrayIterator::is_ok*/;
623 if (!UNTAG_Bool(variable2)) break; /*for*/
624 variable2 = ((array___ArrayIterator___item_t)CALL(variable1,COLOR_abstract_collection___Iterator___item))(variable1) /*ArrayIterator::item*/;
625 variable4 = ((partial_order___PartialOrderElement___order_t)CALL( self,COLOR_partial_order___PartialOrderElement___order))( self) /*PartialOrderElement::order*/;
626 variable4 = ((partial_order___PartialOrder_____bra_t)CALL(variable4,COLOR_partial_order___PartialOrder_____bra))(variable4, variable2 /*s*/) /*PartialOrder::[]*/;
627 variable4 = ((partial_order___PartialOrderElement___linear_extension_t)CALL(variable4,COLOR_partial_order___PartialOrderElement___linear_extension))(variable4) /*PartialOrderElement::linear_extension*/;
628 variable3 = variable4;
629 ((abstract_collection___SimpleCollection___add_all_t)CALL( variable0 /*res*/,COLOR_abstract_collection___SimpleCollection___add_all))( variable0 /*res*/, variable3 /*sl*/) /*HashSet::add_all*/;
630 continue_31: while(0);
631 ((array___ArrayIterator___next_t)CALL(variable1,COLOR_abstract_collection___Iterator___next))(variable1) /*ArrayIterator::next*/;
632 }
633 break_31: while(0);
634 variable1 = ((partial_order___PartialOrderElement___value_t)CALL( self,COLOR_partial_order___PartialOrderElement___value))( self) /*PartialOrderElement::value*/;
635 ((hash___HashSet___add_t)CALL( variable0 /*res*/,COLOR_abstract_collection___SimpleCollection___add))( variable0 /*res*/, variable1) /*HashSet::add*/;
636 variable1 = ((array___Collection___to_a_t)CALL( variable0 /*res*/,COLOR_array___Collection___to_a))( variable0 /*res*/) /*HashSet::to_a*/;
637 ATTR_partial_order___PartialOrderElement____linear_extension_cache( self) /*PartialOrderElement::_linear_extension_cache*/ = variable1;
638 }
639 variable0 = ATTR_partial_order___PartialOrderElement____linear_extension_cache( self) /*PartialOrderElement::_linear_extension_cache*/;
640 goto return_label30;
641 return_label30: while(false);
642 tracehead = trace.prev;
643 return variable0;
644 }
645 val_t partial_order___PartialOrderElement_____l(val_t self, val_t param0) {
646 struct trace_t trace = {NULL, "partial_order::PartialOrderElement::< (src/metamodel//partial_order.nit:291,2--294:24)"};
647 val_t variable0;
648 val_t variable1;
649 trace.prev = tracehead; tracehead = &trace;
650 variable0 = param0;
651 variable1 = ATTR_partial_order___PartialOrderElement____greaters( self) /*PartialOrderElement::_greaters*/;
652 variable1 = ((abstract_collection___Collection___has_t)CALL(variable1,COLOR_abstract_collection___Collection___has))(variable1, variable0 /*o*/) /*Set::has*/;
653 goto return_label32;
654 return_label32: while(false);
655 tracehead = trace.prev;
656 return variable1;
657 }
658 val_t partial_order___PartialOrderElement_____leq(val_t self, val_t param0) {
659 struct trace_t trace = {NULL, "partial_order::PartialOrderElement::<= (src/metamodel//partial_order.nit:297,2--300:39)"};
660 val_t variable0;
661 val_t variable1;
662 val_t variable2;
663 trace.prev = tracehead; tracehead = &trace;
664 variable0 = param0;
665 variable1 = ATTR_partial_order___PartialOrderElement____value( self) /*PartialOrderElement::_value*/;
666 variable1 = TAG_Bool((variable1 == variable0 /*o*/) || ((variable1 != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL(variable1,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN(variable1, variable0 /*o*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL(variable1,COLOR_kernel___Object_____eqeq))(variable1, variable0 /*o*/) /*Object::==*/)))));
667 variable2 = variable1;
668 if (!UNTAG_Bool(variable2)) { /* or */
669 variable2 = ATTR_partial_order___PartialOrderElement____greaters( self) /*PartialOrderElement::_greaters*/;
670 variable2 = ((abstract_collection___Collection___has_t)CALL(variable2,COLOR_abstract_collection___Collection___has))(variable2, variable0 /*o*/) /*Set::has*/;
671 }
672 variable1 = variable2;
673 goto return_label33;
674 return_label33: while(false);
675 tracehead = trace.prev;
676 return variable1;
677 }
678 val_t partial_order___PartialOrderElement_____g(val_t self, val_t param0) {
679 struct trace_t trace = {NULL, "partial_order::PartialOrderElement::> (src/metamodel//partial_order.nit:303,2--306:27)"};
680 val_t variable0;
681 val_t variable1;
682 val_t variable2;
683 trace.prev = tracehead; tracehead = &trace;
684 variable0 = param0;
685 variable1 = ATTR_partial_order___PartialOrderElement____order( self) /*PartialOrderElement::_order*/;
686 variable1 = ((partial_order___PartialOrder_____bra_t)CALL(variable1,COLOR_partial_order___PartialOrder_____bra))(variable1, variable0 /*o*/) /*PartialOrder::[]*/;
687 variable2 = ATTR_partial_order___PartialOrderElement____value( self) /*PartialOrderElement::_value*/;
688 variable1 = ((partial_order___PartialOrderElement_____l_t)CALL(variable1,COLOR_partial_order___PartialOrderElement_____l))(variable1, variable2) /*PartialOrderElement::<*/;
689 goto return_label34;
690 return_label34: while(false);
691 tracehead = trace.prev;
692 return variable1;
693 }
694 val_t partial_order___PartialOrderElement_____geq(val_t self, val_t param0) {
695 struct trace_t trace = {NULL, "partial_order::PartialOrderElement::>= (src/metamodel//partial_order.nit:309,2--312:42)"};
696 val_t variable0;
697 val_t variable1;
698 val_t variable2;
699 val_t variable3;
700 trace.prev = tracehead; tracehead = &trace;
701 variable0 = param0;
702 variable1 = ATTR_partial_order___PartialOrderElement____value( self) /*PartialOrderElement::_value*/;
703 variable1 = TAG_Bool((variable1 == variable0 /*o*/) || ((variable1 != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL(variable1,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN(variable1, variable0 /*o*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL(variable1,COLOR_kernel___Object_____eqeq))(variable1, variable0 /*o*/) /*Object::==*/)))));
704 variable2 = variable1;
705 if (!UNTAG_Bool(variable2)) { /* or */
706 variable2 = ATTR_partial_order___PartialOrderElement____order( self) /*PartialOrderElement::_order*/;
707 variable2 = ((partial_order___PartialOrder_____bra_t)CALL(variable2,COLOR_partial_order___PartialOrder_____bra))(variable2, variable0 /*o*/) /*PartialOrder::[]*/;
708 variable3 = ATTR_partial_order___PartialOrderElement____value( self) /*PartialOrderElement::_value*/;
709 variable2 = ((partial_order___PartialOrderElement_____l_t)CALL(variable2,COLOR_partial_order___PartialOrderElement_____l))(variable2, variable3) /*PartialOrderElement::<*/;
710 }
711 variable1 = variable2;
712 goto return_label35;
713 return_label35: while(false);
714 tracehead = trace.prev;
715 return variable1;
716 }
717 void partial_order___PartialOrderElement___register_direct_smallers(val_t self, val_t param0) {
718 struct trace_t trace = {NULL, "partial_order::PartialOrderElement::register_direct_smallers (src/metamodel//partial_order.nit:315,2--317:24)"};
719 val_t variable0;
720 val_t variable1;
721 trace.prev = tracehead; tracehead = &trace;
722 variable0 = param0;
723 variable1 = ATTR_partial_order___PartialOrderElement____direct_smallers( self) /*PartialOrderElement::_direct_smallers*/;
724 ((array___AbstractArray___add_t)CALL(variable1,COLOR_abstract_collection___SimpleCollection___add))(variable1, variable0 /*e*/) /*Array::add*/;
725 tracehead = trace.prev;
726 return;
727 }
728 void partial_order___PartialOrderElement___init(val_t self, val_t param0, val_t param1, val_t param2, int* init_table) {
729 struct trace_t trace = {NULL, "partial_order::PartialOrderElement::init (src/metamodel//partial_order.nit:320,2--343:11)"};
730 val_t variable0;
731 val_t variable1;
732 val_t variable2;
733 val_t variable3;
734 val_t variable4;
735 val_t variable5;
736 val_t variable6;
737 val_t variable7;
738 val_t variable8;
739 val_t variable9;
740 trace.prev = tracehead; tracehead = &trace;
741 variable0 = param0;
742 variable1 = param1;
743 variable2 = param2;
744 if (init_table[VAL2OBJ( self)->vft[INIT_TABLE_POS_PartialOrderElement].i]) return;
745 ATTR_partial_order___PartialOrderElement____order( self) /*PartialOrderElement::_order*/ = variable0 /*o*/;
746 ATTR_partial_order___PartialOrderElement____value( self) /*PartialOrderElement::_value*/ = variable1 /*e*/;
747 ATTR_partial_order___PartialOrderElement____direct_greaters( self) /*PartialOrderElement::_direct_greaters*/ = variable2 /*directs*/;
748 variable3 = NEW_array___Array___init(); /*new Array[E]*/
749 ATTR_partial_order___PartialOrderElement____direct_smallers( self) /*PartialOrderElement::_direct_smallers*/ = variable3;
750 variable3 = NEW_hash___HashSet___init(); /*new HashSet[E]*/
751 ATTR_partial_order___PartialOrderElement____greaters( self) /*PartialOrderElement::_greaters*/ = variable3;
752 variable3 = NEW_hash___HashSet___init(); /*new HashSet[E]*/
753 ATTR_partial_order___PartialOrderElement____smallers_cache( self) /*PartialOrderElement::_smallers_cache*/ = variable3;
754 variable4 = ATTR_partial_order___PartialOrderElement____greaters( self) /*PartialOrderElement::_greaters*/;
755 variable3 = variable4;
756 variable4 = TAG_Int(0);
757 variable5 = ((array___AbstractArray___iterator_t)CALL( variable2 /*directs*/,COLOR_abstract_collection___Collection___iterator))( variable2 /*directs*/) /*Array::iterator*/;
758 while (true) { /*for*/
759 variable6 = ((array___ArrayIterator___is_ok_t)CALL(variable5,COLOR_abstract_collection___Iterator___is_ok))(variable5) /*ArrayIterator::is_ok*/;
760 if (!UNTAG_Bool(variable6)) break; /*for*/
761 variable6 = ((array___ArrayIterator___item_t)CALL(variable5,COLOR_abstract_collection___Iterator___item))(variable5) /*ArrayIterator::item*/;
762 ((abstract_collection___SimpleCollection___add_t)CALL( variable3 /*g*/,COLOR_abstract_collection___SimpleCollection___add))( variable3 /*g*/, variable6 /*ee*/) /*Set::add*/;
763 variable8 = ATTR_partial_order___PartialOrderElement____order( self) /*PartialOrderElement::_order*/;
764 variable8 = ((partial_order___PartialOrder_____bra_t)CALL(variable8,COLOR_partial_order___PartialOrder_____bra))(variable8, variable6 /*ee*/) /*PartialOrder::[]*/;
765 variable7 = variable8;
766 variable8 = ((partial_order___PartialOrderElement___rank_t)CALL( variable7 /*poee*/,COLOR_partial_order___PartialOrderElement___rank))( variable7 /*poee*/) /*PartialOrderElement::rank*/;
767 variable8 = TAG_Bool(UNTAG_Int(variable8)>=UNTAG_Int( variable4 /*r*/));
768 if (UNTAG_Bool(variable8)) { /*if*/
769 variable8 = ((partial_order___PartialOrderElement___rank_t)CALL( variable7 /*poee*/,COLOR_partial_order___PartialOrderElement___rank))( variable7 /*poee*/) /*PartialOrderElement::rank*/;
770 variable8 = TAG_Int(UNTAG_Int(variable8)+UNTAG_Int( TAG_Int(1)));
771 variable4 = variable8 /*r=*/;
772 }
773 ((partial_order___PartialOrderElement___register_direct_smallers_t)CALL( variable7 /*poee*/,COLOR_partial_order___PartialOrderElement___register_direct_smallers))( variable7 /*poee*/, variable1 /*e*/) /*PartialOrderElement::register_direct_smallers*/;
774 variable8 = ((partial_order___PartialOrderElement___greaters_t)CALL( variable7 /*poee*/,COLOR_partial_order___PartialOrderElement___greaters))( variable7 /*poee*/) /*PartialOrderElement::greaters*/;
775 variable8 = ((abstract_collection___Collection___iterator_t)CALL(variable8,COLOR_abstract_collection___Collection___iterator))(variable8) /*Set::iterator*/;
776 while (true) { /*for*/
777 variable9 = ((abstract_collection___Iterator___is_ok_t)CALL(variable8,COLOR_abstract_collection___Iterator___is_ok))(variable8) /*Iterator::is_ok*/;
778 if (!UNTAG_Bool(variable9)) break; /*for*/
779 variable9 = ((abstract_collection___Iterator___item_t)CALL(variable8,COLOR_abstract_collection___Iterator___item))(variable8) /*Iterator::item*/;
780 ((abstract_collection___SimpleCollection___add_t)CALL( variable3 /*g*/,COLOR_abstract_collection___SimpleCollection___add))( variable3 /*g*/, variable9 /*eee*/) /*Set::add*/;
781 continue_39: while(0);
782 ((abstract_collection___Iterator___next_t)CALL(variable8,COLOR_abstract_collection___Iterator___next))(variable8) /*Iterator::next*/;
783 }
784 break_39: while(0);
785 continue_38: while(0);
786 ((array___ArrayIterator___next_t)CALL(variable5,COLOR_abstract_collection___Iterator___next))(variable5) /*ArrayIterator::next*/;
787 }
788 break_38: while(0);
789 ATTR_partial_order___PartialOrderElement____rank( self) /*PartialOrderElement::_rank*/ = variable4 /*r*/;
790 init_table[VAL2OBJ( self)->vft[INIT_TABLE_POS_PartialOrderElement].i] = 1;
791 tracehead = trace.prev;
792 return;
793 }