kumi 0.0.24 → 0.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (234) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/README.md +70 -71
  4. data/data/functions/agg/boolean.yaml +6 -2
  5. data/data/functions/agg/numeric.yaml +32 -16
  6. data/data/functions/agg/string.yaml +4 -3
  7. data/data/functions/core/arithmetic.yaml +62 -14
  8. data/data/functions/core/boolean.yaml +12 -6
  9. data/data/functions/core/comparison.yaml +25 -13
  10. data/data/functions/core/constructor.yaml +16 -8
  11. data/data/functions/core/select.yaml +3 -1
  12. data/data/functions/core/stencil.yaml +14 -5
  13. data/data/functions/core/string.yaml +9 -4
  14. data/data/kernels/ruby/agg/numeric.yaml +1 -1
  15. data/docs/UNSAT_DETECTION.md +83 -0
  16. data/golden/array_element/expected/nast.txt +1 -1
  17. data/golden/array_element/expected/schema_ruby.rb +1 -1
  18. data/golden/array_index/expected/nast.txt +7 -7
  19. data/golden/array_index/expected/schema_ruby.rb +1 -1
  20. data/golden/array_operations/expected/nast.txt +2 -2
  21. data/golden/array_operations/expected/schema_ruby.rb +1 -1
  22. data/golden/array_operations/expected/snast.txt +3 -3
  23. data/golden/cascade_logic/expected/lir_02_inlined.txt +8 -8
  24. data/golden/cascade_logic/expected/schema_ruby.rb +1 -1
  25. data/golden/cascade_logic/expected/snast.txt +2 -2
  26. data/golden/chained_fusion/expected/lir_02_inlined.txt +36 -36
  27. data/golden/chained_fusion/expected/lir_03_cse.txt +23 -23
  28. data/golden/chained_fusion/expected/lir_04_1_loop_fusion.txt +25 -25
  29. data/golden/chained_fusion/expected/lir_04_loop_invcm.txt +23 -23
  30. data/golden/chained_fusion/expected/lir_06_const_prop.txt +23 -23
  31. data/golden/chained_fusion/expected/nast.txt +2 -2
  32. data/golden/chained_fusion/expected/schema_javascript.mjs +23 -23
  33. data/golden/chained_fusion/expected/schema_ruby.rb +28 -28
  34. data/golden/element_arrays/expected/nast.txt +2 -2
  35. data/golden/element_arrays/expected/schema_ruby.rb +1 -1
  36. data/golden/element_arrays/expected/snast.txt +1 -1
  37. data/golden/empty_and_null_inputs/expected/lir_02_inlined.txt +18 -18
  38. data/golden/empty_and_null_inputs/expected/lir_03_cse.txt +17 -17
  39. data/golden/empty_and_null_inputs/expected/lir_04_1_loop_fusion.txt +17 -17
  40. data/golden/empty_and_null_inputs/expected/lir_04_loop_invcm.txt +17 -17
  41. data/golden/empty_and_null_inputs/expected/lir_06_const_prop.txt +17 -17
  42. data/golden/empty_and_null_inputs/expected/nast.txt +3 -3
  43. data/golden/empty_and_null_inputs/expected/schema_javascript.mjs +13 -13
  44. data/golden/empty_and_null_inputs/expected/schema_ruby.rb +18 -18
  45. data/golden/function_overload/expected/ast.txt +29 -0
  46. data/golden/function_overload/expected/input_plan.txt +4 -0
  47. data/golden/function_overload/expected/lir_00_unoptimized.txt +18 -0
  48. data/golden/function_overload/expected/lir_01_hoist_scalar_references.txt +18 -0
  49. data/golden/function_overload/expected/lir_02_inlined.txt +20 -0
  50. data/golden/function_overload/expected/lir_03_cse.txt +20 -0
  51. data/golden/function_overload/expected/lir_04_1_loop_fusion.txt +20 -0
  52. data/golden/function_overload/expected/lir_04_loop_invcm.txt +20 -0
  53. data/golden/function_overload/expected/lir_06_const_prop.txt +20 -0
  54. data/golden/function_overload/expected/nast.txt +22 -0
  55. data/golden/function_overload/expected/schema_javascript.mjs +12 -0
  56. data/golden/function_overload/expected/schema_ruby.rb +39 -0
  57. data/golden/function_overload/expected/snast.txt +22 -0
  58. data/golden/function_overload/input.json +8 -0
  59. data/golden/function_overload/schema.kumi +19 -0
  60. data/golden/game_of_life/expected/lir_00_unoptimized.txt +4 -4
  61. data/golden/game_of_life/expected/lir_01_hoist_scalar_references.txt +4 -4
  62. data/golden/game_of_life/expected/lir_02_inlined.txt +1294 -1294
  63. data/golden/game_of_life/expected/lir_03_cse.txt +403 -399
  64. data/golden/game_of_life/expected/lir_04_1_loop_fusion.txt +403 -399
  65. data/golden/game_of_life/expected/lir_04_loop_invcm.txt +403 -399
  66. data/golden/game_of_life/expected/lir_06_const_prop.txt +403 -399
  67. data/golden/game_of_life/expected/nast.txt +4 -4
  68. data/golden/game_of_life/expected/schema_javascript.mjs +87 -85
  69. data/golden/game_of_life/expected/schema_ruby.rb +88 -86
  70. data/golden/game_of_life/expected/snast.txt +10 -10
  71. data/golden/hash_keys/expected/schema_ruby.rb +1 -1
  72. data/golden/hash_value/expected/nast.txt +1 -1
  73. data/golden/hash_value/expected/schema_ruby.rb +1 -1
  74. data/golden/hash_value/expected/snast.txt +1 -1
  75. data/golden/hierarchical_complex/expected/lir_02_inlined.txt +15 -15
  76. data/golden/hierarchical_complex/expected/lir_03_cse.txt +1 -1
  77. data/golden/hierarchical_complex/expected/lir_04_1_loop_fusion.txt +1 -1
  78. data/golden/hierarchical_complex/expected/lir_04_loop_invcm.txt +1 -1
  79. data/golden/hierarchical_complex/expected/lir_06_const_prop.txt +1 -1
  80. data/golden/hierarchical_complex/expected/nast.txt +3 -3
  81. data/golden/hierarchical_complex/expected/schema_javascript.mjs +1 -1
  82. data/golden/hierarchical_complex/expected/schema_ruby.rb +2 -2
  83. data/golden/hierarchical_complex/expected/snast.txt +3 -3
  84. data/golden/inline_rename_scope_leak/expected/nast.txt +3 -3
  85. data/golden/inline_rename_scope_leak/expected/schema_ruby.rb +1 -1
  86. data/golden/input_reference/expected/nast.txt +2 -2
  87. data/golden/input_reference/expected/schema_ruby.rb +1 -1
  88. data/golden/interleaved_fusion/expected/lir_02_inlined.txt +35 -35
  89. data/golden/interleaved_fusion/expected/lir_03_cse.txt +26 -26
  90. data/golden/interleaved_fusion/expected/lir_04_1_loop_fusion.txt +27 -26
  91. data/golden/interleaved_fusion/expected/lir_04_loop_invcm.txt +26 -26
  92. data/golden/interleaved_fusion/expected/lir_06_const_prop.txt +26 -26
  93. data/golden/interleaved_fusion/expected/nast.txt +2 -2
  94. data/golden/interleaved_fusion/expected/schema_javascript.mjs +23 -23
  95. data/golden/interleaved_fusion/expected/schema_ruby.rb +29 -29
  96. data/golden/let_inline/expected/nast.txt +4 -4
  97. data/golden/let_inline/expected/schema_ruby.rb +1 -1
  98. data/golden/loop_fusion/expected/lir_02_inlined.txt +17 -17
  99. data/golden/loop_fusion/expected/lir_03_cse.txt +14 -14
  100. data/golden/loop_fusion/expected/lir_04_1_loop_fusion.txt +14 -14
  101. data/golden/loop_fusion/expected/lir_04_loop_invcm.txt +14 -14
  102. data/golden/loop_fusion/expected/lir_06_const_prop.txt +14 -14
  103. data/golden/loop_fusion/expected/nast.txt +1 -1
  104. data/golden/loop_fusion/expected/schema_javascript.mjs +12 -12
  105. data/golden/loop_fusion/expected/schema_ruby.rb +16 -16
  106. data/golden/min_reduce_scope/expected/nast.txt +3 -3
  107. data/golden/min_reduce_scope/expected/schema_ruby.rb +1 -1
  108. data/golden/min_reduce_scope/expected/snast.txt +1 -1
  109. data/golden/mixed_dimensions/expected/lir_02_inlined.txt +5 -5
  110. data/golden/mixed_dimensions/expected/lir_03_cse.txt +5 -5
  111. data/golden/mixed_dimensions/expected/lir_04_1_loop_fusion.txt +5 -5
  112. data/golden/mixed_dimensions/expected/lir_04_loop_invcm.txt +5 -5
  113. data/golden/mixed_dimensions/expected/lir_06_const_prop.txt +5 -5
  114. data/golden/mixed_dimensions/expected/nast.txt +2 -2
  115. data/golden/mixed_dimensions/expected/schema_javascript.mjs +3 -3
  116. data/golden/mixed_dimensions/expected/schema_ruby.rb +6 -6
  117. data/golden/multirank_hoisting/expected/lir_02_inlined.txt +48 -48
  118. data/golden/multirank_hoisting/expected/lir_03_cse.txt +35 -35
  119. data/golden/multirank_hoisting/expected/lir_04_1_loop_fusion.txt +35 -35
  120. data/golden/multirank_hoisting/expected/lir_04_loop_invcm.txt +35 -35
  121. data/golden/multirank_hoisting/expected/lir_06_const_prop.txt +35 -35
  122. data/golden/multirank_hoisting/expected/nast.txt +7 -7
  123. data/golden/multirank_hoisting/expected/schema_javascript.mjs +34 -34
  124. data/golden/multirank_hoisting/expected/schema_ruby.rb +36 -36
  125. data/golden/nested_hash/expected/nast.txt +1 -1
  126. data/golden/nested_hash/expected/schema_ruby.rb +1 -1
  127. data/golden/reduction_broadcast/expected/lir_02_inlined.txt +30 -30
  128. data/golden/reduction_broadcast/expected/lir_03_cse.txt +22 -22
  129. data/golden/reduction_broadcast/expected/lir_04_1_loop_fusion.txt +22 -22
  130. data/golden/reduction_broadcast/expected/lir_04_loop_invcm.txt +22 -22
  131. data/golden/reduction_broadcast/expected/lir_06_const_prop.txt +22 -22
  132. data/golden/reduction_broadcast/expected/nast.txt +3 -3
  133. data/golden/reduction_broadcast/expected/schema_javascript.mjs +18 -18
  134. data/golden/reduction_broadcast/expected/schema_ruby.rb +23 -23
  135. data/golden/reduction_broadcast/expected/snast.txt +1 -1
  136. data/golden/roll/expected/schema_ruby.rb +1 -1
  137. data/golden/shift/expected/schema_ruby.rb +1 -1
  138. data/golden/shift_2d/expected/schema_ruby.rb +1 -1
  139. data/golden/simple_math/expected/lir_00_unoptimized.txt +1 -1
  140. data/golden/simple_math/expected/lir_01_hoist_scalar_references.txt +1 -1
  141. data/golden/simple_math/expected/lir_02_inlined.txt +1 -1
  142. data/golden/simple_math/expected/lir_03_cse.txt +1 -1
  143. data/golden/simple_math/expected/lir_04_1_loop_fusion.txt +1 -1
  144. data/golden/simple_math/expected/lir_04_loop_invcm.txt +1 -1
  145. data/golden/simple_math/expected/lir_06_const_prop.txt +1 -1
  146. data/golden/simple_math/expected/nast.txt +5 -5
  147. data/golden/simple_math/expected/schema_ruby.rb +1 -1
  148. data/golden/simple_math/expected/snast.txt +2 -2
  149. data/golden/streaming_basics/expected/lir_02_inlined.txt +25 -25
  150. data/golden/streaming_basics/expected/lir_03_cse.txt +13 -13
  151. data/golden/streaming_basics/expected/lir_04_1_loop_fusion.txt +13 -13
  152. data/golden/streaming_basics/expected/lir_04_loop_invcm.txt +13 -13
  153. data/golden/streaming_basics/expected/lir_06_const_prop.txt +13 -13
  154. data/golden/streaming_basics/expected/nast.txt +8 -8
  155. data/golden/streaming_basics/expected/schema_javascript.mjs +13 -13
  156. data/golden/streaming_basics/expected/schema_ruby.rb +14 -14
  157. data/golden/streaming_basics/expected/snast.txt +1 -1
  158. data/golden/tuples/expected/lir_00_unoptimized.txt +5 -5
  159. data/golden/tuples/expected/lir_01_hoist_scalar_references.txt +5 -5
  160. data/golden/tuples/expected/lir_02_inlined.txt +5 -5
  161. data/golden/tuples/expected/lir_03_cse.txt +5 -5
  162. data/golden/tuples/expected/lir_04_1_loop_fusion.txt +5 -5
  163. data/golden/tuples/expected/lir_04_loop_invcm.txt +5 -5
  164. data/golden/tuples/expected/lir_06_const_prop.txt +5 -5
  165. data/golden/tuples/expected/nast.txt +4 -4
  166. data/golden/tuples/expected/schema_ruby.rb +1 -1
  167. data/golden/tuples/expected/snast.txt +6 -6
  168. data/golden/tuples_and_arrays/expected/lir_00_unoptimized.txt +1 -1
  169. data/golden/tuples_and_arrays/expected/lir_01_hoist_scalar_references.txt +1 -1
  170. data/golden/tuples_and_arrays/expected/lir_02_inlined.txt +17 -17
  171. data/golden/tuples_and_arrays/expected/lir_03_cse.txt +13 -13
  172. data/golden/tuples_and_arrays/expected/lir_04_1_loop_fusion.txt +13 -13
  173. data/golden/tuples_and_arrays/expected/lir_04_loop_invcm.txt +13 -13
  174. data/golden/tuples_and_arrays/expected/lir_06_const_prop.txt +13 -13
  175. data/golden/tuples_and_arrays/expected/nast.txt +3 -3
  176. data/golden/tuples_and_arrays/expected/schema_javascript.mjs +13 -13
  177. data/golden/tuples_and_arrays/expected/schema_ruby.rb +14 -14
  178. data/golden/tuples_and_arrays/expected/snast.txt +2 -2
  179. data/golden/us_tax_2024/expected/ast.txt +63 -670
  180. data/golden/us_tax_2024/expected/input_plan.txt +8 -45
  181. data/golden/us_tax_2024/expected/lir_00_unoptimized.txt +253 -863
  182. data/golden/us_tax_2024/expected/lir_01_hoist_scalar_references.txt +253 -863
  183. data/golden/us_tax_2024/expected/lir_02_inlined.txt +1215 -5139
  184. data/golden/us_tax_2024/expected/lir_03_cse.txt +587 -2460
  185. data/golden/us_tax_2024/expected/lir_04_1_loop_fusion.txt +632 -2480
  186. data/golden/us_tax_2024/expected/lir_04_loop_invcm.txt +587 -2400
  187. data/golden/us_tax_2024/expected/lir_06_const_prop.txt +587 -2400
  188. data/golden/us_tax_2024/expected/nast.txt +123 -826
  189. data/golden/us_tax_2024/expected/schema_javascript.mjs +127 -581
  190. data/golden/us_tax_2024/expected/schema_ruby.rb +135 -610
  191. data/golden/us_tax_2024/expected/snast.txt +155 -858
  192. data/golden/us_tax_2024/expected.json +120 -1
  193. data/golden/us_tax_2024/input.json +18 -9
  194. data/golden/us_tax_2024/schema.kumi +48 -178
  195. data/golden/with_constants/expected/lir_00_unoptimized.txt +1 -1
  196. data/golden/with_constants/expected/lir_01_hoist_scalar_references.txt +1 -1
  197. data/golden/with_constants/expected/lir_02_inlined.txt +1 -1
  198. data/golden/with_constants/expected/lir_03_cse.txt +1 -1
  199. data/golden/with_constants/expected/lir_04_1_loop_fusion.txt +1 -1
  200. data/golden/with_constants/expected/lir_04_loop_invcm.txt +1 -1
  201. data/golden/with_constants/expected/lir_06_const_prop.txt +1 -1
  202. data/golden/with_constants/expected/nast.txt +2 -2
  203. data/golden/with_constants/expected/schema_ruby.rb +1 -1
  204. data/golden/with_constants/expected/snast.txt +2 -2
  205. data/lib/kumi/analyzer.rb +12 -12
  206. data/lib/kumi/core/analyzer/passes/formal_constraint_propagator.rb +236 -0
  207. data/lib/kumi/core/analyzer/passes/input_collector.rb +22 -4
  208. data/lib/kumi/core/analyzer/passes/lir/inline_declarations_pass.rb +118 -74
  209. data/lib/kumi/core/analyzer/passes/nast_dimensional_analyzer_pass.rb +64 -18
  210. data/lib/kumi/core/analyzer/passes/normalize_to_nast_pass.rb +9 -4
  211. data/lib/kumi/core/analyzer/passes/snast_pass.rb +3 -1
  212. data/lib/kumi/core/analyzer/passes/unsat_detector.rb +172 -198
  213. data/lib/kumi/core/error_reporter.rb +36 -1
  214. data/lib/kumi/core/errors.rb +33 -1
  215. data/lib/kumi/core/functions/function_spec.rb +5 -4
  216. data/lib/kumi/core/functions/loader.rb +17 -1
  217. data/lib/kumi/core/functions/overload_resolver.rb +164 -0
  218. data/lib/kumi/core/functions/type_error_reporter.rb +118 -0
  219. data/lib/kumi/core/functions/type_rules.rb +155 -35
  220. data/lib/kumi/core/types/inference.rb +29 -22
  221. data/lib/kumi/core/types/normalizer.rb +29 -45
  222. data/lib/kumi/core/types/validator.rb +16 -27
  223. data/lib/kumi/core/types/value_objects.rb +116 -0
  224. data/lib/kumi/core/types.rb +45 -37
  225. data/lib/kumi/registry_v2/loader.rb +90 -0
  226. data/lib/kumi/registry_v2.rb +18 -1
  227. data/lib/kumi/version.rb +1 -1
  228. metadata +21 -7
  229. data/lib/kumi/core/analyzer/unsat_constant_evaluator.rb +0 -59
  230. data/lib/kumi/core/atom_unsat_solver.rb +0 -396
  231. data/lib/kumi/core/constraint_relationship_solver.rb +0 -641
  232. data/lib/kumi/core/types/builder.rb +0 -23
  233. data/lib/kumi/core/types/compatibility.rb +0 -96
  234. data/lib/kumi/core/types/formatter.rb +0 -26
@@ -38,21 +38,21 @@ export function _row_scale2(input) {
38
38
 
39
39
  export function _elem_affine(input) {
40
40
  let out = [];
41
+ let t66 = input["global_offset"];
42
+ const t67 = 1.0;
43
+ let t68 = t66 + t67;
41
44
  let t19 = input["batch"];
42
- let t81 = input["global_offset"];
43
- const t82 = 1.0;
44
45
  const t60 = 2.0;
45
- let t83 = t81 + t82;
46
46
  t19.forEach((batch_el_20, batch_i_21) => {
47
47
  let out_1 = [];
48
- let t22 = batch_el_20["row"];
49
48
  let t64 = batch_el_20["mean"];
50
- let t65 = t64 + t83;
49
+ let t22 = batch_el_20["row"];
50
+ let t65 = t64 + t68;
51
51
  t22.forEach((row_el_23, row_i_24) => {
52
52
  let out_2 = [];
53
- let t25 = row_el_23["col"];
54
53
  let t59 = row_el_23["scale"];
55
54
  let t61 = t59 * t60;
55
+ let t25 = row_el_23["col"];
56
56
  t25.forEach((col_el_26, col_i_27) => {
57
57
  let t28 = col_el_26["val"];
58
58
  let t30 = t28 * t61;
@@ -68,26 +68,26 @@ export function _elem_affine(input) {
68
68
 
69
69
  export function _row_sum_affine(input) {
70
70
  let out = [];
71
+ let t86 = input["global_offset"];
72
+ const t87 = 1.0;
73
+ let t88 = t86 + t87;
71
74
  let t33 = input["batch"];
72
- const t87 = 2.0;
73
- let t90 = input["global_offset"];
74
- const t91 = 1.0;
75
- let t92 = t90 + t91;
75
+ const t80 = 2.0;
76
76
  t33.forEach((batch_el_34, batch_i_35) => {
77
77
  let out_1 = [];
78
+ let t84 = batch_el_34["mean"];
78
79
  let t36 = batch_el_34["row"];
79
- let t93 = batch_el_34["mean"];
80
- let t94 = t93 + t92;
80
+ let t85 = t84 + t88;
81
81
  t36.forEach((row_el_37, row_i_38) => {
82
+ let t79 = row_el_37["scale"];
83
+ let t81 = t79 * t80;
82
84
  let acc_39 = 0.0;
83
85
  let t40 = row_el_37["col"];
84
- let t86 = row_el_37["scale"];
85
- let t88 = t86 * t87;
86
86
  t40.forEach((col_el_41, col_i_42) => {
87
- let t69 = col_el_41["val"];
88
- let t71 = t69 * t88;
89
- let t73 = t71 + t94;
90
- acc_39 += t73;
87
+ let t72 = col_el_41["val"];
88
+ let t74 = t72 * t81;
89
+ let t76 = t74 + t85;
90
+ acc_39 += t76;
91
91
  });
92
92
  out_1.push(acc_39);
93
93
  });
@@ -98,28 +98,28 @@ export function _row_sum_affine(input) {
98
98
 
99
99
  export function _batch_total_affine(input) {
100
100
  let out = [];
101
+ let t115 = input["global_offset"];
102
+ const t116 = 1.0;
103
+ let t117 = t115 + t116;
101
104
  let t45 = input["batch"];
102
- let t110 = input["global_offset"];
103
- const t111 = 1.0;
104
- const t101 = 2.0;
105
- let t112 = t110 + t111;
105
+ const t109 = 2.0;
106
106
  t45.forEach((batch_el_46, batch_i_47) => {
107
+ let t113 = batch_el_46["mean"];
107
108
  let acc_48 = 0.0;
108
109
  let t49 = batch_el_46["row"];
109
- let t105 = batch_el_46["mean"];
110
- let t106 = t105 + t112;
110
+ let t114 = t113 + t117;
111
111
  t49.forEach((row_el_50, row_i_51) => {
112
- let acc77 = 0.0;
113
- let t78 = row_el_50["col"];
114
- let t100 = row_el_50["scale"];
115
- let t102 = t100 * t101;
116
- t78.forEach((col_el_41, col_i_42) => {
117
- let t107 = col_el_41["val"];
118
- let t108 = t107 * t102;
119
- let t109 = t108 + t106;
120
- acc77 += t109;
112
+ let t108 = row_el_50["scale"];
113
+ let t110 = t108 * t109;
114
+ let acc92 = 0.0;
115
+ let t93 = row_el_50["col"];
116
+ t93.forEach((t94, t95) => {
117
+ let t101 = t94["val"];
118
+ let t103 = t101 * t110;
119
+ let t105 = t103 + t114;
120
+ acc92 += t105;
121
121
  });
122
- acc_48 += acc77;
122
+ acc_48 += acc92;
123
123
  });
124
124
  out.push(acc_48);
125
125
  });
@@ -1,5 +1,5 @@
1
1
  # Autogenerated by Kumi Codegen
2
- module Kumi::Compiled::KUMI_e0419fbf641de528f8d1c03f124e177804f1a04ed69561ff0fe20f04192a818b
2
+ module Kumi::Compiled::KUMI_c68c448fb7a73dbfec6780905fc3ddcdea1f22e8eacda707f2f8432d4ad79ae0
3
3
  def self.from(input_data = nil)
4
4
  instance = Object.new
5
5
  instance.extend(self)
@@ -69,21 +69,21 @@ module Kumi::Compiled::KUMI_e0419fbf641de528f8d1c03f124e177804f1a04ed69561ff0fe2
69
69
 
70
70
  def _elem_affine(input = @input)
71
71
  out = []
72
+ t66 = input["global_offset"] || input[:global_offset]
73
+ t67 = 1.0
74
+ t68 = t66 + t67
72
75
  t19 = input["batch"] || input[:batch]
73
- t81 = input["global_offset"] || input[:global_offset]
74
- t82 = 1.0
75
76
  t60 = 2.0
76
- t83 = t81 + t82
77
77
  t19.each_with_index do |batch_el_20, batch_i_21|
78
78
  out_1 = []
79
- t22 = batch_el_20["row"] || batch_el_20[:row]
80
79
  t64 = batch_el_20["mean"] || batch_el_20[:mean]
81
- t65 = t64 + t83
80
+ t22 = batch_el_20["row"] || batch_el_20[:row]
81
+ t65 = t64 + t68
82
82
  t22.each_with_index do |row_el_23, row_i_24|
83
83
  out_2 = []
84
- t25 = row_el_23["col"] || row_el_23[:col]
85
84
  t59 = row_el_23["scale"] || row_el_23[:scale]
86
85
  t61 = t59 * t60
86
+ t25 = row_el_23["col"] || row_el_23[:col]
87
87
  t25.each_with_index do |col_el_26, col_i_27|
88
88
  t28 = col_el_26["val"] || col_el_26[:val]
89
89
  t30 = t28 * t61
@@ -99,26 +99,26 @@ module Kumi::Compiled::KUMI_e0419fbf641de528f8d1c03f124e177804f1a04ed69561ff0fe2
99
99
 
100
100
  def _row_sum_affine(input = @input)
101
101
  out = []
102
+ t86 = input["global_offset"] || input[:global_offset]
103
+ t87 = 1.0
104
+ t88 = t86 + t87
102
105
  t33 = input["batch"] || input[:batch]
103
- t87 = 2.0
104
- t90 = input["global_offset"] || input[:global_offset]
105
- t91 = 1.0
106
- t92 = t90 + t91
106
+ t80 = 2.0
107
107
  t33.each_with_index do |batch_el_34, batch_i_35|
108
108
  out_1 = []
109
+ t84 = batch_el_34["mean"] || batch_el_34[:mean]
109
110
  t36 = batch_el_34["row"] || batch_el_34[:row]
110
- t93 = batch_el_34["mean"] || batch_el_34[:mean]
111
- t94 = t93 + t92
111
+ t85 = t84 + t88
112
112
  t36.each_with_index do |row_el_37, row_i_38|
113
+ t79 = row_el_37["scale"] || row_el_37[:scale]
114
+ t81 = t79 * t80
113
115
  acc_39 = 0.0
114
116
  t40 = row_el_37["col"] || row_el_37[:col]
115
- t86 = row_el_37["scale"] || row_el_37[:scale]
116
- t88 = t86 * t87
117
117
  t40.each_with_index do |col_el_41, col_i_42|
118
- t69 = col_el_41["val"] || col_el_41[:val]
119
- t71 = t69 * t88
120
- t73 = t71 + t94
121
- acc_39 += t73
118
+ t72 = col_el_41["val"] || col_el_41[:val]
119
+ t74 = t72 * t81
120
+ t76 = t74 + t85
121
+ acc_39 += t76
122
122
  end
123
123
  t44 = acc_39
124
124
  out_1 << t44
@@ -130,29 +130,29 @@ module Kumi::Compiled::KUMI_e0419fbf641de528f8d1c03f124e177804f1a04ed69561ff0fe2
130
130
 
131
131
  def _batch_total_affine(input = @input)
132
132
  out = []
133
+ t115 = input["global_offset"] || input[:global_offset]
134
+ t116 = 1.0
135
+ t117 = t115 + t116
133
136
  t45 = input["batch"] || input[:batch]
134
- t110 = input["global_offset"] || input[:global_offset]
135
- t111 = 1.0
136
- t101 = 2.0
137
- t112 = t110 + t111
137
+ t109 = 2.0
138
138
  t45.each_with_index do |batch_el_46, batch_i_47|
139
+ t113 = batch_el_46["mean"] || batch_el_46[:mean]
139
140
  acc_48 = 0.0
140
141
  t49 = batch_el_46["row"] || batch_el_46[:row]
141
- t105 = batch_el_46["mean"] || batch_el_46[:mean]
142
- t106 = t105 + t112
142
+ t114 = t113 + t117
143
143
  t49.each_with_index do |row_el_50, row_i_51|
144
- acc77 = 0.0
145
- t78 = row_el_50["col"] || row_el_50[:col]
146
- t100 = row_el_50["scale"] || row_el_50[:scale]
147
- t102 = t100 * t101
148
- t78.each_with_index do |col_el_41, col_i_42|
149
- t107 = col_el_41["val"] || col_el_41[:val]
150
- t108 = t107 * t102
151
- t109 = t108 + t106
152
- acc77 += t109
144
+ t108 = row_el_50["scale"] || row_el_50[:scale]
145
+ t110 = t108 * t109
146
+ acc92 = 0.0
147
+ t93 = row_el_50["col"] || row_el_50[:col]
148
+ t93.each_with_index do |t94, t95|
149
+ t101 = t94["val"] || t94[:val]
150
+ t103 = t101 * t110
151
+ t105 = t103 + t114
152
+ acc92 += t105
153
153
  end
154
- t80 = acc77
155
- acc_48 += t80
154
+ t97 = acc92
155
+ acc_48 += t97
156
156
  end
157
157
  t53 = acc_48
158
158
  out << t53
@@ -1,6 +1,6 @@
1
1
  (NAST
2
2
  (VALUE double
3
- (Call :"core.mul"
3
+ (Call :multiply
4
4
  (InputRef [:x, :y, :z])
5
5
  (Const 2)
6
6
  )
@@ -1,5 +1,5 @@
1
1
  # Autogenerated by Kumi Codegen
2
- module Kumi::Compiled::KUMI_3b954603dedc568d2f576b3345109d43555583c88706a3dbe86f8e07cbcfdeb4
2
+ module Kumi::Compiled::KUMI_95f5c5f162bc538a1971324256c0923c4c25ac329f47b44140ea989ce767e3f2
3
3
  def self.from(input_data = nil)
4
4
  instance = Object.new
5
5
  instance.extend(self)
@@ -31,48 +31,48 @@
31
31
  %t34 = load_input "departments" :: array
32
32
  %acc36 = decl_acc :: integer
33
33
  %t37 = load_field departments_el_20["teams"] :: any
34
- loop teams id=L8 in %t37 as el=%teams_el_6, idx=%teams_i_7
35
- %t38 = load_field teams_el_6["headcount"] :: integer
36
- %acc36 = acc_add agg.sum(%acc36, %t38) :: integer
34
+ loop teams id=L8 in %t37 as el=%t38, idx=%t39
35
+ %t40 = load_field t38["headcount"] :: integer
36
+ %acc36 = acc_add agg.sum(%acc36, %t40) :: integer
37
37
  end_loop
38
- %t39 = acc_load %acc36 :: integer
39
- %t40 = load_input "departments" :: array
40
- %acc42 = decl_acc :: integer
41
- %t43 = load_field departments_el_20["teams"] :: any
42
- loop teams id=L9 in %t43 as el=%teams_el_15, idx=%teams_i_16
43
- %t44 = load_field teams_el_15["team_name"] :: string
44
- %acc42 = acc_add agg.count(%acc42, %t44) :: integer
38
+ %t41 = acc_load %acc36 :: integer
39
+ %t42 = load_input "departments" :: array
40
+ %acc44 = decl_acc :: integer
41
+ %t45 = load_field departments_el_20["teams"] :: any
42
+ loop teams id=L9 in %t45 as el=%t46, idx=%t47
43
+ %t48 = load_field t46["team_name"] :: string
44
+ %acc44 = acc_add agg.count(%acc44, %t48) :: integer
45
45
  end_loop
46
- %t45 = acc_load %acc42 :: integer
47
- %t24 = call core.div(%t39, %t45) :: float
46
+ %t49 = acc_load %acc44 :: integer
47
+ %t24 = call core.div(%t41, %t49) :: float
48
48
  yield %t24
49
49
  end_loop
50
50
  )
51
51
  (Declaration is_above_average_team
52
52
  %t25 = load_input "departments" :: array
53
53
  loop departments id=L6 in %t25 as el=%departments_el_26, idx=%departments_i_27
54
- %t28 = load_field departments_el_26["teams"] :: any
55
- %t46 = load_input "departments" :: array
56
- %t50 = load_input "departments" :: array
57
- %acc52 = decl_acc :: integer
58
- %t53 = load_field departments_el_26["teams"] :: any
59
- loop teams id=L10 in %t53 as el=%teams_el_6, idx=%teams_i_7
60
- %t54 = load_field teams_el_6["headcount"] :: integer
61
- %acc52 = acc_add agg.sum(%acc52, %t54) :: integer
54
+ %t54 = load_input "departments" :: array
55
+ %acc56 = decl_acc :: integer
56
+ %t57 = load_field departments_el_26["teams"] :: any
57
+ loop teams id=L10 in %t57 as el=%t58, idx=%t59
58
+ %t60 = load_field t58["headcount"] :: integer
59
+ %acc56 = acc_add agg.sum(%acc56, %t60) :: integer
62
60
  end_loop
63
- %t55 = acc_load %acc52 :: integer
64
- %t56 = load_input "departments" :: array
65
- %acc58 = decl_acc :: integer
66
- %t59 = load_field departments_el_26["teams"] :: any
67
- loop teams id=L11 in %t59 as el=%teams_el_15, idx=%teams_i_16
68
- %t60 = load_field teams_el_15["team_name"] :: string
69
- %acc58 = acc_add agg.count(%acc58, %t60) :: integer
61
+ %t61 = acc_load %acc56 :: integer
62
+ %t62 = load_input "departments" :: array
63
+ %acc64 = decl_acc :: integer
64
+ %t65 = load_field departments_el_26["teams"] :: any
65
+ loop teams id=L11 in %t65 as el=%t66, idx=%t67
66
+ %t68 = load_field t66["team_name"] :: string
67
+ %acc64 = acc_add agg.count(%acc64, %t68) :: integer
70
68
  end_loop
71
- %t61 = acc_load %acc58 :: integer
72
- %t49 = call core.div(%t55, %t61) :: float
69
+ %t69 = acc_load %acc64 :: integer
70
+ %t50 = load_input "departments" :: array
71
+ %t53 = call core.div(%t61, %t69) :: float
72
+ %t28 = load_field departments_el_26["teams"] :: any
73
73
  loop teams id=L7 in %t28 as el=%teams_el_29, idx=%teams_i_30
74
74
  %t31 = load_field teams_el_29["headcount"] :: integer
75
- %t33 = call core.gt(%t31, %t49) :: boolean
75
+ %t33 = call core.gt(%t31, %t53) :: boolean
76
76
  yield %t33
77
77
  end_loop
78
78
  end_loop
@@ -30,37 +30,37 @@
30
30
  loop departments id=L5 in %t19 as el=%departments_el_20, idx=%departments_i_21
31
31
  %acc36 = decl_acc :: integer
32
32
  %t37 = load_field departments_el_20["teams"] :: any
33
- %acc42 = decl_acc :: integer
34
- loop teams id=L8 in %t37 as el=%teams_el_6, idx=%teams_i_7
35
- %t38 = load_field teams_el_6["headcount"] :: integer
36
- %acc36 = acc_add agg.sum(%acc36, %t38) :: integer
37
- %t44 = load_field teams_el_6["team_name"] :: string
38
- %acc42 = acc_add agg.count(%acc42, %t44) :: integer
33
+ %acc44 = decl_acc :: integer
34
+ loop teams id=L8 in %t37 as el=%t38, idx=%t39
35
+ %t40 = load_field t38["headcount"] :: integer
36
+ %acc36 = acc_add agg.sum(%acc36, %t40) :: integer
37
+ %t48 = load_field t38["team_name"] :: string
38
+ %acc44 = acc_add agg.count(%acc44, %t48) :: integer
39
39
  end_loop
40
- %t39 = acc_load %acc36 :: integer
41
- %t45 = acc_load %acc42 :: integer
42
- %t24 = call core.div(%t39, %t45) :: float
40
+ %t41 = acc_load %acc36 :: integer
41
+ %t49 = acc_load %acc44 :: integer
42
+ %t24 = call core.div(%t41, %t49) :: float
43
43
  yield %t24
44
44
  end_loop
45
45
  )
46
46
  (Declaration is_above_average_team
47
47
  %t25 = load_input "departments" :: array
48
48
  loop departments id=L6 in %t25 as el=%departments_el_26, idx=%departments_i_27
49
- %t28 = load_field departments_el_26["teams"] :: any
50
- %acc52 = decl_acc :: integer
51
- %acc58 = decl_acc :: integer
52
- loop teams id=L10 in %t28 as el=%teams_el_6, idx=%teams_i_7
53
- %t54 = load_field teams_el_6["headcount"] :: integer
54
- %acc52 = acc_add agg.sum(%acc52, %t54) :: integer
55
- %t60 = load_field teams_el_6["team_name"] :: string
56
- %acc58 = acc_add agg.count(%acc58, %t60) :: integer
49
+ %acc56 = decl_acc :: integer
50
+ %t57 = load_field departments_el_26["teams"] :: any
51
+ %acc64 = decl_acc :: integer
52
+ loop teams id=L10 in %t57 as el=%t58, idx=%t59
53
+ %t60 = load_field t58["headcount"] :: integer
54
+ %acc56 = acc_add agg.sum(%acc56, %t60) :: integer
55
+ %t68 = load_field t58["team_name"] :: string
56
+ %acc64 = acc_add agg.count(%acc64, %t68) :: integer
57
57
  end_loop
58
- %t55 = acc_load %acc52 :: integer
59
- %t61 = acc_load %acc58 :: integer
60
- %t49 = call core.div(%t55, %t61) :: float
61
- loop teams id=L7 in %t28 as el=%teams_el_29, idx=%teams_i_30
58
+ %t61 = acc_load %acc56 :: integer
59
+ %t69 = acc_load %acc64 :: integer
60
+ %t53 = call core.div(%t61, %t69) :: float
61
+ loop teams id=L7 in %t57 as el=%teams_el_29, idx=%teams_i_30
62
62
  %t31 = load_field teams_el_29["headcount"] :: integer
63
- %t33 = call core.gt(%t31, %t49) :: boolean
63
+ %t33 = call core.gt(%t31, %t53) :: boolean
64
64
  yield %t33
65
65
  end_loop
66
66
  end_loop
@@ -30,37 +30,37 @@
30
30
  loop departments id=L5 in %t19 as el=%departments_el_20, idx=%departments_i_21
31
31
  %acc36 = decl_acc :: integer
32
32
  %t37 = load_field departments_el_20["teams"] :: any
33
- %acc42 = decl_acc :: integer
34
- loop teams id=L8 in %t37 as el=%teams_el_6, idx=%teams_i_7
35
- %t38 = load_field teams_el_6["headcount"] :: integer
36
- %acc36 = acc_add agg.sum(%acc36, %t38) :: integer
37
- %t44 = load_field teams_el_6["team_name"] :: string
38
- %acc42 = acc_add agg.count(%acc42, %t44) :: integer
33
+ %acc44 = decl_acc :: integer
34
+ loop teams id=L8 in %t37 as el=%t38, idx=%t39
35
+ %t40 = load_field t38["headcount"] :: integer
36
+ %acc36 = acc_add agg.sum(%acc36, %t40) :: integer
37
+ %t48 = load_field t38["team_name"] :: string
38
+ %acc44 = acc_add agg.count(%acc44, %t48) :: integer
39
39
  end_loop
40
- %t39 = acc_load %acc36 :: integer
41
- %t45 = acc_load %acc42 :: integer
42
- %t24 = call core.div(%t39, %t45) :: float
40
+ %t41 = acc_load %acc36 :: integer
41
+ %t49 = acc_load %acc44 :: integer
42
+ %t24 = call core.div(%t41, %t49) :: float
43
43
  yield %t24
44
44
  end_loop
45
45
  )
46
46
  (Declaration is_above_average_team
47
47
  %t25 = load_input "departments" :: array
48
48
  loop departments id=L6 in %t25 as el=%departments_el_26, idx=%departments_i_27
49
- %t28 = load_field departments_el_26["teams"] :: any
50
- %acc52 = decl_acc :: integer
51
- %acc58 = decl_acc :: integer
52
- loop teams id=L10 in %t28 as el=%teams_el_6, idx=%teams_i_7
53
- %t54 = load_field teams_el_6["headcount"] :: integer
54
- %acc52 = acc_add agg.sum(%acc52, %t54) :: integer
55
- %t60 = load_field teams_el_6["team_name"] :: string
56
- %acc58 = acc_add agg.count(%acc58, %t60) :: integer
49
+ %acc56 = decl_acc :: integer
50
+ %t57 = load_field departments_el_26["teams"] :: any
51
+ %acc64 = decl_acc :: integer
52
+ loop teams id=L10 in %t57 as el=%t58, idx=%t59
53
+ %t60 = load_field t58["headcount"] :: integer
54
+ %acc56 = acc_add agg.sum(%acc56, %t60) :: integer
55
+ %t68 = load_field t58["team_name"] :: string
56
+ %acc64 = acc_add agg.count(%acc64, %t68) :: integer
57
57
  end_loop
58
- %t55 = acc_load %acc52 :: integer
59
- %t61 = acc_load %acc58 :: integer
60
- %t49 = call core.div(%t55, %t61) :: float
61
- loop teams id=L7 in %t28 as el=%teams_el_29, idx=%teams_i_30
58
+ %t61 = acc_load %acc56 :: integer
59
+ %t69 = acc_load %acc64 :: integer
60
+ %t53 = call core.div(%t61, %t69) :: float
61
+ loop teams id=L7 in %t57 as el=%teams_el_29, idx=%teams_i_30
62
62
  %t31 = load_field teams_el_29["headcount"] :: integer
63
- %t33 = call core.gt(%t31, %t49) :: boolean
63
+ %t33 = call core.gt(%t31, %t53) :: boolean
64
64
  yield %t33
65
65
  end_loop
66
66
  end_loop
@@ -30,37 +30,37 @@
30
30
  loop departments id=L5 in %t19 as el=%departments_el_20, idx=%departments_i_21
31
31
  %acc36 = decl_acc :: integer
32
32
  %t37 = load_field departments_el_20["teams"] :: any
33
- %acc42 = decl_acc :: integer
34
- loop teams id=L8 in %t37 as el=%teams_el_6, idx=%teams_i_7
35
- %t38 = load_field teams_el_6["headcount"] :: integer
36
- %acc36 = acc_add agg.sum(%acc36, %t38) :: integer
37
- %t44 = load_field teams_el_6["team_name"] :: string
38
- %acc42 = acc_add agg.count(%acc42, %t44) :: integer
33
+ %acc44 = decl_acc :: integer
34
+ loop teams id=L8 in %t37 as el=%t38, idx=%t39
35
+ %t40 = load_field t38["headcount"] :: integer
36
+ %acc36 = acc_add agg.sum(%acc36, %t40) :: integer
37
+ %t48 = load_field t38["team_name"] :: string
38
+ %acc44 = acc_add agg.count(%acc44, %t48) :: integer
39
39
  end_loop
40
- %t39 = acc_load %acc36 :: integer
41
- %t45 = acc_load %acc42 :: integer
42
- %t24 = call core.div(%t39, %t45) :: float
40
+ %t41 = acc_load %acc36 :: integer
41
+ %t49 = acc_load %acc44 :: integer
42
+ %t24 = call core.div(%t41, %t49) :: float
43
43
  yield %t24
44
44
  end_loop
45
45
  )
46
46
  (Declaration is_above_average_team
47
47
  %t25 = load_input "departments" :: array
48
48
  loop departments id=L6 in %t25 as el=%departments_el_26, idx=%departments_i_27
49
- %t28 = load_field departments_el_26["teams"] :: any
50
- %acc52 = decl_acc :: integer
51
- %acc58 = decl_acc :: integer
52
- loop teams id=L10 in %t28 as el=%teams_el_6, idx=%teams_i_7
53
- %t54 = load_field teams_el_6["headcount"] :: integer
54
- %acc52 = acc_add agg.sum(%acc52, %t54) :: integer
55
- %t60 = load_field teams_el_6["team_name"] :: string
56
- %acc58 = acc_add agg.count(%acc58, %t60) :: integer
49
+ %acc56 = decl_acc :: integer
50
+ %t57 = load_field departments_el_26["teams"] :: any
51
+ %acc64 = decl_acc :: integer
52
+ loop teams id=L10 in %t57 as el=%t58, idx=%t59
53
+ %t60 = load_field t58["headcount"] :: integer
54
+ %acc56 = acc_add agg.sum(%acc56, %t60) :: integer
55
+ %t68 = load_field t58["team_name"] :: string
56
+ %acc64 = acc_add agg.count(%acc64, %t68) :: integer
57
57
  end_loop
58
- %t55 = acc_load %acc52 :: integer
59
- %t61 = acc_load %acc58 :: integer
60
- %t49 = call core.div(%t55, %t61) :: float
61
- loop teams id=L7 in %t28 as el=%teams_el_29, idx=%teams_i_30
58
+ %t61 = acc_load %acc56 :: integer
59
+ %t69 = acc_load %acc64 :: integer
60
+ %t53 = call core.div(%t61, %t69) :: float
61
+ loop teams id=L7 in %t57 as el=%teams_el_29, idx=%teams_i_30
62
62
  %t31 = load_field teams_el_29["headcount"] :: integer
63
- %t33 = call core.gt(%t31, %t49) :: boolean
63
+ %t33 = call core.gt(%t31, %t53) :: boolean
64
64
  yield %t33
65
65
  end_loop
66
66
  end_loop
@@ -30,37 +30,37 @@
30
30
  loop departments id=L5 in %t19 as el=%departments_el_20, idx=%departments_i_21
31
31
  %acc36 = decl_acc :: integer
32
32
  %t37 = load_field departments_el_20["teams"] :: any
33
- %acc42 = decl_acc :: integer
34
- loop teams id=L8 in %t37 as el=%teams_el_6, idx=%teams_i_7
35
- %t38 = load_field teams_el_6["headcount"] :: integer
36
- %acc36 = acc_add agg.sum(%acc36, %t38) :: integer
37
- %t44 = load_field teams_el_6["team_name"] :: string
38
- %acc42 = acc_add agg.count(%acc42, %t44) :: integer
33
+ %acc44 = decl_acc :: integer
34
+ loop teams id=L8 in %t37 as el=%t38, idx=%t39
35
+ %t40 = load_field t38["headcount"] :: integer
36
+ %acc36 = acc_add agg.sum(%acc36, %t40) :: integer
37
+ %t48 = load_field t38["team_name"] :: string
38
+ %acc44 = acc_add agg.count(%acc44, %t48) :: integer
39
39
  end_loop
40
- %t39 = acc_load %acc36 :: integer
41
- %t45 = acc_load %acc42 :: integer
42
- %t24 = call core.div(%t39, %t45) :: float
40
+ %t41 = acc_load %acc36 :: integer
41
+ %t49 = acc_load %acc44 :: integer
42
+ %t24 = call core.div(%t41, %t49) :: float
43
43
  yield %t24
44
44
  end_loop
45
45
  )
46
46
  (Declaration is_above_average_team
47
47
  %t25 = load_input "departments" :: array
48
48
  loop departments id=L6 in %t25 as el=%departments_el_26, idx=%departments_i_27
49
- %t28 = load_field departments_el_26["teams"] :: any
50
- %acc52 = decl_acc :: integer
51
- %acc58 = decl_acc :: integer
52
- loop teams id=L10 in %t28 as el=%teams_el_6, idx=%teams_i_7
53
- %t54 = load_field teams_el_6["headcount"] :: integer
54
- %acc52 = acc_add agg.sum(%acc52, %t54) :: integer
55
- %t60 = load_field teams_el_6["team_name"] :: string
56
- %acc58 = acc_add agg.count(%acc58, %t60) :: integer
49
+ %acc56 = decl_acc :: integer
50
+ %t57 = load_field departments_el_26["teams"] :: any
51
+ %acc64 = decl_acc :: integer
52
+ loop teams id=L10 in %t57 as el=%t58, idx=%t59
53
+ %t60 = load_field t58["headcount"] :: integer
54
+ %acc56 = acc_add agg.sum(%acc56, %t60) :: integer
55
+ %t68 = load_field t58["team_name"] :: string
56
+ %acc64 = acc_add agg.count(%acc64, %t68) :: integer
57
57
  end_loop
58
- %t55 = acc_load %acc52 :: integer
59
- %t61 = acc_load %acc58 :: integer
60
- %t49 = call core.div(%t55, %t61) :: float
61
- loop teams id=L7 in %t28 as el=%teams_el_29, idx=%teams_i_30
58
+ %t61 = acc_load %acc56 :: integer
59
+ %t69 = acc_load %acc64 :: integer
60
+ %t53 = call core.div(%t61, %t69) :: float
61
+ loop teams id=L7 in %t57 as el=%teams_el_29, idx=%teams_i_30
62
62
  %t31 = load_field teams_el_29["headcount"] :: integer
63
- %t33 = call core.gt(%t31, %t49) :: boolean
63
+ %t33 = call core.gt(%t31, %t53) :: boolean
64
64
  yield %t33
65
65
  end_loop
66
66
  end_loop
@@ -1,16 +1,16 @@
1
1
  (NAST
2
2
  (VALUE dept_headcount
3
- (Call :"agg.sum"
3
+ (Call :sum
4
4
  (InputRef [:departments, :dept, :teams, :team, :headcount])
5
5
  )
6
6
  )
7
7
  (VALUE teams_per_dept
8
- (Call :"agg.count"
8
+ (Call :count
9
9
  (InputRef [:departments, :dept, :teams, :team, :team_name])
10
10
  )
11
11
  )
12
12
  (VALUE avg_headcount_per_dept
13
- (Call :"core.div"
13
+ (Call :divide
14
14
  (Ref dept_headcount)
15
15
  (Ref teams_per_dept)
16
16
  )
@@ -34,14 +34,14 @@ export function _avg_headcount_per_dept(input) {
34
34
  t19.forEach((departments_el_20, departments_i_21) => {
35
35
  let acc36 = 0;
36
36
  let t37 = departments_el_20["teams"];
37
- let acc42 = 0;
38
- t37.forEach((teams_el_6, teams_i_7) => {
39
- let t38 = teams_el_6["headcount"];
40
- acc36 += t38;
41
- let t44 = teams_el_6["team_name"];
42
- acc42 += 1;
37
+ let acc44 = 0;
38
+ t37.forEach((t38, t39) => {
39
+ let t40 = t38["headcount"];
40
+ acc36 += t40;
41
+ let t48 = t38["team_name"];
42
+ acc44 += 1;
43
43
  });
44
- let t24 = acc36 / acc42;
44
+ let t24 = acc36 / acc44;
45
45
  out.push(t24);
46
46
  });
47
47
  return out;
@@ -52,19 +52,19 @@ export function _is_above_average_team(input) {
52
52
  let t25 = input["departments"];
53
53
  t25.forEach((departments_el_26, departments_i_27) => {
54
54
  let out_1 = [];
55
- let t28 = departments_el_26["teams"];
56
- let acc52 = 0;
57
- let acc58 = 0;
58
- t28.forEach((teams_el_6, teams_i_7) => {
59
- let t54 = teams_el_6["headcount"];
60
- acc52 += t54;
61
- let t60 = teams_el_6["team_name"];
62
- acc58 += 1;
55
+ let acc56 = 0;
56
+ let t57 = departments_el_26["teams"];
57
+ let acc64 = 0;
58
+ t57.forEach((t58, t59) => {
59
+ let t60 = t58["headcount"];
60
+ acc56 += t60;
61
+ let t68 = t58["team_name"];
62
+ acc64 += 1;
63
63
  });
64
- let t49 = acc52 / acc58;
65
- t28.forEach((teams_el_29, teams_i_30) => {
64
+ let t53 = acc56 / acc64;
65
+ t57.forEach((teams_el_29, teams_i_30) => {
66
66
  let t31 = teams_el_29["headcount"];
67
- let t33 = t31 > t49;
67
+ let t33 = t31 > t53;
68
68
  out_1.push(t33);
69
69
  });
70
70
  out.push(out_1);