summary refs log tree commit diff stats
path: root/compiler/semtypinst.nim
Commit message (Collapse)AuthorAgeFilesLines
* move assertions out of system (#19599)flywind2022-03-231-0/+3
|
* test whether it is unnecessary (#18893)flywind2021-10-141-1/+1
|
* Alternative to #18928 (#18931)Jason Beetham2021-09-301-6/+6
| | | | | * fixed #18841 * Added test
* semtypinst: don't wrap type nodes from expressions in static[T] (#18860)alaviss2021-09-171-1/+1
|
* Fixed #18838 (#18841) [backport]Jason Beetham2021-09-131-1/+5
|
* Fix recursive generic typed defs (#18809)Jason Beetham2021-09-061-1/+1
|
* fixes #16246 (#18800)Andreas Rumpf2021-09-041-1/+1
|
* ORC: improvements (#17993)Andreas Rumpf2021-05-121-1/+1
| | | | * ORC: improvements * ORC: fix .acyclic annotation for ref objects
* new-style concepts implementation, WIP (#15251)Andreas Rumpf2021-02-241-1/+3
| | | | | | | | | | | | | * fixes #15210 [backport:1.2] * make tests green * make ordinal work * makes Swapable test compile * make Indexable example work * concepts: 'self' is now 'Self' * concepts: make Dictionary example compile * document the new concept implementation * concepts: make typeDesc work properly * concepts: allow documentation comments (d'oh)
* fixed dot operator recursive loop & macro suggest (#16922)Saem Ghani2021-02-151-0/+2
| | | | | | | | | | | | | | | | | | * basic stability improvements; refs nimsuggest * fixed dot operator recursive loop & macro suggest * hacky fix for run away dot operator sem check Committing this mostly to make the issue more clear. Perhaps get better feedback. * semExprWithType seems like a better place to check * fixed error messages const case expressions * Clean-up test * stopped the dot operator madness No longer get infinite recursion when seming broken code with a dot operator macro like in jsffi. Co-authored-by: Araq <rumpf_a@web.de>
* IC: final implementation steps (#16801)Andreas Rumpf2021-01-251-4/+4
| | | | | | | | * removed dead code * we need even more laziness for the generic caches * make it bootstrap on older Nims * wrote more deserialization code * IC: replay required methods information
* IC: next steps (#16729)Andreas Rumpf2021-01-231-19/+14
| | | | | | | | | | | * IC: dead code elimination pass * preparations for a different codegen strategy * added documentation to the newly written code * IC: backend code * IC: backend adjustments * optimized the compiler a bit * IC: yet another massive refactoring * fixes regressions * cleanups
* IC: next steps (#16705)Andreas Rumpf2021-01-141-18/+0
| | | | | | | | | | | * code cleanups * refactorings for IC * more refactorings for IC * IC: attach the 'nil' type to its module * IC: refactorings and improvements * IC: progress * IC: more serialization fixes * IC: embarrassing omission * code cleanups
* big steps torwards an efficient, simple IC implementation (#16543)Andreas Rumpf2021-01-021-3/+3
| | | | | | | | | | | | | | | | | | | * reworked ID handling * the packed AST now has its own ID mechanism * basic serialization code works * extract rodfiles to its own module * rodfiles: store and compare configs * rodfiles: store dependencies * store config at the end * precise dependency tracking * dependency tracking for rodfiles * completed loading of PSym, PType, etc * removed dead code * bugfix: do not realloc seqs when taking addr into an element * make IC opt-in for now * makes tcompilerapi green again * final cleanups Co-authored-by: Andy Davidoff <github@andy.disruptek.com>
* explicit ID generation for easier IC (#15559)Andreas Rumpf2020-10-251-7/+12
| | | | | | | | | | | | | | | | | * refactoring: idents don't need inheritance * refactoring: adding an IdGenerator (part 1) * refactoring: adding an IdGenerator (part 2) * refactoring: adding an IdGenerator (part 3) * refactoring: adding an IdGenerator (part 4) * refactoring: adding an IdGenerator (part 5) * refactoring: adding an IdGenerator (part 5) * IdGenerator must be a ref type; hello world works again * make bootstrapping work again * progress: add back the 'exactReplica' ideas * added back the missing exactReplica hacks * make tcompilerapi work again * make important packages green * attempt to fix the build for 32 bit machines (probably need a better solution here)
* Expand hoisted default params in sem (#15270)Clyybber2020-09-051-1/+1
| | | | | | | | | * Expand hoisted default params in sem Introduce ast.newTree{I,IT} Add test for default params in procs * Cleanup * Simplify hoist transformation and expand test
* Big compiler Cleanup (#14777)Clyybber2020-08-281-2/+1
|
* fix #14698 nkRecWhen caused internalAssert in semConstructFields when ↵Timothee Cour2020-07-271-1/+4
| | | | | | | | | | | generic type not mentioned in fields (#14709) * fix #14698 nkRecWhen caused internalAssert in semConstructFields when generic type not mentioned in fields * address comment * Update compiler/semtypinst.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* [cleanups] doassert => doAssert; mark deadcode (#14711)Timothee Cour2020-06-171-10/+12
|
* fixes #14315 (#14594)Andreas Rumpf2020-06-071-2/+1
|
* avoid unsafe Nim features in preparation for --gc:arc (#14431)Andreas Rumpf2020-05-221-12/+13
|
* Replace tfHasRequiresInit with a more accurate mechanismZahary Karadjov2020-04-011-0/+2
| | | | | | | | | The new mechanism can deal with more complex scenarios such as not nil field appearing in a non-default case object branch or a field within a generic object that may depend on a when branch. The commit also plugs another hole: the user is no longer able to create illegal default values through seq.setLen(N).
* fixes #13646Araq2020-03-161-0/+3
|
* minor code style changesAraq2020-03-161-1/+1
|
* ARC related bugfixes and refactorings (#12781)Andreas Rumpf2019-12-051-1/+3
|
* Cosmetic compiler cleanup (#12718)Clyybber2019-11-281-75/+74
| | | | | | | | | | | | | | | | | | * Cleanup compiler code base * Unify add calls * Unify len invocations * Unify range operators * Fix oversight * Remove {.procvar.} pragma * initCandidate -> newCandidate where reasonable * Unify safeLen calls
* fixes #12336 [backport]Andreas Rumpf2019-10-021-1/+1
|
* Fix spellings (#12277) [backport]Federico Ceratto2019-09-271-3/+3
|
* some gc:destructors progressAndreas Rumpf2019-09-161-14/+0
|
* Small ast.nim cleanup (#12156)Clyybber2019-09-091-14/+14
| | | | | * Remove sonsLen * Use Indexable
* fixes #7258 (#12054)Andreas Rumpf2019-08-261-1/+25
|
* fixes tcompiletimerange [bugfix] (#11720)Andreas Rumpf2019-07-121-0/+20
|
* styleCheck: make the compiler and large parts of the stdlib compatible with ↵Araq2019-07-101-1/+1
| | | | --styleCheck:error
* fixes #11660 (#11677)Andreas Rumpf2019-07-071-1/+4
|
* fixes #7816 (#11261)Andreas Rumpf2019-05-151-0/+1
|
* Merge pull request #11201 from nim-lang/araq-fixes-11200Andreas Rumpf2019-05-081-1/+1
|\ | | | | fixes 11200
| * fixes #11200Araq2019-05-081-1/+1
| |
* | Replace countup(x, y-1) with x ..< yClyybber2019-05-071-7/+7
|/
* Fix 105, few fixes for 101 (#11148)genotrance2019-05-041-2/+4
|
* destructors: internal compiler refactoringAraq2019-04-181-13/+12
|
* more destructor based changes (#10885)Andreas Rumpf2019-03-231-2/+2
| | | | | | | | | | | * mark user defined destructors with sfOverriden to simplify the logic * refactoring in preparation to merge liftings and generic instantiations for destructors * ast: introduce nkHiddenTryStmt for destructor generation in order to be able to optimize better the code later on * renamed 'patterns' switch to 'trmacros' as it was totally misleading before * destructors: introduce tfCheckedForDestructor flag in preparation of strict =destroy checking * test for invalid/too late destructor introductions * liftdestructors: make code robust for nimsuggest * --newruntime works for hello world again * newruntime: code generation for closures
* fixes #10884 (#10887)Andreas Rumpf2019-03-221-1/+1
|
* Size ptr tuple (#10846)Arne Döring2019-03-181-2/+1
| | | | | | * fixes #10117 * Add support for recursive tuples * detect in generics
* --newruntime: work in progressAndreas Rumpf2019-03-141-1/+1
|
* introduce tfHasOwned for fast must-move checkings; removed tfAcyclic as the ↵Andreas Rumpf2019-03-051-5/+1
| | | | GC has ignored this hint for quite some time now
* gc:destructors: progressAndreas Rumpf2019-02-281-0/+16
|
* first steps in implementing 'owned' pointers; undocumented, do not useAndreas Rumpf2019-02-231-1/+1
|
* Propagate tfGcSafe flag to generic instantiations (#10620)LemonBoy2019-02-131-3/+2
| | | Fixes a nasty endless loop in the generic instantiation phase.
* gc: destructors is beginning to work (#10483)Andreas Rumpf2019-01-291-13/+24
| | | | | | | | | | | | | | | | * kochdocs.nim: code cleanup * docgen: nicer indentation * parser.nim: code cleanup * fixes #10458 * make tests green again * make =destroy mixins * gc:destructors: produced C code is almost working * --gc:destructors simple program compiles (but leaks memory) * gc:destructors make examples compile in C++ mode * destructors: string implementation bugfixes * strs.nim: minor code cleanup * destructors: builtin seqs are beginning to work * remove debugging helpers
* Fix for issue #10342. better message for generic subclass instantiation (#10354)Ray Imber2019-01-221-1/+14
| | | * Fix for issue #10342. better message for generic subclass instantiation errors.
Agaram <vc@akkartik.com> 2015-05-13 10:03:26 -0700 1363 - rename 'integer' to 'number'' href='/akkartik/mu/commit/024compare.cc?h=main&id=5497090aa1e708c22cd240913a53dda32bb067aa'>5497090a ^
9dc29482 ^
57699011 ^
9dc29482 ^
0487a30e ^
1ead3562 ^
bc643692 ^
0487a30e ^


051c4738 ^
1ead3562 ^
bc643692 ^
0487a30e ^


1848b18f ^
a1d703b3 ^
9dc29482 ^
795f5244 ^
5fdd8e96 ^
a1d703b3 ^
5fdd8e96 ^
1b76245c ^
e4630643 ^

5fdd8e96 ^

1b76245c ^
5fdd8e96 ^
e4630643 ^
0487a30e ^
bff0fa45 ^







5fdd8e96 ^




ac0e9db5 ^
827898fc ^
0487a30e ^


cfb142b9 ^
827898fc ^
9dc29482 ^


a1d703b3 ^
1ead3562 ^
bc643692 ^

5497090a ^
9dc29482 ^
57699011 ^
9dc29482 ^
051c4738 ^
1ead3562 ^
bc643692 ^

5497090a ^
9dc29482 ^
57699011 ^
9dc29482 ^
0487a30e ^
1ead3562 ^
bc643692 ^
0487a30e ^


051c4738 ^
1ead3562 ^
bc643692 ^
0487a30e ^


1848b18f ^

9dc29482 ^
795f5244 ^
5fdd8e96 ^
9dc29482 ^
5fdd8e96 ^
1b76245c ^
e4630643 ^

5fdd8e96 ^

1b76245c ^
5fdd8e96 ^
e4630643 ^
0487a30e ^
bff0fa45 ^







5fdd8e96 ^




ac0e9db5 ^
827898fc ^
0487a30e ^


cfb142b9 ^
827898fc ^
9dc29482 ^


88be3dbc ^
1ead3562 ^
bc643692 ^

5497090a ^
9dc29482 ^
57699011 ^
9dc29482 ^
051c4738 ^
1ead3562 ^
bc643692 ^

5497090a ^
9dc29482 ^
57699011 ^
9dc29482 ^
051c4738 ^
1ead3562 ^
bc643692 ^

5497090a ^
9dc29482 ^
57699011 ^
9dc29482 ^
0487a30e ^
1ead3562 ^
bc643692 ^
0487a30e ^


051c4738 ^
1ead3562 ^
bc643692 ^
0487a30e ^


1848b18f ^

9dc29482 ^
795f5244 ^
5fdd8e96 ^
9dc29482 ^
5fdd8e96 ^
1b76245c ^
e4630643 ^

5fdd8e96 ^

1b76245c ^
5fdd8e96 ^
e4630643 ^
0487a30e ^
bff0fa45 ^







5fdd8e96 ^




ac0e9db5 ^
827898fc ^
0487a30e ^


cfb142b9 ^
827898fc ^
9dc29482 ^


88be3dbc ^
1ead3562 ^
bc643692 ^

5497090a ^
9dc29482 ^
57699011 ^
9dc29482 ^
051c4738 ^
1ead3562 ^
bc643692 ^

5497090a ^
9dc29482 ^
57699011 ^
9dc29482 ^
051c4738 ^
1ead3562 ^
bc643692 ^

5497090a ^
9dc29482 ^
57699011 ^
0487a30e ^

1ead3562 ^
bc643692 ^
0487a30e ^


051c4738 ^
1ead3562 ^
bc643692 ^
0487a30e ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
                         
 
                                             
      
                                        
                                    
                                       
             
                                    
                                                                                                                                         

          







                                                                                                                                              



                                                
                                               
                     
                                                         
                                                                                       



                     
                     
                                   


        
                 
          

                     
                                       
 
                      
                      
                             
 
                   
          

                     
                                       
 
                      
                      
                             
 
                          
          
                               


                             
                            
          
                               


                             

                                             
                                        
                                                  
                                       
                    
                                    
                                                                                                                                                

          

                                                              
                                                                                                                                                        
                                       
     
   







                                                                                                                                                     




                                                
                                                             
                                                               


                     
                     
                                   


        
                        
          

                     
                                              
 
                             
 
                          
          

                     
                                              
 
                             
 
                                 
          
                                      


                             
                                   
          
                                      


                             
                                             
            
                                        
                                                
                                       
                   
                                    
                                                                                                                                               

          

                                                              
                                                                                                                                                       
                                       
     
   







                                                                                                                                                    




                                                
                                                             
                                                               


                     
                     
                                   


        
                       
          

                     
                                             
 
                             
 
                         
          

                     
                                             
 
                             
 
                                
          
                                     


                             
                                  
          
                                     


                             

                                             
                                        
                                                          
                                       
                        
                                    
                                                                                                                                                    

          

                                                              
                                                                                                                                                            
                                       
     
   







                                                                                                                                                         




                                                
                                                             
                                                              


                     
                     
                                   


        
                            
          

                     
                                                  
 
                             
 
                              
          

                     
                                                  
 
                             
 
                              
          

                     
                                                  
 
                             
 
                                     
          
                                          


                             
                                       
          
                                          


                             

                                             
                                        
                                                        
                                       
                       
                                    
                                                                                                                                                   

          

                                                              
                                                                                                                                                           
                                       
     
   







                                                                                                                                                         




                                                
                                                             
                                                              


                     
                     
                                   


        
                           
          

                     
                                                 
 
                             
 
                             
          

                     
                                                 
 
                             
 
                             
          

                     
                                                 
 
                             

                                    
          
                                         


                             
                                      
          
                                         

                             
//: Comparison primitives

:(before "End Primitive Recipe Declarations")
EQUAL,
:(before "End Primitive Recipe Numbers")
put(Recipe_ordinal, "equal", EQUAL);
:(before "End Primitive Recipe Checks")
case EQUAL: {
  if (SIZE(inst.ingredients) <= 1) {
    raise << maybe(get(Recipe, r).name) << "'equal' needs at least two ingredients to compare in '" << to_string(inst) << "'\n" << end();
    break;
  }
  if (SIZE(inst.products) > 1) {
    raise << maybe(get(Recipe, r).name) << "'equal' yields exactly one product in '" << to_string(inst) << "'\n" << end();
    break;
  }
  if (!inst.products.empty() && !is_dummy(inst.products.at(0)) && !is_mu_boolean(inst.products.at(0))) {
    raise << maybe(get(Recipe, r).name) << "'equal' should yield a boolean, but got " << inst.products.at(0).original_string << '\n' << end();
    break;
  }
  break;
}
:(before "End Primitive Recipe Implementations")
case EQUAL: {
  vector<double>& exemplar = ingredients.at(0);
  bool result = true;
  for (long long int i = 1; i < SIZE(ingredients); ++i) {
    if (!equal(ingredients.at(i).begin(), ingredients.at(i).end(), exemplar.begin())) {
      result = false;
      break;
    }
  }
  products.resize(1);
  products.at(0).push_back(result);
  break;
}

:(scenario equal)
def main [
  1:number <- copy 34
  2:number <- copy 33
  3:boolean <- equal 1:number, 2:number
]
+mem: location 1 is 34
+mem: location 2 is 33
+mem: storing 0 in location 3

:(scenario equal_2)
def main [
  1:number <- copy 34
  2:number <- copy 34
  3:boolean <- equal 1:number, 2:number
]
+mem: location 1 is 34
+mem: location 2 is 34
+mem: storing 1 in location 3

:(scenario equal_multiple)
def main [
  1:boolean <- equal 34, 34, 34
]
+mem: storing 1 in location 1

:(scenario equal_multiple_2)
def main [
  1:boolean <- equal 34, 34, 35
]
+mem: storing 0 in location 1

:(before "End Primitive Recipe Declarations")
GREATER_THAN,
:(before "End Primitive Recipe Numbers")
put(Recipe_ordinal, "greater-than", GREATER_THAN);
:(before "End Primitive Recipe Checks")
case GREATER_THAN: {
  if (SIZE(inst.ingredients) <= 1) {
    raise << maybe(get(Recipe, r).name) << "'greater-than' needs at least two ingredients to compare in '" << to_string(inst) << "'\n" << end();
    break;
  }
  for (long long int i = 0; i < SIZE(inst.ingredients); ++i) {
    if (!is_mu_number(inst.ingredients.at(i))) {
      raise << maybe(get(Recipe, r).name) << "'greater-than' can only compare numbers; got " << inst.ingredients.at(i).original_string << '\n' << end();
      goto finish_checking_instruction;
    }
  }
  if (SIZE(inst.products) > 1) {
    raise << maybe(get(Recipe, r).name) << "'greater-than' yields exactly one product in '" << to_string(inst) << "'\n" << end();
    break;
  }
  if (!inst.products.empty() && !is_dummy(inst.products.at(0)) && !is_mu_boolean(inst.products.at(0))) {
    raise << maybe(get(Recipe, r).name) << "'greater-than' should yield a boolean, but got " << inst.products.at(0).original_string << '\n' << end();
    break;
  }
  break;
}
:(before "End Primitive Recipe Implementations")
case GREATER_THAN: {
  bool result = true;
  for (long long int i = /**/1; i < SIZE(ingredients); ++i) {
    if (ingredients.at(i-1).at(0) <= ingredients.at(i).at(0)) {
      result = false;
    }
  }
  products.resize(1);
  products.at(0).push_back(result);
  break;
}

:(scenario greater_than)
def main [
  1:number <- copy 34
  2:number <- copy 33
  3:boolean <- greater-than 1:number, 2:number
]
+mem: storing 1 in location 3

:(scenario greater_than_2)
def main [
  1:number <- copy 34
  2:number <- copy 34
  3:boolean <- greater-than 1:number, 2:number
]
+mem: storing 0 in location 3

:(scenario greater_than_multiple)
def main [
  1:boolean <- greater-than 36, 35, 34
]
+mem: storing 1 in location 1

:(scenario greater_than_multiple_2)
def main [
  1:boolean <- greater-than 36, 35, 35
]
+mem: storing 0 in location 1

:(before "End Primitive Recipe Declarations")
LESSER_THAN,
:(before "End Primitive Recipe Numbers")
put(Recipe_ordinal, "lesser-than", LESSER_THAN);
:(before "End Primitive Recipe Checks")
case LESSER_THAN: {
  if (SIZE(inst.ingredients) <= 1) {
    raise << maybe(get(Recipe, r).name) << "'lesser-than' needs at least two ingredients to compare in '" << to_string(inst) << "'\n" << end();
    break;
  }
  for (long long int i = 0; i < SIZE(inst.ingredients); ++i) {
    if (!is_mu_number(inst.ingredients.at(i))) {
      raise << maybe(get(Recipe, r).name) << "'lesser-than' can only compare numbers; got " << inst.ingredients.at(i).original_string << '\n' << end();
      goto finish_checking_instruction;
    }
  }
  if (SIZE(inst.products) > 1) {
    raise << maybe(get(Recipe, r).name) << "'lesser-than' yields exactly one product in '" << to_string(inst) << "'\n" << end();
    break;
  }
  if (!inst.products.empty() && !is_dummy(inst.products.at(0)) && !is_mu_boolean(inst.products.at(0))) {
    raise << maybe(get(Recipe, r).name) << "'lesser-than' should yield a boolean, but got " << inst.products.at(0).original_string << '\n' << end();
    break;
  }
  break;
}
:(before "End Primitive Recipe Implementations")
case LESSER_THAN: {
  bool result = true;
  for (long long int i = /**/1; i < SIZE(ingredients); ++i) {
    if (ingredients.at(i-1).at(0) >= ingredients.at(i).at(0)) {
      result = false;
    }
  }
  products.resize(1);
  products.at(0).push_back(result);
  break;
}

:(scenario lesser_than)
def main [
  1:number <- copy 32
  2:number <- copy 33
  3:boolean <- lesser-than 1:number, 2:number
]
+mem: storing 1 in location 3

:(scenario lesser_than_2)
def main [
  1:number <- copy 34
  2:number <- copy 33
  3:boolean <- lesser-than 1:number, 2:number
]
+mem: storing 0 in location 3

:(scenario lesser_than_multiple)
def main [
  1:boolean <- lesser-than 34, 35, 36
]
+mem: storing 1 in location 1

:(scenario lesser_than_multiple_2)
def main [
  1:boolean <- lesser-than 34, 35, 35
]
+mem: storing 0 in location 1

:(before "End Primitive Recipe Declarations")
GREATER_OR_EQUAL,
:(before "End Primitive Recipe Numbers")
put(Recipe_ordinal, "greater-or-equal", GREATER_OR_EQUAL);
:(before "End Primitive Recipe Checks")
case GREATER_OR_EQUAL: {
  if (SIZE(inst.ingredients) <= 1) {
    raise << maybe(get(Recipe, r).name) << "'greater-or-equal' needs at least two ingredients to compare in '" << to_string(inst) << "'\n" << end();
    break;
  }
  for (long long int i = 0; i < SIZE(inst.ingredients); ++i) {
    if (!is_mu_number(inst.ingredients.at(i))) {
      raise << maybe(get(Recipe, r).name) << "'greater-or-equal' can only compare numbers; got " << inst.ingredients.at(i).original_string << '\n' << end();
      goto finish_checking_instruction;
    }
  }
  if (SIZE(inst.products) > 1) {
    raise << maybe(get(Recipe, r).name) << "'greater-or-equal' yields exactly one product in '" << to_string(inst) << "'\n" << end();
    break;
  }
  if (!inst.products.empty() && !is_dummy(inst.products.at(0)) && !is_mu_boolean(inst.products.at(0))) {
    raise << maybe(get(Recipe, r).name) << "'greater-or-equal' should yield a boolean, but got " << inst.products.at(0).original_string << '\n' << end();
    break;
  }
  break;
}
:(before "End Primitive Recipe Implementations")
case GREATER_OR_EQUAL: {
  bool result = true;
  for (long long int i = /**/1; i < SIZE(ingredients); ++i) {
    if (ingredients.at(i-1).at(0) < ingredients.at(i).at(0)) {
      result = false;
    }
  }
  products.resize(1);
  products.at(0).push_back(result);
  break;
}

:(scenario greater_or_equal)
def main [
  1:number <- copy 34
  2:number <- copy 33
  3:boolean <- greater-or-equal 1:number, 2:number
]
+mem: storing 1 in location 3

:(scenario greater_or_equal_2)
def main [
  1:number <- copy 34
  2:number <- copy 34
  3:boolean <- greater-or-equal 1:number, 2:number
]
+mem: storing 1 in location 3

:(scenario greater_or_equal_3)
def main [
  1:number <- copy 34
  2:number <- copy 35
  3:boolean <- greater-or-equal 1:number, 2:number
]
+mem: storing 0 in location 3

:(scenario greater_or_equal_multiple)
def main [
  1:boolean <- greater-or-equal 36, 35, 35
]
+mem: storing 1 in location 1

:(scenario greater_or_equal_multiple_2)
def main [
  1:boolean <- greater-or-equal 36, 35, 36
]
+mem: storing 0 in location 1

:(before "End Primitive Recipe Declarations")
LESSER_OR_EQUAL,
:(before "End Primitive Recipe Numbers")
put(Recipe_ordinal, "lesser-or-equal", LESSER_OR_EQUAL);
:(before "End Primitive Recipe Checks")
case LESSER_OR_EQUAL: {
  if (SIZE(inst.ingredients) <= 1) {
    raise << maybe(get(Recipe, r).name) << "'lesser-or-equal' needs at least two ingredients to compare in '" << to_string(inst) << "'\n" << end();
    break;
  }
  for (long long int i = 0; i < SIZE(inst.ingredients); ++i) {
    if (!is_mu_number(inst.ingredients.at(i))) {
      raise << maybe(get(Recipe, r).name) << "'lesser-or-equal' can only compare numbers; got " << inst.ingredients.at(i).original_string << '\n' << end();
      goto finish_checking_instruction;
    }
  }
  if (SIZE(inst.products) > 1) {
    raise << maybe(get(Recipe, r).name) << "'greater-or-equal' yields exactly one product in '" << to_string(inst) << "'\n" << end();
    break;
  }
  if (!inst.products.empty() && !is_dummy(inst.products.at(0)) && !is_mu_boolean(inst.products.at(0))) {
    raise << maybe(get(Recipe, r).name) << "'greater-or-equal' should yield a boolean, but got " << inst.products.at(0).original_string << '\n' << end();
    break;
  }
  break;
}
:(before "End Primitive Recipe Implementations")
case LESSER_OR_EQUAL: {
  bool result = true;
  for (long long int i = /**/1; i < SIZE(ingredients); ++i) {
    if (ingredients.at(i-1).at(0) > ingredients.at(i).at(0)) {
      result = false;
    }
  }
  products.resize(1);
  products.at(0).push_back(result);
  break;
}

:(scenario lesser_or_equal)
def main [
  1:number <- copy 32
  2:number <- copy 33
  3:boolean <- lesser-or-equal 1:number, 2:number
]
+mem: storing 1 in location 3

:(scenario lesser_or_equal_2)
def main [
  1:number <- copy 33
  2:number <- copy 33
  3:boolean <- lesser-or-equal 1:number, 2:number
]
+mem: storing 1 in location 3

:(scenario lesser_or_equal_3)
def main [
  1:number <- copy 34
  2:number <- copy 33
  3:boolean <- lesser-or-equal 1:number, 2:number
]
+mem: storing 0 in location 3

:(scenario lesser_or_equal_multiple)
def main [
  1:boolean <- lesser-or-equal 34, 35, 35
]
+mem: storing 1 in location 1

:(scenario lesser_or_equal_multiple_2)
def main [
  1:boolean <- lesser-or-equal 34, 35, 34
]
+mem: storing 0 in location 1