64defd45805e7ef0d8c41e8b7dcda39e2aef6da2
[nit.git] / c_src / partial_order._sep.c
1 /* This C file is generated by NIT to compile module partial_order. */
2 #include "partial_order._sep.h"
3 val_t partial_order___PartialOrder___iterator(val_t self) {
4 struct trace_t trace = {NULL, NULL, 54, LOCATE_partial_order___PartialOrder___iterator};
5 val_t variable[3];
6 void **closurevariable = NULL;
7 trace.prev = tracehead; tracehead = &trace;
8 trace.file = LOCATE_partial_order;
9 variable[0] = self;
10 variable[2] = variable[0];
11 variable[2] = ATTR_partial_order___PartialOrder____elements_list(variable[2]) /*PartialOrder::_elements_list*/;
12 variable[2] = CALL_abstract_collection___Collection___iterator(variable[2])(variable[2]) /*AbstractArray::iterator*/;
13 variable[1] = variable[2];
14 goto return_label0;
15 return_label0: while(false);
16 tracehead = trace.prev;
17 return variable[1];
18 }
19 val_t partial_order___PartialOrder___is_empty(val_t self) {
20 struct trace_t trace = {NULL, NULL, 35, LOCATE_partial_order___PartialOrder___is_empty};
21 val_t variable[3];
22 void **closurevariable = NULL;
23 trace.prev = tracehead; tracehead = &trace;
24 trace.file = LOCATE_partial_order;
25 variable[0] = self;
26 variable[2] = variable[0];
27 variable[2] = ATTR_partial_order___PartialOrder____elements(variable[2]) /*PartialOrder::_elements*/;
28 variable[2] = CALL_abstract_collection___Collection___is_empty(variable[2])(variable[2]) /*Collection::is_empty*/;
29 variable[1] = variable[2];
30 goto return_label1;
31 return_label1: while(false);
32 tracehead = trace.prev;
33 return variable[1];
34 }
35 val_t partial_order___PartialOrder___length(val_t self) {
36 struct trace_t trace = {NULL, NULL, 37, LOCATE_partial_order___PartialOrder___length};
37 val_t variable[3];
38 void **closurevariable = NULL;
39 trace.prev = tracehead; tracehead = &trace;
40 trace.file = LOCATE_partial_order;
41 variable[0] = self;
42 variable[2] = variable[0];
43 variable[2] = ATTR_partial_order___PartialOrder____elements(variable[2]) /*PartialOrder::_elements*/;
44 variable[2] = CALL_abstract_collection___Collection___length(variable[2])(variable[2]) /*Collection::length*/;
45 variable[1] = variable[2];
46 goto return_label2;
47 return_label2: while(false);
48 tracehead = trace.prev;
49 return variable[1];
50 }
51 val_t partial_order___PartialOrder___has(val_t self, val_t param0) {
52 struct trace_t trace = {NULL, NULL, 41, LOCATE_partial_order___PartialOrder___has};
53 val_t variable[4];
54 void **closurevariable = NULL;
55 trace.prev = tracehead; tracehead = &trace;
56 trace.file = LOCATE_partial_order;
57 variable[0] = self;
58 variable[1] = param0;
59 variable[3] = variable[0];
60 variable[3] = ATTR_partial_order___PartialOrder____elements(variable[3]) /*PartialOrder::_elements*/;
61 variable[3] = CALL_abstract_collection___Map___has_key(variable[3])(variable[3], variable[1] /*e*/) /*Map::has_key*/;
62 variable[2] = variable[3];
63 goto return_label3;
64 return_label3: while(false);
65 tracehead = trace.prev;
66 return variable[2];
67 }
68 val_t partial_order___PartialOrder___has_only(val_t self, val_t param0) {
69 struct trace_t trace = {NULL, NULL, 43, LOCATE_partial_order___PartialOrder___has_only};
70 val_t variable[5];
71 void **closurevariable = NULL;
72 trace.prev = tracehead; tracehead = &trace;
73 trace.file = LOCATE_partial_order;
74 variable[0] = self;
75 variable[1] = param0;
76 variable[3] = variable[0];
77 variable[3] = ATTR_partial_order___PartialOrder____elements(variable[3]) /*PartialOrder::_elements*/;
78 variable[3] = CALL_abstract_collection___Collection___length(variable[3])(variable[3]) /*Collection::length*/;
79 variable[3] = TAG_Bool((variable[3])==( TAG_Int(1)));
80 variable[4] = variable[3];
81 if (UNTAG_Bool(variable[4])) { /* and */
82 variable[4] = variable[0];
83 variable[4] = ATTR_partial_order___PartialOrder____elements(variable[4]) /*PartialOrder::_elements*/;
84 variable[4] = CALL_abstract_collection___Collection___first(variable[4])(variable[4]) /*Collection::first*/;
85 variable[4] = TAG_Bool((variable[4] == variable[1] /*e*/) || ((variable[4] != NIT_NULL) && ((CALL_kernel___Object_____eqeq(variable[4])==kernel___Object_____eqeq)?(IS_EQUAL_NN(variable[4], variable[1] /*e*/)):(UNTAG_Bool(CALL_kernel___Object_____eqeq(variable[4])(variable[4], variable[1] /*e*/) /*Object::==*/)))));
86 }
87 variable[3] = variable[4];
88 variable[2] = variable[3];
89 goto return_label4;
90 return_label4: while(false);
91 tracehead = trace.prev;
92 return variable[2];
93 }
94 val_t partial_order___PartialOrder___count(val_t self, val_t param0) {
95 struct trace_t trace = {NULL, NULL, 45, LOCATE_partial_order___PartialOrder___count};
96 val_t variable[4];
97 void **closurevariable = NULL;
98 trace.prev = tracehead; tracehead = &trace;
99 trace.file = LOCATE_partial_order;
100 variable[0] = self;
101 variable[1] = param0;
102 variable[3] = variable[0];
103 variable[3] = CALL_abstract_collection___Collection___has(variable[3])(variable[3], variable[1] /*e*/) /*PartialOrder::has*/;
104 if (UNTAG_Bool(variable[3])) { /*if*/
105 variable[2] = TAG_Int(1);
106 goto return_label5;
107 } else { /*if*/
108 variable[2] = TAG_Int(0);
109 goto return_label5;
110 }
111 return_label5: while(false);
112 tracehead = trace.prev;
113 return variable[2];
114 }
115 val_t partial_order___PartialOrder___first(val_t self) {
116 struct trace_t trace = {NULL, NULL, 39, LOCATE_partial_order___PartialOrder___first};
117 val_t variable[3];
118 void **closurevariable = NULL;
119 trace.prev = tracehead; tracehead = &trace;
120 trace.file = LOCATE_partial_order;
121 variable[0] = self;
122 variable[2] = variable[0];
123 variable[2] = ATTR_partial_order___PartialOrder____elements_list(variable[2]) /*PartialOrder::_elements_list*/;
124 variable[2] = CALL_abstract_collection___Collection___first(variable[2])(variable[2]) /*IndexedCollection::first*/;
125 variable[1] = variable[2];
126 goto return_label6;
127 return_label6: while(false);
128 tracehead = trace.prev;
129 return variable[1];
130 }
131 val_t partial_order___PartialOrder___roots(val_t self) {
132 struct trace_t trace = {NULL, NULL, 30, LOCATE_partial_order___PartialOrder___roots};
133 val_t *variable = NULL;
134 void **closurevariable = NULL;
135 trace.prev = tracehead; tracehead = &trace;
136 trace.file = LOCATE_partial_order;
137 tracehead = trace.prev;
138 return ATTR_partial_order___PartialOrder____roots( self) /*PartialOrder::_roots*/;
139 }
140 val_t partial_order___PartialOrder_____bra(val_t self, val_t param0) {
141 struct trace_t trace = {NULL, NULL, 58, LOCATE_partial_order___PartialOrder_____bra};
142 val_t variable[4];
143 void **closurevariable = NULL;
144 trace.prev = tracehead; tracehead = &trace;
145 trace.file = LOCATE_partial_order;
146 variable[0] = self;
147 variable[1] = param0;
148 variable[3] = variable[0];
149 variable[3] = ATTR_partial_order___PartialOrder____elements(variable[3]) /*PartialOrder::_elements*/;
150 variable[3] = CALL_abstract_collection___Map___has_key(variable[3])(variable[3], variable[1] /*e*/) /*Map::has_key*/;
151 if (UNTAG_Bool(variable[3])) { /*if*/
152 variable[3] = variable[0];
153 variable[3] = ATTR_partial_order___PartialOrder____elements(variable[3]) /*PartialOrder::_elements*/;
154 variable[3] = CALL_abstract_collection___Map_____bra(variable[3])(variable[3], variable[1] /*e*/) /*Map::[]*/;
155 variable[2] = variable[3];
156 goto return_label7;
157 } else { /*if*/
158 variable[2] = NIT_NULL /*null*/;
159 goto return_label7;
160 }
161 return_label7: while(false);
162 tracehead = trace.prev;
163 return variable[2];
164 }
165 val_t partial_order___PartialOrder___to_dot(val_t self) {
166 struct trace_t trace = {NULL, NULL, 68, LOCATE_partial_order___PartialOrder___to_dot};
167 val_t variable[11];
168 void **closurevariable = NULL;
169 trace.prev = tracehead; tracehead = &trace;
170 trace.file = LOCATE_partial_order;
171 variable[0] = self;
172 variable[3] = NEW_String_string___String___init(); /*new String*/
173 variable[2] = variable[3];
174 variable[3] = variable[0];
175 variable[3] = CALL_partial_order___PartialOrder___to_dot_header(variable[3])(variable[3]) /*PartialOrder::to_dot_header*/;
176 CALL_abstract_collection___IndexedCollection___append( variable[2] /*s*/)( variable[2] /*s*/, variable[3]) /*String::append*/;
177 variable[3] = variable[0];
178 variable[3] = ATTR_partial_order___PartialOrder____elements(variable[3]) /*PartialOrder::_elements*/;
179 variable[3] = CALL_abstract_collection___Collection___iterator(variable[3])(variable[3]) /*Map::iterator*/;
180 while (true) { /*for*/
181 variable[4] = CALL_abstract_collection___Iterator___is_ok(variable[3])(variable[3]) /*Iterator::is_ok*/;
182 if (!UNTAG_Bool(variable[4])) break; /*for*/
183 variable[4] = CALL_abstract_collection___Iterator___item(variable[3])(variable[3]) /*Iterator::item*/;
184 variable[5] = variable[4];
185 variable[6] = variable[0];
186 variable[7] = CALL_partial_order___PartialOrderElement___value( variable[5] /*e*/)( variable[5] /*e*/) /*PartialOrderElement::value*/;
187 variable[6] = CALL_partial_order___PartialOrder___to_dot_node(variable[6])(variable[6], variable[7]) /*PartialOrder::to_dot_node*/;
188 CALL_abstract_collection___IndexedCollection___append( variable[2] /*s*/)( variable[2] /*s*/, variable[6]) /*String::append*/;
189 variable[6] = CALL_partial_order___PartialOrderElement___direct_greaters( variable[5] /*e*/)( variable[5] /*e*/) /*PartialOrderElement::direct_greaters*/;
190 variable[6] = CALL_abstract_collection___Collection___iterator(variable[6])(variable[6]) /*AbstractArray::iterator*/;
191 while (true) { /*for*/
192 variable[7] = CALL_abstract_collection___Iterator___is_ok(variable[6])(variable[6]) /*ArrayIterator::is_ok*/;
193 if (!UNTAG_Bool(variable[7])) break; /*for*/
194 variable[7] = CALL_abstract_collection___Iterator___item(variable[6])(variable[6]) /*ArrayIterator::item*/;
195 variable[8] = variable[7];
196 variable[9] = variable[0];
197 variable[10] = CALL_partial_order___PartialOrderElement___value( variable[5] /*e*/)( variable[5] /*e*/) /*PartialOrderElement::value*/;
198 variable[9] = CALL_partial_order___PartialOrder___to_dot_edge(variable[9])(variable[9], variable[10], variable[8] /*d*/) /*PartialOrder::to_dot_edge*/;
199 CALL_abstract_collection___IndexedCollection___append( variable[2] /*s*/)( variable[2] /*s*/, variable[9]) /*String::append*/;
200 continue_10: while(0);
201 CALL_abstract_collection___Iterator___next(variable[6])(variable[6]) /*ArrayIterator::next*/;
202 }
203 break_10: while(0);
204 continue_9: while(0);
205 CALL_abstract_collection___Iterator___next(variable[3])(variable[3]) /*Iterator::next*/;
206 }
207 break_9: while(0);
208 variable[3] = NEW_String_string___String___with_native(BOX_NativeString("}\n"), TAG_Int(2)); /*new String*/
209 CALL_abstract_collection___IndexedCollection___append( variable[2] /*s*/)( variable[2] /*s*/, variable[3]) /*String::append*/;
210 variable[1] = variable[2] /*s*/;
211 goto return_label8;
212 return_label8: while(false);
213 tracehead = trace.prev;
214 return variable[1];
215 }
216 val_t partial_order___PartialOrder___to_dot_header(val_t self) {
217 struct trace_t trace = {NULL, NULL, 83, LOCATE_partial_order___PartialOrder___to_dot_header};
218 val_t variable[3];
219 void **closurevariable = NULL;
220 trace.prev = tracehead; tracehead = &trace;
221 trace.file = LOCATE_partial_order;
222 variable[0] = self;
223 variable[2] = NEW_String_string___String___with_native(BOX_NativeString("digraph G {\ngraph [rankdir=BT];\n"), TAG_Int(32)); /*new String*/
224 variable[1] = variable[2];
225 goto return_label11;
226 return_label11: while(false);
227 tracehead = trace.prev;
228 return variable[1];
229 }
230 val_t partial_order___PartialOrder___to_dot_node(val_t self, val_t param0) {
231 struct trace_t trace = {NULL, NULL, 89, LOCATE_partial_order___PartialOrder___to_dot_node};
232 val_t variable[9];
233 void **closurevariable = NULL;
234 trace.prev = tracehead; tracehead = &trace;
235 trace.file = LOCATE_partial_order;
236 variable[0] = self;
237 variable[1] = param0;
238 variable[3] = NEW_Array_array___Array___with_capacity(TAG_Int(3)); /*new Array[String]*/
239 variable[4] = NEW_String_string___String___with_native(BOX_NativeString("\""), TAG_Int(1)); /*new String*/
240 variable[5] = variable[4];
241 CALL_abstract_collection___SimpleCollection___add(variable[3])(variable[3], variable[5]) /*AbstractArray::add*/;
242 variable[6] = variable[1] /*e*/;
243 variable[6] = CALL_string___Object___to_s(variable[6])(variable[6]) /*Object::to_s*/;
244 CALL_abstract_collection___SimpleCollection___add(variable[3])(variable[3], variable[6]) /*AbstractArray::add*/;
245 variable[7] = NEW_String_string___String___with_native(BOX_NativeString("\";\n"), TAG_Int(3)); /*new String*/
246 variable[8] = variable[7];
247 CALL_abstract_collection___SimpleCollection___add(variable[3])(variable[3], variable[8]) /*AbstractArray::add*/;
248 variable[3] = CALL_string___Object___to_s(variable[3])(variable[3]) /*Object::to_s*/;
249 variable[2] = variable[3];
250 goto return_label12;
251 return_label12: while(false);
252 tracehead = trace.prev;
253 return variable[2];
254 }
255 val_t partial_order___PartialOrder___to_dot_edge(val_t self, val_t param0, val_t param1) {
256 struct trace_t trace = {NULL, NULL, 95, LOCATE_partial_order___PartialOrder___to_dot_edge};
257 val_t variable[13];
258 void **closurevariable = NULL;
259 trace.prev = tracehead; tracehead = &trace;
260 trace.file = LOCATE_partial_order;
261 variable[0] = self;
262 variable[1] = param0;
263 variable[2] = param1;
264 variable[4] = NEW_Array_array___Array___with_capacity(TAG_Int(5)); /*new Array[String]*/
265 variable[5] = NEW_String_string___String___with_native(BOX_NativeString("\""), TAG_Int(1)); /*new String*/
266 variable[6] = variable[5];
267 CALL_abstract_collection___SimpleCollection___add(variable[4])(variable[4], variable[6]) /*AbstractArray::add*/;
268 variable[7] = variable[1] /*e1*/;
269 variable[7] = CALL_string___Object___to_s(variable[7])(variable[7]) /*Object::to_s*/;
270 CALL_abstract_collection___SimpleCollection___add(variable[4])(variable[4], variable[7]) /*AbstractArray::add*/;
271 variable[8] = NEW_String_string___String___with_native(BOX_NativeString("\" -> \""), TAG_Int(6)); /*new String*/
272 variable[9] = variable[8];
273 CALL_abstract_collection___SimpleCollection___add(variable[4])(variable[4], variable[9]) /*AbstractArray::add*/;
274 variable[10] = variable[2] /*e2*/;
275 variable[10] = CALL_string___Object___to_s(variable[10])(variable[10]) /*Object::to_s*/;
276 CALL_abstract_collection___SimpleCollection___add(variable[4])(variable[4], variable[10]) /*AbstractArray::add*/;
277 variable[11] = NEW_String_string___String___with_native(BOX_NativeString("\";\n"), TAG_Int(3)); /*new String*/
278 variable[12] = variable[11];
279 CALL_abstract_collection___SimpleCollection___add(variable[4])(variable[4], variable[12]) /*AbstractArray::add*/;
280 variable[4] = CALL_string___Object___to_s(variable[4])(variable[4]) /*Object::to_s*/;
281 variable[3] = variable[4];
282 goto return_label13;
283 return_label13: while(false);
284 tracehead = trace.prev;
285 return variable[3];
286 }
287 val_t partial_order___PartialOrder___select_smallests(val_t self, val_t param0) {
288 struct trace_t trace = {NULL, NULL, 101, LOCATE_partial_order___PartialOrder___select_smallests};
289 val_t variable[10];
290 void **closurevariable = NULL;
291 trace.prev = tracehead; tracehead = &trace;
292 trace.file = LOCATE_partial_order;
293 variable[0] = self;
294 variable[1] = param0;
295 variable[3] = TAG_Bool(( variable[1] /*c*/ == NIT_NULL /*null*/) || (( variable[1] /*c*/ != NIT_NULL) && ((CALL_kernel___Object_____eqeq( variable[1] /*c*/)==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable[1] /*c*/, NIT_NULL /*null*/)):(UNTAG_Bool(CALL_kernel___Object_____eqeq( variable[1] /*c*/)( variable[1] /*c*/, NIT_NULL /*null*/) /*Object::==*/)))));
296 if (UNTAG_Bool(variable[3])) { /*if*/
297 variable[3] = NEW_Array_array___Array___init(); /*new Array[E]*/
298 variable[2] = variable[3];
299 goto return_label14;
300 }
301 variable[3] = variable[0];
302 variable[3] = CALL_partial_order___PartialOrder___has_all(variable[3])(variable[3], variable[1] /*c*/) /*PartialOrder::has_all*/;
303 if (!UNTAG_Bool(variable[3])) { fprintf(stderr, "Assert%s failed", ""); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_partial_order___PartialOrder___select_smallests, LOCATE_partial_order, 105); nit_exit(1);}
304 variable[4] = CALL_abstract_collection___Collection___length( variable[1] /*c*/)( variable[1] /*c*/) /*Collection::length*/;
305 variable[5] = NEW_Array_array___Array___with_capacity(variable[4]); /*new Array[E]*/
306 variable[4] = variable[5];
307 variable[3] = variable[4];
308 variable[5] = CALL_abstract_collection___Collection___length( variable[1] /*c*/)( variable[1] /*c*/) /*Collection::length*/;
309 variable[6] = NEW_Array_array___Array___with_capacity(variable[5]); /*new Array[E]*/
310 variable[5] = variable[6];
311 variable[4] = variable[5];
312 variable[5] = CALL_abstract_collection___Collection___iterator( variable[1] /*c*/)( variable[1] /*c*/) /*Collection::iterator*/;
313 while (true) { /*for*/
314 variable[6] = CALL_abstract_collection___Iterator___is_ok(variable[5])(variable[5]) /*Iterator::is_ok*/;
315 if (!UNTAG_Bool(variable[6])) break; /*for*/
316 variable[6] = CALL_abstract_collection___Iterator___item(variable[5])(variable[5]) /*Iterator::item*/;
317 variable[7] = variable[6];
318 variable[9] = variable[0];
319 variable[9] = CALL_partial_order___PartialOrder___add_to_smallests(variable[9])(variable[9], variable[7] /*e*/, variable[3] /*res*/, variable[4] /*tmp*/) /*PartialOrder::add_to_smallests*/;
320 variable[8] = variable[9];
321 if (UNTAG_Bool( variable[8] /*r*/)) { /*if*/
322 variable[9] = variable[4] /*tmp*/;
323 variable[4] = variable[3] /*res*/ /*tmp=*/;
324 variable[3] = variable[9] /*t*/ /*res=*/;
325 }
326 continue_15: while(0);
327 CALL_abstract_collection___Iterator___next(variable[5])(variable[5]) /*Iterator::next*/;
328 }
329 break_15: while(0);
330 variable[2] = variable[3] /*res*/;
331 goto return_label14;
332 return_label14: while(false);
333 tracehead = trace.prev;
334 return variable[2];
335 }
336 val_t partial_order___PartialOrder___add(val_t self, val_t param0, val_t param1) {
337 struct trace_t trace = {NULL, NULL, 122, LOCATE_partial_order___PartialOrder___add};
338 val_t variable[8];
339 void **closurevariable = NULL;
340 trace.prev = tracehead; tracehead = &trace;
341 trace.file = LOCATE_partial_order;
342 variable[0] = self;
343 variable[1] = param0;
344 variable[2] = param1;
345 variable[4] = variable[0];
346 variable[4] = CALL_abstract_collection___Collection___has(variable[4])(variable[4], variable[1] /*e*/) /*PartialOrder::has*/;
347 if (!UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable[4])))) { fprintf(stderr, "Assert%s failed", ""); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_partial_order___PartialOrder___add, LOCATE_partial_order, 125); nit_exit(1);}
348 variable[4] = TAG_Bool(( variable[2] /*supers*/ == NIT_NULL /*null*/) || (( variable[2] /*supers*/ != NIT_NULL) && ((CALL_kernel___Object_____eqeq( variable[2] /*supers*/)==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable[2] /*supers*/, NIT_NULL /*null*/)):(UNTAG_Bool(CALL_kernel___Object_____eqeq( variable[2] /*supers*/)( variable[2] /*supers*/, NIT_NULL /*null*/) /*Object::==*/)))));
349 variable[5] = variable[4];
350 if (!UNTAG_Bool(variable[5])) { /* or */
351 variable[5] = variable[0];
352 variable[5] = CALL_partial_order___PartialOrder___has_all(variable[5])(variable[5], variable[2] /*supers*/) /*PartialOrder::has_all*/;
353 }
354 variable[4] = variable[5];
355 if (!UNTAG_Bool(variable[4])) { fprintf(stderr, "Assert%s failed", ""); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_partial_order___PartialOrder___add, LOCATE_partial_order, 126); nit_exit(1);}
356 variable[5] = variable[0];
357 variable[5] = CALL_partial_order___PartialOrder___select_smallests(variable[5])(variable[5], variable[2] /*supers*/) /*PartialOrder::select_smallests*/;
358 variable[4] = variable[5];
359 variable[6] = variable[0];
360 variable[6] = CALL_partial_order___PartialOrder___new_poe(variable[6])(variable[6], variable[1] /*e*/, variable[4] /*directs*/) /*PartialOrder::new_poe*/;
361 variable[5] = variable[6];
362 variable[6] = variable[0];
363 variable[6] = ATTR_partial_order___PartialOrder____elements(variable[6]) /*PartialOrder::_elements*/;
364 CALL_abstract_collection___Map_____braeq(variable[6])(variable[6], variable[1] /*e*/, variable[5] /*poe*/) /*Map::[]=*/;
365 variable[6] = variable[0];
366 variable[6] = ATTR_partial_order___PartialOrder____elements_list(variable[6]) /*PartialOrder::_elements_list*/;
367 CALL_abstract_collection___SimpleCollection___add(variable[6])(variable[6], variable[1] /*e*/) /*AbstractArray::add*/;
368 variable[6] = TAG_Bool(( variable[2] /*supers*/ == NIT_NULL /*null*/) || (( variable[2] /*supers*/ != NIT_NULL) && ((CALL_kernel___Object_____eqeq( variable[2] /*supers*/)==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable[2] /*supers*/, NIT_NULL /*null*/)):(UNTAG_Bool(CALL_kernel___Object_____eqeq( variable[2] /*supers*/)( variable[2] /*supers*/, NIT_NULL /*null*/) /*Object::==*/)))));
369 variable[7] = variable[6];
370 if (!UNTAG_Bool(variable[7])) { /* or */
371 variable[7] = CALL_abstract_collection___Collection___is_empty( variable[2] /*supers*/)( variable[2] /*supers*/) /*Collection::is_empty*/;
372 }
373 variable[6] = variable[7];
374 if (UNTAG_Bool(variable[6])) { /*if*/
375 variable[6] = variable[0];
376 variable[6] = ATTR_partial_order___PartialOrder____roots(variable[6]) /*PartialOrder::_roots*/;
377 CALL_abstract_collection___SimpleCollection___add(variable[6])(variable[6], variable[1] /*e*/) /*AbstractArray::add*/;
378 }
379 variable[3] = variable[5] /*poe*/;
380 goto return_label16;
381 return_label16: while(false);
382 tracehead = trace.prev;
383 return variable[3];
384 }
385 val_t partial_order___PartialOrder___has_all(val_t self, val_t param0) {
386 struct trace_t trace = {NULL, NULL, 137, LOCATE_partial_order___PartialOrder___has_all};
387 val_t variable[7];
388 void **closurevariable = NULL;
389 trace.prev = tracehead; tracehead = &trace;
390 trace.file = LOCATE_partial_order;
391 variable[0] = self;
392 variable[1] = param0;
393 variable[3] = CALL_abstract_collection___Collection___iterator( variable[1] /*e*/)( variable[1] /*e*/) /*Collection::iterator*/;
394 while (true) { /*for*/
395 variable[4] = CALL_abstract_collection___Iterator___is_ok(variable[3])(variable[3]) /*Iterator::is_ok*/;
396 if (!UNTAG_Bool(variable[4])) break; /*for*/
397 variable[4] = CALL_abstract_collection___Iterator___item(variable[3])(variable[3]) /*Iterator::item*/;
398 variable[5] = variable[4];
399 variable[6] = variable[0];
400 variable[6] = CALL_abstract_collection___Collection___has(variable[6])(variable[6], variable[5] /*i*/) /*PartialOrder::has*/;
401 if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable[6])))) { /*if*/
402 variable[2] = TAG_Bool(false);
403 goto return_label17;
404 }
405 continue_18: while(0);
406 CALL_abstract_collection___Iterator___next(variable[3])(variable[3]) /*Iterator::next*/;
407 }
408 break_18: while(0);
409 variable[2] = TAG_Bool(true);
410 goto return_label17;
411 return_label17: while(false);
412 tracehead = trace.prev;
413 return variable[2];
414 }
415 val_t partial_order___PartialOrder___new_poe(val_t self, val_t param0, val_t param1) {
416 struct trace_t trace = {NULL, NULL, 148, LOCATE_partial_order___PartialOrder___new_poe};
417 val_t variable[6];
418 void **closurevariable = NULL;
419 trace.prev = tracehead; tracehead = &trace;
420 trace.file = LOCATE_partial_order;
421 variable[0] = self;
422 variable[1] = param0;
423 variable[2] = param1;
424 variable[4] = variable[0];
425 variable[5] = NEW_PartialOrderElement_partial_order___PartialOrderElement___init(variable[4], variable[1] /*e*/, variable[2] /*directs*/); /*new PartialOrderElement[E]*/
426 variable[4] = variable[5];
427 variable[3] = variable[4];
428 goto return_label19;
429 return_label19: while(false);
430 tracehead = trace.prev;
431 return variable[3];
432 }
433 val_t partial_order___PartialOrder___add_to_smallests(val_t self, val_t param0, val_t param1, val_t param2) {
434 struct trace_t trace = {NULL, NULL, 154, LOCATE_partial_order___PartialOrder___add_to_smallests};
435 val_t variable[10];
436 void **closurevariable = NULL;
437 trace.prev = tracehead; tracehead = &trace;
438 trace.file = LOCATE_partial_order;
439 variable[0] = self;
440 variable[1] = param0;
441 variable[2] = param1;
442 variable[3] = param2;
443 CALL_abstract_collection___RemovableCollection___clear( variable[3] /*to*/)( variable[3] /*to*/) /*AbstractArray::clear*/;
444 variable[6] = variable[0];
445 variable[6] = CALL_partial_order___PartialOrder_____bra(variable[6])(variable[6], variable[1] /*e*/) /*PartialOrder::[]*/;
446 variable[5] = variable[6];
447 variable[6] = CALL_abstract_collection___Collection___iterator( variable[2] /*from*/)( variable[2] /*from*/) /*AbstractArray::iterator*/;
448 while (true) { /*for*/
449 variable[7] = CALL_abstract_collection___Iterator___is_ok(variable[6])(variable[6]) /*ArrayIterator::is_ok*/;
450 if (!UNTAG_Bool(variable[7])) break; /*for*/
451 variable[7] = CALL_abstract_collection___Iterator___item(variable[6])(variable[6]) /*ArrayIterator::item*/;
452 variable[8] = variable[7];
453 variable[9] = CALL_partial_order___PartialOrderElement_____g( variable[5] /*poe*/)( variable[5] /*poe*/, variable[8] /*i*/) /*PartialOrderElement::>*/;
454 if (UNTAG_Bool(variable[9])) { /*if*/
455 variable[4] = TAG_Bool(false);
456 goto return_label20;
457 }
458 variable[9] = CALL_partial_order___PartialOrderElement_____l( variable[5] /*poe*/)( variable[5] /*poe*/, variable[8] /*i*/) /*PartialOrderElement::<*/;
459 if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable[9])))) { /*if*/
460 CALL_abstract_collection___SimpleCollection___add( variable[3] /*to*/)( variable[3] /*to*/, variable[8] /*i*/) /*AbstractArray::add*/;
461 }
462 continue_21: while(0);
463 CALL_abstract_collection___Iterator___next(variable[6])(variable[6]) /*ArrayIterator::next*/;
464 }
465 break_21: while(0);
466 CALL_abstract_collection___SimpleCollection___add( variable[3] /*to*/)( variable[3] /*to*/, variable[1] /*e*/) /*AbstractArray::add*/;
467 variable[4] = TAG_Bool(true);
468 goto return_label20;
469 return_label20: while(false);
470 tracehead = trace.prev;
471 return variable[4];
472 }
473 void partial_order___PartialOrder___compute_smallers_for(val_t self, val_t param0, val_t param1) {
474 struct trace_t trace = {NULL, NULL, 175, LOCATE_partial_order___PartialOrder___compute_smallers_for};
475 val_t variable[9];
476 void **closurevariable = NULL;
477 trace.prev = tracehead; tracehead = &trace;
478 trace.file = LOCATE_partial_order;
479 variable[0] = self;
480 variable[1] = param0;
481 variable[2] = param1;
482 variable[5] = CALL_partial_order___PartialOrderElement___value( variable[1] /*poe*/)( variable[1] /*poe*/) /*PartialOrderElement::value*/;
483 variable[4] = variable[5];
484 variable[5] = variable[0];
485 variable[5] = ATTR_partial_order___PartialOrder____elements(variable[5]) /*PartialOrder::_elements*/;
486 variable[5] = CALL_abstract_collection___Collection___iterator(variable[5])(variable[5]) /*Map::iterator*/;
487 while (true) { /*for*/
488 variable[6] = CALL_abstract_collection___Iterator___is_ok(variable[5])(variable[5]) /*Iterator::is_ok*/;
489 if (!UNTAG_Bool(variable[6])) break; /*for*/
490 variable[6] = CALL_abstract_collection___Iterator___item(variable[5])(variable[5]) /*Iterator::item*/;
491 variable[7] = variable[6];
492 variable[8] = CALL_partial_order___PartialOrderElement_____l( variable[7] /*s*/)( variable[7] /*s*/, variable[4] /*e*/) /*PartialOrderElement::<*/;
493 if (UNTAG_Bool(variable[8])) { /*if*/
494 variable[8] = CALL_partial_order___PartialOrderElement___value( variable[7] /*s*/)( variable[7] /*s*/) /*PartialOrderElement::value*/;
495 CALL_abstract_collection___SimpleCollection___add( variable[2] /*set*/)( variable[2] /*set*/, variable[8]) /*SimpleCollection::add*/;
496 }
497 continue_23: while(0);
498 CALL_abstract_collection___Iterator___next(variable[5])(variable[5]) /*Iterator::next*/;
499 }
500 break_23: while(0);
501 return_label22: while(false);
502 tracehead = trace.prev;
503 return;
504 }
505 void partial_order___PartialOrder___init(val_t self, int* init_table) {
506 struct trace_t trace = {NULL, NULL, 185, LOCATE_partial_order___PartialOrder___init};
507 val_t variable[4];
508 void **closurevariable = NULL;
509 trace.prev = tracehead; tracehead = &trace;
510 trace.file = LOCATE_partial_order;
511 variable[0] = self;
512 if (init_table[VAL2OBJ(variable[0])->vft[INIT_TABLE_POS_PartialOrder].i]) return;
513 variable[2] = variable[0];
514 variable[3] = NEW_HashMap_hash___HashMap___init(); /*new HashMap[E, PartialOrderElement[E]]*/
515 ATTR_partial_order___PartialOrder____elements(variable[2]) /*PartialOrder::_elements*/ = variable[3];
516 variable[2] = variable[0];
517 variable[3] = NEW_Array_array___Array___init(); /*new Array[E]*/
518 ATTR_partial_order___PartialOrder____elements_list(variable[2]) /*PartialOrder::_elements_list*/ = variable[3];
519 variable[2] = variable[0];
520 variable[3] = NEW_Array_array___Array___init(); /*new Array[E]*/
521 ATTR_partial_order___PartialOrder____roots(variable[2]) /*PartialOrder::_roots*/ = variable[3];
522 return_label24: while(false);
523 init_table[VAL2OBJ(variable[0])->vft[INIT_TABLE_POS_PartialOrder].i] = 1;
524 tracehead = trace.prev;
525 return;
526 }
527 val_t partial_order___PartialOrderElement___order(val_t self) {
528 struct trace_t trace = {NULL, NULL, 194, LOCATE_partial_order___PartialOrderElement___order};
529 val_t *variable = NULL;
530 void **closurevariable = NULL;
531 trace.prev = tracehead; tracehead = &trace;
532 trace.file = LOCATE_partial_order;
533 tracehead = trace.prev;
534 return ATTR_partial_order___PartialOrderElement____order( self) /*PartialOrderElement::_order*/;
535 }
536 val_t partial_order___PartialOrderElement___value(val_t self) {
537 struct trace_t trace = {NULL, NULL, 197, LOCATE_partial_order___PartialOrderElement___value};
538 val_t *variable = NULL;
539 void **closurevariable = NULL;
540 trace.prev = tracehead; tracehead = &trace;
541 trace.file = LOCATE_partial_order;
542 tracehead = trace.prev;
543 return ATTR_partial_order___PartialOrderElement____value( self) /*PartialOrderElement::_value*/;
544 }
545 val_t partial_order___PartialOrderElement___rank(val_t self) {
546 struct trace_t trace = {NULL, NULL, 200, LOCATE_partial_order___PartialOrderElement___rank};
547 val_t *variable = NULL;
548 void **closurevariable = NULL;
549 trace.prev = tracehead; tracehead = &trace;
550 trace.file = LOCATE_partial_order;
551 tracehead = trace.prev;
552 return ATTR_partial_order___PartialOrderElement____rank( self) /*PartialOrderElement::_rank*/;
553 }
554 val_t partial_order___PartialOrderElement___direct_greaters(val_t self) {
555 struct trace_t trace = {NULL, NULL, 206, LOCATE_partial_order___PartialOrderElement___direct_greaters};
556 val_t *variable = NULL;
557 void **closurevariable = NULL;
558 trace.prev = tracehead; tracehead = &trace;
559 trace.file = LOCATE_partial_order;
560 tracehead = trace.prev;
561 return ATTR_partial_order___PartialOrderElement____direct_greaters( self) /*PartialOrderElement::_direct_greaters*/;
562 }
563 val_t partial_order___PartialOrderElement___direct_smallers(val_t self) {
564 struct trace_t trace = {NULL, NULL, 209, LOCATE_partial_order___PartialOrderElement___direct_smallers};
565 val_t *variable = NULL;
566 void **closurevariable = NULL;
567 trace.prev = tracehead; tracehead = &trace;
568 trace.file = LOCATE_partial_order;
569 tracehead = trace.prev;
570 return ATTR_partial_order___PartialOrderElement____direct_smallers( self) /*PartialOrderElement::_direct_smallers*/;
571 }
572 val_t partial_order___PartialOrderElement___greaters(val_t self) {
573 struct trace_t trace = {NULL, NULL, 212, LOCATE_partial_order___PartialOrderElement___greaters};
574 val_t *variable = NULL;
575 void **closurevariable = NULL;
576 trace.prev = tracehead; tracehead = &trace;
577 trace.file = LOCATE_partial_order;
578 tracehead = trace.prev;
579 return ATTR_partial_order___PartialOrderElement____greaters( self) /*PartialOrderElement::_greaters*/;
580 }
581 val_t partial_order___PartialOrderElement___greaters_and_self(val_t self) {
582 struct trace_t trace = {NULL, NULL, 218, LOCATE_partial_order___PartialOrderElement___greaters_and_self};
583 val_t variable[4];
584 void **closurevariable = NULL;
585 trace.prev = tracehead; tracehead = &trace;
586 trace.file = LOCATE_partial_order;
587 variable[0] = self;
588 variable[2] = variable[0];
589 variable[2] = ATTR_partial_order___PartialOrderElement____greaters_and_self_cache(variable[2]) /*PartialOrderElement::_greaters_and_self_cache*/;
590 variable[2] = TAG_Bool((variable[2] == NIT_NULL /*null*/) || ((variable[2] != NIT_NULL) && UNTAG_Bool(CALL_kernel___Object_____eqeq(variable[2])(variable[2], NIT_NULL /*null*/) /*AbstractArray::==*/)));
591 if (UNTAG_Bool(variable[2])) { /*if*/
592 variable[2] = variable[0];
593 variable[3] = variable[0];
594 variable[3] = ATTR_partial_order___PartialOrderElement____greaters(variable[3]) /*PartialOrderElement::_greaters*/;
595 variable[3] = CALL_array___Collection___to_a(variable[3])(variable[3]) /*Collection::to_a*/;
596 ATTR_partial_order___PartialOrderElement____greaters_and_self_cache(variable[2]) /*PartialOrderElement::_greaters_and_self_cache*/ = variable[3];
597 variable[2] = variable[0];
598 variable[2] = ATTR_partial_order___PartialOrderElement____greaters_and_self_cache(variable[2]) /*PartialOrderElement::_greaters_and_self_cache*/;
599 variable[3] = variable[0];
600 variable[3] = ATTR_partial_order___PartialOrderElement____value(variable[3]) /*PartialOrderElement::_value*/;
601 CALL_abstract_collection___SimpleCollection___add(variable[2])(variable[2], variable[3]) /*AbstractArray::add*/;
602 }
603 variable[2] = variable[0];
604 variable[2] = ATTR_partial_order___PartialOrderElement____greaters_and_self_cache(variable[2]) /*PartialOrderElement::_greaters_and_self_cache*/;
605 variable[1] = variable[2];
606 goto return_label25;
607 return_label25: while(false);
608 tracehead = trace.prev;
609 return variable[1];
610 }
611 val_t partial_order___PartialOrderElement___smallers(val_t self) {
612 struct trace_t trace = {NULL, NULL, 234, LOCATE_partial_order___PartialOrderElement___smallers};
613 val_t variable[5];
614 void **closurevariable = NULL;
615 trace.prev = tracehead; tracehead = &trace;
616 trace.file = LOCATE_partial_order;
617 variable[0] = self;
618 variable[2] = variable[0];
619 variable[2] = ATTR_partial_order___PartialOrderElement____smallers_last_length(variable[2]) /*PartialOrderElement::_smallers_last_length*/;
620 variable[3] = variable[0];
621 variable[3] = ATTR_partial_order___PartialOrderElement____order(variable[3]) /*PartialOrderElement::_order*/;
622 variable[3] = CALL_abstract_collection___Collection___length(variable[3])(variable[3]) /*PartialOrder::length*/;
623 variable[2] = TAG_Bool(UNTAG_Int(variable[2])<UNTAG_Int(variable[3]));
624 if (UNTAG_Bool(variable[2])) { /*if*/
625 variable[2] = variable[0];
626 variable[2] = ATTR_partial_order___PartialOrderElement____order(variable[2]) /*PartialOrderElement::_order*/;
627 variable[3] = variable[0];
628 variable[4] = variable[0];
629 variable[4] = ATTR_partial_order___PartialOrderElement____smallers_cache(variable[4]) /*PartialOrderElement::_smallers_cache*/;
630 CALL_partial_order___PartialOrder___compute_smallers_for(variable[2])(variable[2], variable[3], variable[4]) /*PartialOrder::compute_smallers_for*/;
631 variable[2] = variable[0];
632 variable[3] = variable[0];
633 variable[3] = ATTR_partial_order___PartialOrderElement____order(variable[3]) /*PartialOrderElement::_order*/;
634 variable[3] = CALL_abstract_collection___Collection___length(variable[3])(variable[3]) /*PartialOrder::length*/;
635 ATTR_partial_order___PartialOrderElement____smallers_last_length(variable[2]) /*PartialOrderElement::_smallers_last_length*/ = variable[3];
636 }
637 variable[2] = variable[0];
638 variable[2] = ATTR_partial_order___PartialOrderElement____smallers_cache(variable[2]) /*PartialOrderElement::_smallers_cache*/;
639 variable[1] = variable[2];
640 goto return_label26;
641 return_label26: while(false);
642 tracehead = trace.prev;
643 return variable[1];
644 }
645 val_t partial_order___PartialOrderElement___linear_extension(val_t self) {
646 struct trace_t trace = {NULL, NULL, 247, LOCATE_partial_order___PartialOrderElement___linear_extension};
647 val_t variable[12];
648 void **closurevariable = NULL;
649 trace.prev = tracehead; tracehead = &trace;
650 trace.file = LOCATE_partial_order;
651 variable[0] = self;
652 variable[2] = variable[0];
653 variable[2] = ATTR_partial_order___PartialOrderElement____linear_extension_cache(variable[2]) /*PartialOrderElement::_linear_extension_cache*/;
654 variable[2] = TAG_Bool((variable[2] == NIT_NULL /*null*/) || ((variable[2] != NIT_NULL) && UNTAG_Bool(CALL_kernel___Object_____eqeq(variable[2])(variable[2], NIT_NULL /*null*/) /*AbstractArray::==*/)));
655 if (UNTAG_Bool(variable[2])) { /*if*/
656 variable[3] = NEW_Array_array___Array___init(); /*new Array[E]*/
657 variable[2] = variable[3];
658 variable[4] = NEW_Array_array___Array___init(); /*new Array[E]*/
659 variable[3] = variable[4];
660 variable[4] = variable[0];
661 variable[4] = CALL_partial_order___PartialOrderElement___value(variable[4])(variable[4]) /*PartialOrderElement::value*/;
662 CALL_abstract_collection___SimpleCollection___add( variable[2] /*res*/)( variable[2] /*res*/, variable[4]) /*AbstractArray::add*/;
663 variable[4] = variable[0];
664 variable[4] = CALL_partial_order___PartialOrderElement___direct_greaters(variable[4])(variable[4]) /*PartialOrderElement::direct_greaters*/;
665 variable[4] = CALL_abstract_collection___Collection___iterator(variable[4])(variable[4]) /*AbstractArray::iterator*/;
666 while (true) { /*for*/
667 variable[5] = CALL_abstract_collection___Iterator___is_ok(variable[4])(variable[4]) /*ArrayIterator::is_ok*/;
668 if (!UNTAG_Bool(variable[5])) break; /*for*/
669 variable[5] = CALL_abstract_collection___Iterator___item(variable[4])(variable[4]) /*ArrayIterator::item*/;
670 variable[6] = variable[5];
671 variable[8] = variable[0];
672 variable[8] = CALL_partial_order___PartialOrderElement___order(variable[8])(variable[8]) /*PartialOrderElement::order*/;
673 variable[8] = CALL_partial_order___PartialOrder_____bra(variable[8])(variable[8], variable[6] /*s*/) /*PartialOrder::[]*/;
674 variable[8] = CALL_partial_order___PartialOrderElement___linear_extension(variable[8])(variable[8]) /*PartialOrderElement::linear_extension*/;
675 variable[7] = variable[8];
676 CALL_abstract_collection___RemovableCollection___clear( variable[3] /*res2*/)( variable[3] /*res2*/) /*AbstractArray::clear*/;
677 variable[8] = CALL_abstract_collection___Collection___iterator( variable[2] /*res*/)( variable[2] /*res*/) /*AbstractArray::iterator*/;
678 while (true) { /*for*/
679 variable[9] = CALL_abstract_collection___Iterator___is_ok(variable[8])(variable[8]) /*ArrayIterator::is_ok*/;
680 if (!UNTAG_Bool(variable[9])) break; /*for*/
681 variable[9] = CALL_abstract_collection___Iterator___item(variable[8])(variable[8]) /*ArrayIterator::item*/;
682 variable[10] = variable[9];
683 variable[11] = CALL_abstract_collection___Collection___has( variable[7] /*sl*/)( variable[7] /*sl*/, variable[10] /*e*/) /*AbstractArray::has*/;
684 if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable[11])))) { /*if*/
685 CALL_abstract_collection___SimpleCollection___add( variable[3] /*res2*/)( variable[3] /*res2*/, variable[10] /*e*/) /*AbstractArray::add*/;
686 }
687 continue_29: while(0);
688 CALL_abstract_collection___Iterator___next(variable[8])(variable[8]) /*ArrayIterator::next*/;
689 }
690 break_29: while(0);
691 CALL_abstract_collection___IndexedCollection___append( variable[3] /*res2*/)( variable[3] /*res2*/, variable[7] /*sl*/) /*IndexedCollection::append*/;
692 variable[8] = variable[2] /*res*/;
693 variable[2] = variable[3] /*res2*/ /*res=*/;
694 variable[3] = variable[8] /*tmp*/ /*res2=*/;
695 continue_28: while(0);
696 CALL_abstract_collection___Iterator___next(variable[4])(variable[4]) /*ArrayIterator::next*/;
697 }
698 break_28: while(0);
699 variable[4] = variable[0];
700 ATTR_partial_order___PartialOrderElement____linear_extension_cache(variable[4]) /*PartialOrderElement::_linear_extension_cache*/ = variable[2] /*res*/;
701 }
702 variable[2] = variable[0];
703 variable[2] = ATTR_partial_order___PartialOrderElement____linear_extension_cache(variable[2]) /*PartialOrderElement::_linear_extension_cache*/;
704 variable[1] = variable[2];
705 goto return_label27;
706 return_label27: while(false);
707 tracehead = trace.prev;
708 return variable[1];
709 }
710 val_t partial_order___PartialOrderElement___reverse_linear_extension(val_t self) {
711 struct trace_t trace = {NULL, NULL, 275, LOCATE_partial_order___PartialOrderElement___reverse_linear_extension};
712 val_t variable[8];
713 void **closurevariable = NULL;
714 trace.prev = tracehead; tracehead = &trace;
715 trace.file = LOCATE_partial_order;
716 variable[0] = self;
717 variable[2] = variable[0];
718 variable[2] = ATTR_partial_order___PartialOrderElement____reverse_linear_extension_cache(variable[2]) /*PartialOrderElement::_reverse_linear_extension_cache*/;
719 variable[2] = TAG_Bool((variable[2] == NIT_NULL /*null*/) || ((variable[2] != NIT_NULL) && UNTAG_Bool(CALL_kernel___Object_____eqeq(variable[2])(variable[2], NIT_NULL /*null*/) /*AbstractArray::==*/)));
720 if (UNTAG_Bool(variable[2])) { /*if*/
721 variable[3] = NEW_HashSet_hash___HashSet___init(); /*new HashSet[E]*/
722 variable[2] = variable[3];
723 variable[3] = variable[0];
724 variable[3] = CALL_partial_order___PartialOrderElement___direct_greaters(variable[3])(variable[3]) /*PartialOrderElement::direct_greaters*/;
725 variable[3] = CALL_abstract_collection___Collection___iterator(variable[3])(variable[3]) /*AbstractArray::iterator*/;
726 while (true) { /*for*/
727 variable[4] = CALL_abstract_collection___Iterator___is_ok(variable[3])(variable[3]) /*ArrayIterator::is_ok*/;
728 if (!UNTAG_Bool(variable[4])) break; /*for*/
729 variable[4] = CALL_abstract_collection___Iterator___item(variable[3])(variable[3]) /*ArrayIterator::item*/;
730 variable[5] = variable[4];
731 variable[7] = variable[0];
732 variable[7] = CALL_partial_order___PartialOrderElement___order(variable[7])(variable[7]) /*PartialOrderElement::order*/;
733 variable[7] = CALL_partial_order___PartialOrder_____bra(variable[7])(variable[7], variable[5] /*s*/) /*PartialOrder::[]*/;
734 variable[7] = CALL_partial_order___PartialOrderElement___linear_extension(variable[7])(variable[7]) /*PartialOrderElement::linear_extension*/;
735 variable[6] = variable[7];
736 CALL_abstract_collection___SimpleCollection___add_all( variable[2] /*res*/)( variable[2] /*res*/, variable[6] /*sl*/) /*SimpleCollection::add_all*/;
737 continue_31: while(0);
738 CALL_abstract_collection___Iterator___next(variable[3])(variable[3]) /*ArrayIterator::next*/;
739 }
740 break_31: while(0);
741 variable[3] = variable[0];
742 variable[3] = CALL_partial_order___PartialOrderElement___value(variable[3])(variable[3]) /*PartialOrderElement::value*/;
743 CALL_abstract_collection___SimpleCollection___add( variable[2] /*res*/)( variable[2] /*res*/, variable[3]) /*HashSet::add*/;
744 variable[3] = variable[0];
745 variable[4] = CALL_array___Collection___to_a( variable[2] /*res*/)( variable[2] /*res*/) /*Collection::to_a*/;
746 ATTR_partial_order___PartialOrderElement____linear_extension_cache(variable[3]) /*PartialOrderElement::_linear_extension_cache*/ = variable[4];
747 }
748 variable[2] = variable[0];
749 variable[2] = ATTR_partial_order___PartialOrderElement____linear_extension_cache(variable[2]) /*PartialOrderElement::_linear_extension_cache*/;
750 variable[1] = variable[2];
751 goto return_label30;
752 return_label30: while(false);
753 tracehead = trace.prev;
754 return variable[1];
755 }
756 val_t partial_order___PartialOrderElement_____l(val_t self, val_t param0) {
757 struct trace_t trace = {NULL, NULL, 291, LOCATE_partial_order___PartialOrderElement_____l};
758 val_t variable[4];
759 void **closurevariable = NULL;
760 trace.prev = tracehead; tracehead = &trace;
761 trace.file = LOCATE_partial_order;
762 variable[0] = self;
763 variable[1] = param0;
764 variable[3] = variable[0];
765 variable[3] = ATTR_partial_order___PartialOrderElement____greaters(variable[3]) /*PartialOrderElement::_greaters*/;
766 variable[3] = CALL_abstract_collection___Collection___has(variable[3])(variable[3], variable[1] /*o*/) /*Collection::has*/;
767 variable[2] = variable[3];
768 goto return_label32;
769 return_label32: while(false);
770 tracehead = trace.prev;
771 return variable[2];
772 }
773 val_t partial_order___PartialOrderElement_____leq(val_t self, val_t param0) {
774 struct trace_t trace = {NULL, NULL, 297, LOCATE_partial_order___PartialOrderElement_____leq};
775 val_t variable[5];
776 void **closurevariable = NULL;
777 trace.prev = tracehead; tracehead = &trace;
778 trace.file = LOCATE_partial_order;
779 variable[0] = self;
780 variable[1] = param0;
781 variable[3] = variable[0];
782 variable[3] = ATTR_partial_order___PartialOrderElement____value(variable[3]) /*PartialOrderElement::_value*/;
783 variable[3] = TAG_Bool((variable[3] == variable[1] /*o*/) || ((variable[3] != NIT_NULL) && ((CALL_kernel___Object_____eqeq(variable[3])==kernel___Object_____eqeq)?(IS_EQUAL_NN(variable[3], variable[1] /*o*/)):(UNTAG_Bool(CALL_kernel___Object_____eqeq(variable[3])(variable[3], variable[1] /*o*/) /*Object::==*/)))));
784 variable[4] = variable[3];
785 if (!UNTAG_Bool(variable[4])) { /* or */
786 variable[4] = variable[0];
787 variable[4] = ATTR_partial_order___PartialOrderElement____greaters(variable[4]) /*PartialOrderElement::_greaters*/;
788 variable[4] = CALL_abstract_collection___Collection___has(variable[4])(variable[4], variable[1] /*o*/) /*Collection::has*/;
789 }
790 variable[3] = variable[4];
791 variable[2] = variable[3];
792 goto return_label33;
793 return_label33: while(false);
794 tracehead = trace.prev;
795 return variable[2];
796 }
797 val_t partial_order___PartialOrderElement_____g(val_t self, val_t param0) {
798 struct trace_t trace = {NULL, NULL, 303, LOCATE_partial_order___PartialOrderElement_____g};
799 val_t variable[5];
800 void **closurevariable = NULL;
801 trace.prev = tracehead; tracehead = &trace;
802 trace.file = LOCATE_partial_order;
803 variable[0] = self;
804 variable[1] = param0;
805 variable[3] = variable[0];
806 variable[3] = ATTR_partial_order___PartialOrderElement____order(variable[3]) /*PartialOrderElement::_order*/;
807 variable[3] = CALL_partial_order___PartialOrder_____bra(variable[3])(variable[3], variable[1] /*o*/) /*PartialOrder::[]*/;
808 variable[4] = variable[0];
809 variable[4] = ATTR_partial_order___PartialOrderElement____value(variable[4]) /*PartialOrderElement::_value*/;
810 variable[3] = CALL_partial_order___PartialOrderElement_____l(variable[3])(variable[3], variable[4]) /*PartialOrderElement::<*/;
811 variable[2] = variable[3];
812 goto return_label34;
813 return_label34: while(false);
814 tracehead = trace.prev;
815 return variable[2];
816 }
817 val_t partial_order___PartialOrderElement_____geq(val_t self, val_t param0) {
818 struct trace_t trace = {NULL, NULL, 309, LOCATE_partial_order___PartialOrderElement_____geq};
819 val_t variable[6];
820 void **closurevariable = NULL;
821 trace.prev = tracehead; tracehead = &trace;
822 trace.file = LOCATE_partial_order;
823 variable[0] = self;
824 variable[1] = param0;
825 variable[3] = variable[0];
826 variable[3] = ATTR_partial_order___PartialOrderElement____value(variable[3]) /*PartialOrderElement::_value*/;
827 variable[3] = TAG_Bool((variable[3] == variable[1] /*o*/) || ((variable[3] != NIT_NULL) && ((CALL_kernel___Object_____eqeq(variable[3])==kernel___Object_____eqeq)?(IS_EQUAL_NN(variable[3], variable[1] /*o*/)):(UNTAG_Bool(CALL_kernel___Object_____eqeq(variable[3])(variable[3], variable[1] /*o*/) /*Object::==*/)))));
828 variable[4] = variable[3];
829 if (!UNTAG_Bool(variable[4])) { /* or */
830 variable[4] = variable[0];
831 variable[4] = ATTR_partial_order___PartialOrderElement____order(variable[4]) /*PartialOrderElement::_order*/;
832 variable[4] = CALL_partial_order___PartialOrder_____bra(variable[4])(variable[4], variable[1] /*o*/) /*PartialOrder::[]*/;
833 variable[5] = variable[0];
834 variable[5] = ATTR_partial_order___PartialOrderElement____value(variable[5]) /*PartialOrderElement::_value*/;
835 variable[4] = CALL_partial_order___PartialOrderElement_____l(variable[4])(variable[4], variable[5]) /*PartialOrderElement::<*/;
836 }
837 variable[3] = variable[4];
838 variable[2] = variable[3];
839 goto return_label35;
840 return_label35: while(false);
841 tracehead = trace.prev;
842 return variable[2];
843 }
844 void partial_order___PartialOrderElement___register_direct_smallers(val_t self, val_t param0) {
845 struct trace_t trace = {NULL, NULL, 315, LOCATE_partial_order___PartialOrderElement___register_direct_smallers};
846 val_t variable[4];
847 void **closurevariable = NULL;
848 trace.prev = tracehead; tracehead = &trace;
849 trace.file = LOCATE_partial_order;
850 variable[0] = self;
851 variable[1] = param0;
852 variable[3] = variable[0];
853 variable[3] = ATTR_partial_order___PartialOrderElement____direct_smallers(variable[3]) /*PartialOrderElement::_direct_smallers*/;
854 CALL_abstract_collection___SimpleCollection___add(variable[3])(variable[3], variable[1] /*e*/) /*AbstractArray::add*/;
855 return_label36: while(false);
856 tracehead = trace.prev;
857 return;
858 }
859 void partial_order___PartialOrderElement___init(val_t self, val_t param0, val_t param1, val_t param2, int* init_table) {
860 struct trace_t trace = {NULL, NULL, 320, LOCATE_partial_order___PartialOrderElement___init};
861 val_t variable[14];
862 void **closurevariable = NULL;
863 trace.prev = tracehead; tracehead = &trace;
864 trace.file = LOCATE_partial_order;
865 variable[0] = self;
866 variable[1] = param0;
867 variable[2] = param1;
868 variable[3] = param2;
869 if (init_table[VAL2OBJ(variable[0])->vft[INIT_TABLE_POS_PartialOrderElement].i]) return;
870 variable[5] = variable[0];
871 ATTR_partial_order___PartialOrderElement____order(variable[5]) /*PartialOrderElement::_order*/ = variable[1] /*o*/;
872 variable[5] = variable[0];
873 ATTR_partial_order___PartialOrderElement____value(variable[5]) /*PartialOrderElement::_value*/ = variable[2] /*e*/;
874 variable[5] = variable[0];
875 ATTR_partial_order___PartialOrderElement____direct_greaters(variable[5]) /*PartialOrderElement::_direct_greaters*/ = variable[3] /*directs*/;
876 variable[5] = variable[0];
877 variable[6] = NEW_Array_array___Array___init(); /*new Array[E]*/
878 ATTR_partial_order___PartialOrderElement____direct_smallers(variable[5]) /*PartialOrderElement::_direct_smallers*/ = variable[6];
879 variable[5] = variable[0];
880 variable[6] = NEW_HashSet_hash___HashSet___init(); /*new HashSet[E]*/
881 ATTR_partial_order___PartialOrderElement____greaters(variable[5]) /*PartialOrderElement::_greaters*/ = variable[6];
882 variable[5] = variable[0];
883 variable[6] = NEW_HashSet_hash___HashSet___init(); /*new HashSet[E]*/
884 ATTR_partial_order___PartialOrderElement____smallers_cache(variable[5]) /*PartialOrderElement::_smallers_cache*/ = variable[6];
885 variable[6] = variable[0];
886 variable[6] = ATTR_partial_order___PartialOrderElement____greaters(variable[6]) /*PartialOrderElement::_greaters*/;
887 variable[5] = variable[6];
888 variable[6] = TAG_Int(0);
889 variable[7] = CALL_abstract_collection___Collection___iterator( variable[3] /*directs*/)( variable[3] /*directs*/) /*AbstractArray::iterator*/;
890 while (true) { /*for*/
891 variable[8] = CALL_abstract_collection___Iterator___is_ok(variable[7])(variable[7]) /*ArrayIterator::is_ok*/;
892 if (!UNTAG_Bool(variable[8])) break; /*for*/
893 variable[8] = CALL_abstract_collection___Iterator___item(variable[7])(variable[7]) /*ArrayIterator::item*/;
894 variable[9] = variable[8];
895 CALL_abstract_collection___SimpleCollection___add( variable[5] /*g*/)( variable[5] /*g*/, variable[9] /*ee*/) /*SimpleCollection::add*/;
896 variable[11] = variable[0];
897 variable[11] = ATTR_partial_order___PartialOrderElement____order(variable[11]) /*PartialOrderElement::_order*/;
898 variable[11] = CALL_partial_order___PartialOrder_____bra(variable[11])(variable[11], variable[9] /*ee*/) /*PartialOrder::[]*/;
899 variable[10] = variable[11];
900 variable[11] = CALL_partial_order___PartialOrderElement___rank( variable[10] /*poee*/)( variable[10] /*poee*/) /*PartialOrderElement::rank*/;
901 variable[11] = TAG_Bool(UNTAG_Int(variable[11])>=UNTAG_Int( variable[6] /*r*/));
902 if (UNTAG_Bool(variable[11])) { /*if*/
903 variable[11] = CALL_partial_order___PartialOrderElement___rank( variable[10] /*poee*/)( variable[10] /*poee*/) /*PartialOrderElement::rank*/;
904 variable[11] = TAG_Int(UNTAG_Int(variable[11])+UNTAG_Int( TAG_Int(1)));
905 variable[6] = variable[11] /*r=*/;
906 }
907 CALL_partial_order___PartialOrderElement___register_direct_smallers( variable[10] /*poee*/)( variable[10] /*poee*/, variable[2] /*e*/) /*PartialOrderElement::register_direct_smallers*/;
908 variable[11] = CALL_partial_order___PartialOrderElement___greaters( variable[10] /*poee*/)( variable[10] /*poee*/) /*PartialOrderElement::greaters*/;
909 variable[11] = CALL_abstract_collection___Collection___iterator(variable[11])(variable[11]) /*Collection::iterator*/;
910 while (true) { /*for*/
911 variable[12] = CALL_abstract_collection___Iterator___is_ok(variable[11])(variable[11]) /*Iterator::is_ok*/;
912 if (!UNTAG_Bool(variable[12])) break; /*for*/
913 variable[12] = CALL_abstract_collection___Iterator___item(variable[11])(variable[11]) /*Iterator::item*/;
914 variable[13] = variable[12];
915 CALL_abstract_collection___SimpleCollection___add( variable[5] /*g*/)( variable[5] /*g*/, variable[13] /*eee*/) /*SimpleCollection::add*/;
916 continue_39: while(0);
917 CALL_abstract_collection___Iterator___next(variable[11])(variable[11]) /*Iterator::next*/;
918 }
919 break_39: while(0);
920 continue_38: while(0);
921 CALL_abstract_collection___Iterator___next(variable[7])(variable[7]) /*ArrayIterator::next*/;
922 }
923 break_38: while(0);
924 variable[7] = variable[0];
925 ATTR_partial_order___PartialOrderElement____rank(variable[7]) /*PartialOrderElement::_rank*/ = variable[6] /*r*/;
926 return_label37: while(false);
927 init_table[VAL2OBJ(variable[0])->vft[INIT_TABLE_POS_PartialOrderElement].i] = 1;
928 tracehead = trace.prev;
929 return;
930 }