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
@@ -1,5 +1,5 @@
1
1
  # Autogenerated by Kumi Codegen
2
- module Kumi::Compiled::KUMI_447413afce4b3071c671c345fe6db361e3d9c77cd6429524b30a40dc63b3f760
2
+ module Kumi::Compiled::KUMI_d4065d9b2c1fa95582e236ac4c79f6623745ec731b5961da26df7c2f9e2a9cb6
3
3
  def self.from(input_data = nil)
4
4
  instance = Object.new
5
5
  instance.extend(self)
@@ -66,16 +66,16 @@ module Kumi::Compiled::KUMI_447413afce4b3071c671c345fe6db361e3d9c77cd6429524b30a
66
66
  t19.each_with_index do |departments_el_20, departments_i_21|
67
67
  acc36 = 0
68
68
  t37 = departments_el_20["teams"] || departments_el_20[:teams]
69
- acc42 = 0
70
- t37.each_with_index do |teams_el_6, teams_i_7|
71
- t38 = teams_el_6["headcount"] || teams_el_6[:headcount]
72
- acc36 += t38
73
- t44 = teams_el_6["team_name"] || teams_el_6[:team_name]
74
- acc42 += 1
69
+ acc44 = 0
70
+ t37.each_with_index do |t38, t39|
71
+ t40 = t38["headcount"] || t38[:headcount]
72
+ acc36 += t40
73
+ t48 = t38["team_name"] || t38[:team_name]
74
+ acc44 += 1
75
75
  end
76
- t39 = acc36
77
- t45 = acc42
78
- t24 = t39 / t45.to_f
76
+ t41 = acc36
77
+ t49 = acc44
78
+ t24 = t41 / t49.to_f
79
79
  out << t24
80
80
  end
81
81
  out
@@ -86,21 +86,21 @@ module Kumi::Compiled::KUMI_447413afce4b3071c671c345fe6db361e3d9c77cd6429524b30a
86
86
  t25 = input["departments"] || input[:departments]
87
87
  t25.each_with_index do |departments_el_26, departments_i_27|
88
88
  out_1 = []
89
- t28 = departments_el_26["teams"] || departments_el_26[:teams]
90
- acc52 = 0
91
- acc58 = 0
92
- t28.each_with_index do |teams_el_6, teams_i_7|
93
- t54 = teams_el_6["headcount"] || teams_el_6[:headcount]
94
- acc52 += t54
95
- t60 = teams_el_6["team_name"] || teams_el_6[:team_name]
96
- acc58 += 1
89
+ acc56 = 0
90
+ t57 = departments_el_26["teams"] || departments_el_26[:teams]
91
+ acc64 = 0
92
+ t57.each_with_index do |t58, t59|
93
+ t60 = t58["headcount"] || t58[:headcount]
94
+ acc56 += t60
95
+ t68 = t58["team_name"] || t58[:team_name]
96
+ acc64 += 1
97
97
  end
98
- t55 = acc52
99
- t61 = acc58
100
- t49 = t55 / t61.to_f
101
- t28.each_with_index do |teams_el_29, teams_i_30|
98
+ t61 = acc56
99
+ t69 = acc64
100
+ t53 = t61 / t69.to_f
101
+ t57.each_with_index do |teams_el_29, teams_i_30|
102
102
  t31 = teams_el_29["headcount"] || teams_el_29[:headcount]
103
- t33 = t31 > t49
103
+ t33 = t31 > t53
104
104
  out_1 << t33
105
105
  end
106
106
  out << out_1
@@ -15,7 +15,7 @@
15
15
  (Ref teams_per_dept) :: [departments] -> integer
16
16
  ) :: [departments] -> float
17
17
  ) :: [departments] -> float
18
- (TRAIT is_above_average_team
18
+ (VALUE is_above_average_team
19
19
  (Call :core.gt
20
20
  (InputRef departments.dept.teams.team.headcount key_chain=[]) :: [departments, teams] -> integer
21
21
  (Ref avg_headcount_per_dept) :: [departments] -> float
@@ -1,5 +1,5 @@
1
1
  # Autogenerated by Kumi Codegen
2
- module Kumi::Compiled::KUMI_cfbcf7cb51fcc9e86ca004a8b3a97b403e94a17dab1ff27d148cdca41ad73688
2
+ module Kumi::Compiled::KUMI_ee08a4690485a37a0f18de249ead6563ffb9cf9625312459a6000d00cad9f29c
3
3
  def self.from(input_data = nil)
4
4
  instance = Object.new
5
5
  instance.extend(self)
@@ -1,5 +1,5 @@
1
1
  # Autogenerated by Kumi Codegen
2
- module Kumi::Compiled::KUMI_412a073d6331291d712e4dc48c7415df553463848fb1f202ec080398449b0d6a
2
+ module Kumi::Compiled::KUMI_c72cd3609d08e6946eb6c74183f400d8c0678040a863711e4b82a63da1b63319
3
3
  def self.from(input_data = nil)
4
4
  instance = Object.new
5
5
  instance.extend(self)
@@ -1,5 +1,5 @@
1
1
  # Autogenerated by Kumi Codegen
2
- module Kumi::Compiled::KUMI_97a8784bdcc1349e1d5789fc4bbccf7733108a0c18ccf51bf0ca7f89e3a903a3
2
+ module Kumi::Compiled::KUMI_1049f6474f9d41f05da4c2b6445c374c1eab40b0ff3089ecb80195a4550bceb8
3
3
  def self.from(input_data = nil)
4
4
  instance = Object.new
5
5
  instance.extend(self)
@@ -25,7 +25,7 @@
25
25
  %t14 = load_input "y" :: integer
26
26
  %t15 = const 2 :: integer
27
27
  %t16 = call core.mul(%t14, %t15) :: integer
28
- %t17 = make_tuple(%t10, %t13, %t16) :: tuple<integer>
28
+ %t17 = make_tuple(%t10, %t13, %t16) :: tuple<integer, integer, integer>
29
29
  yield %t17
30
30
  )
31
31
  )
@@ -25,7 +25,7 @@
25
25
  %t14 = load_input "y" :: integer
26
26
  %t15 = const 2 :: integer
27
27
  %t16 = call core.mul(%t14, %t15) :: integer
28
- %t17 = make_tuple(%t10, %t13, %t16) :: tuple<integer>
28
+ %t17 = make_tuple(%t10, %t13, %t16) :: tuple<integer, integer, integer>
29
29
  yield %t17
30
30
  )
31
31
  )
@@ -25,7 +25,7 @@
25
25
  %t14 = load_input "y" :: integer
26
26
  %t15 = const 2 :: integer
27
27
  %t16 = call core.mul(%t14, %t15) :: integer
28
- %t17 = make_tuple(%t10, %t13, %t16) :: tuple<integer>
28
+ %t17 = make_tuple(%t10, %t13, %t16) :: tuple<integer, integer, integer>
29
29
  yield %t17
30
30
  )
31
31
  )
@@ -25,7 +25,7 @@
25
25
  %t14 = load_input "y" :: integer
26
26
  %t15 = const 2 :: integer
27
27
  %t16 = call core.mul(%t14, %t15) :: integer
28
- %t17 = make_tuple(%t10, %t13, %t16) :: tuple<integer>
28
+ %t17 = make_tuple(%t10, %t13, %t16) :: tuple<integer, integer, integer>
29
29
  yield %t17
30
30
  )
31
31
  )
@@ -25,7 +25,7 @@
25
25
  %t14 = load_input "y" :: integer
26
26
  %t15 = const 2 :: integer
27
27
  %t16 = call core.mul(%t14, %t15) :: integer
28
- %t17 = make_tuple(%t10, %t13, %t16) :: tuple<integer>
28
+ %t17 = make_tuple(%t10, %t13, %t16) :: tuple<integer, integer, integer>
29
29
  yield %t17
30
30
  )
31
31
  )
@@ -25,7 +25,7 @@
25
25
  %t14 = load_input "y" :: integer
26
26
  %t15 = const 2 :: integer
27
27
  %t16 = call core.mul(%t14, %t15) :: integer
28
- %t17 = make_tuple(%t10, %t13, %t16) :: tuple<integer>
28
+ %t17 = make_tuple(%t10, %t13, %t16) :: tuple<integer, integer, integer>
29
29
  yield %t17
30
30
  )
31
31
  )
@@ -25,7 +25,7 @@
25
25
  %t14 = load_input "y" :: integer
26
26
  %t15 = const 2 :: integer
27
27
  %t16 = call core.mul(%t14, %t15) :: integer
28
- %t17 = make_tuple(%t10, %t13, %t16) :: tuple<integer>
28
+ %t17 = make_tuple(%t10, %t13, %t16) :: tuple<integer, integer, integer>
29
29
  yield %t17
30
30
  )
31
31
  )
@@ -1,18 +1,18 @@
1
1
  (NAST
2
2
  (VALUE sum
3
- (Call :"core.add"
3
+ (Call :add
4
4
  (InputRef [:x])
5
5
  (InputRef [:y])
6
6
  )
7
7
  )
8
8
  (VALUE product
9
- (Call :"core.mul"
9
+ (Call :multiply
10
10
  (InputRef [:x])
11
11
  (InputRef [:y])
12
12
  )
13
13
  )
14
14
  (VALUE difference
15
- (Call :"core.sub"
15
+ (Call :subtract
16
16
  (InputRef [:x])
17
17
  (InputRef [:y])
18
18
  )
@@ -20,11 +20,11 @@
20
20
  (VALUE results_array
21
21
  (Tuple
22
22
  (Const 1)
23
- (Call :"core.add"
23
+ (Call :add
24
24
  (InputRef [:x])
25
25
  (Const 10)
26
26
  )
27
- (Call :"core.mul"
27
+ (Call :multiply
28
28
  (InputRef [:y])
29
29
  (Const 2)
30
30
  )
@@ -1,5 +1,5 @@
1
1
  # Autogenerated by Kumi Codegen
2
- module Kumi::Compiled::KUMI_b9f58390b5b40ee6d866aa2798a68b5e5d1c9232fd8a4222f07422ac91dd4b29
2
+ module Kumi::Compiled::KUMI_52c858dd08717cf97edaff33a54004b4af6c064f32453eb33012e14cd18d48c2
3
3
  def self.from(input_data = nil)
4
4
  instance = Object.new
5
5
  instance.extend(self)
@@ -28,6 +28,6 @@
28
28
  (InputRef y key_chain=[]) :: [] -> integer
29
29
  (Const 2) :: [] -> integer
30
30
  ) :: [] -> integer
31
- ) :: [] -> tuple<integer>
32
- ) :: [] -> tuple<integer>
31
+ ) :: [] -> tuple<integer, integer, integer>
32
+ ) :: [] -> tuple<integer, integer, integer>
33
33
  )
@@ -41,11 +41,11 @@
41
41
  %t55 = call core.mul(%t53, %t54) :: float
42
42
  %t26 = const 0.9 :: float
43
43
  %t27 = call core.mul(%t55, %t26) :: float
44
- %t52 = load_input "items" :: array
45
- %t53 = load_field items_el_22["price"] :: float
46
- %t54 = load_field items_el_22["qty"] :: integer
47
- %t55 = call core.mul(%t53, %t54) :: float
48
- %t29 = select %t51, %t27, %t55 :: float
44
+ %t56 = load_input "items" :: array
45
+ %t57 = load_field items_el_22["price"] :: float
46
+ %t58 = load_field items_el_22["qty"] :: integer
47
+ %t59 = call core.mul(%t57, %t58) :: float
48
+ %t29 = select %t51, %t27, %t59 :: float
49
49
  yield %t29
50
50
  end_loop
51
51
  )
@@ -63,11 +63,11 @@
63
63
  %acc_36 = decl_acc :: float
64
64
  %t37 = load_input "items" :: array
65
65
  loop items id=L6 in %t37 as el=%items_el_38, idx=%items_i_39
66
- %t56 = load_input "items" :: array
67
- %t57 = load_field items_el_38["price"] :: float
68
- %t58 = load_field items_el_38["qty"] :: integer
69
- %t59 = call core.mul(%t57, %t58) :: float
70
- %acc_36 = acc_add agg.sum(%acc_36, %t59) :: float
66
+ %t60 = load_input "items" :: array
67
+ %t61 = load_field items_el_38["price"] :: float
68
+ %t62 = load_field items_el_38["qty"] :: integer
69
+ %t63 = call core.mul(%t61, %t62) :: float
70
+ %acc_36 = acc_add agg.sum(%acc_36, %t63) :: float
71
71
  end_loop
72
72
  %t41 = acc_load %acc_36 :: float
73
73
  yield %t41
@@ -76,23 +76,23 @@
76
76
  %acc_42 = decl_acc :: float
77
77
  %t43 = load_input "items" :: array
78
78
  loop items id=L7 in %t43 as el=%items_el_44, idx=%items_i_45
79
- %t60 = load_input "items" :: array
80
- %t67 = load_input "items" :: array
81
- %t68 = load_field items_el_44["price"] :: float
82
- %t69 = const 100.0 :: float
83
- %t70 = call core.gt(%t68, %t69) :: boolean
84
- %t71 = load_input "items" :: array
85
- %t72 = load_field items_el_44["price"] :: float
86
- %t73 = load_field items_el_44["qty"] :: integer
87
- %t74 = call core.mul(%t72, %t73) :: float
88
- %t63 = const 0.9 :: float
89
- %t64 = call core.mul(%t74, %t63) :: float
79
+ %t64 = load_input "items" :: array
90
80
  %t71 = load_input "items" :: array
91
81
  %t72 = load_field items_el_44["price"] :: float
92
- %t73 = load_field items_el_44["qty"] :: integer
93
- %t74 = call core.mul(%t72, %t73) :: float
94
- %t66 = select %t70, %t64, %t74 :: float
95
- %acc_42 = acc_add agg.sum(%acc_42, %t66) :: float
82
+ %t73 = const 100.0 :: float
83
+ %t74 = call core.gt(%t72, %t73) :: boolean
84
+ %t75 = load_input "items" :: array
85
+ %t76 = load_field items_el_44["price"] :: float
86
+ %t77 = load_field items_el_44["qty"] :: integer
87
+ %t78 = call core.mul(%t76, %t77) :: float
88
+ %t67 = const 0.9 :: float
89
+ %t68 = call core.mul(%t78, %t67) :: float
90
+ %t79 = load_input "items" :: array
91
+ %t80 = load_field items_el_44["price"] :: float
92
+ %t81 = load_field items_el_44["qty"] :: integer
93
+ %t82 = call core.mul(%t80, %t81) :: float
94
+ %t70 = select %t74, %t68, %t82 :: float
95
+ %acc_42 = acc_add agg.sum(%acc_42, %t70) :: float
96
96
  end_loop
97
97
  %t47 = acc_load %acc_42 :: float
98
98
  yield %t47
@@ -56,10 +56,10 @@
56
56
  %acc_36 = decl_acc :: float
57
57
  %t37 = load_input "items" :: array
58
58
  loop items id=L6 in %t37 as el=%items_el_38, idx=%items_i_39
59
- %t57 = load_field items_el_38["price"] :: float
60
- %t58 = load_field items_el_38["qty"] :: integer
61
- %t59 = call core.mul(%t57, %t58) :: float
62
- %acc_36 = acc_add agg.sum(%acc_36, %t59) :: float
59
+ %t61 = load_field items_el_38["price"] :: float
60
+ %t62 = load_field items_el_38["qty"] :: integer
61
+ %t63 = call core.mul(%t61, %t62) :: float
62
+ %acc_36 = acc_add agg.sum(%acc_36, %t63) :: float
63
63
  end_loop
64
64
  %t41 = acc_load %acc_36 :: float
65
65
  yield %t41
@@ -68,15 +68,15 @@
68
68
  %acc_42 = decl_acc :: float
69
69
  %t43 = load_input "items" :: array
70
70
  loop items id=L7 in %t43 as el=%items_el_44, idx=%items_i_45
71
- %t68 = load_field items_el_44["price"] :: float
72
- %t69 = const 100.0 :: float
73
- %t73 = load_field items_el_44["qty"] :: integer
74
- %t63 = const 0.9 :: float
75
- %t70 = call core.gt(%t68, %t69) :: boolean
76
- %t74 = call core.mul(%t68, %t73) :: float
77
- %t64 = call core.mul(%t74, %t63) :: float
78
- %t66 = select %t70, %t64, %t74 :: float
79
- %acc_42 = acc_add agg.sum(%acc_42, %t66) :: float
71
+ %t72 = load_field items_el_44["price"] :: float
72
+ %t73 = const 100.0 :: float
73
+ %t77 = load_field items_el_44["qty"] :: integer
74
+ %t67 = const 0.9 :: float
75
+ %t74 = call core.gt(%t72, %t73) :: boolean
76
+ %t78 = call core.mul(%t72, %t77) :: float
77
+ %t68 = call core.mul(%t78, %t67) :: float
78
+ %t70 = select %t74, %t68, %t78 :: float
79
+ %acc_42 = acc_add agg.sum(%acc_42, %t70) :: float
80
80
  end_loop
81
81
  %t47 = acc_load %acc_42 :: float
82
82
  yield %t47
@@ -56,10 +56,10 @@
56
56
  %acc_36 = decl_acc :: float
57
57
  %t37 = load_input "items" :: array
58
58
  loop items id=L6 in %t37 as el=%items_el_38, idx=%items_i_39
59
- %t57 = load_field items_el_38["price"] :: float
60
- %t58 = load_field items_el_38["qty"] :: integer
61
- %t59 = call core.mul(%t57, %t58) :: float
62
- %acc_36 = acc_add agg.sum(%acc_36, %t59) :: float
59
+ %t61 = load_field items_el_38["price"] :: float
60
+ %t62 = load_field items_el_38["qty"] :: integer
61
+ %t63 = call core.mul(%t61, %t62) :: float
62
+ %acc_36 = acc_add agg.sum(%acc_36, %t63) :: float
63
63
  end_loop
64
64
  %t41 = acc_load %acc_36 :: float
65
65
  yield %t41
@@ -68,15 +68,15 @@
68
68
  %acc_42 = decl_acc :: float
69
69
  %t43 = load_input "items" :: array
70
70
  loop items id=L7 in %t43 as el=%items_el_44, idx=%items_i_45
71
- %t68 = load_field items_el_44["price"] :: float
72
- %t69 = const 100.0 :: float
73
- %t73 = load_field items_el_44["qty"] :: integer
74
- %t63 = const 0.9 :: float
75
- %t70 = call core.gt(%t68, %t69) :: boolean
76
- %t74 = call core.mul(%t68, %t73) :: float
77
- %t64 = call core.mul(%t74, %t63) :: float
78
- %t66 = select %t70, %t64, %t74 :: float
79
- %acc_42 = acc_add agg.sum(%acc_42, %t66) :: float
71
+ %t72 = load_field items_el_44["price"] :: float
72
+ %t73 = const 100.0 :: float
73
+ %t77 = load_field items_el_44["qty"] :: integer
74
+ %t67 = const 0.9 :: float
75
+ %t74 = call core.gt(%t72, %t73) :: boolean
76
+ %t78 = call core.mul(%t72, %t77) :: float
77
+ %t68 = call core.mul(%t78, %t67) :: float
78
+ %t70 = select %t74, %t68, %t78 :: float
79
+ %acc_42 = acc_add agg.sum(%acc_42, %t70) :: float
80
80
  end_loop
81
81
  %t47 = acc_load %acc_42 :: float
82
82
  yield %t47
@@ -56,10 +56,10 @@
56
56
  %acc_36 = decl_acc :: float
57
57
  %t37 = load_input "items" :: array
58
58
  loop items id=L6 in %t37 as el=%items_el_38, idx=%items_i_39
59
- %t57 = load_field items_el_38["price"] :: float
60
- %t58 = load_field items_el_38["qty"] :: integer
61
- %t59 = call core.mul(%t57, %t58) :: float
62
- %acc_36 = acc_add agg.sum(%acc_36, %t59) :: float
59
+ %t61 = load_field items_el_38["price"] :: float
60
+ %t62 = load_field items_el_38["qty"] :: integer
61
+ %t63 = call core.mul(%t61, %t62) :: float
62
+ %acc_36 = acc_add agg.sum(%acc_36, %t63) :: float
63
63
  end_loop
64
64
  %t41 = acc_load %acc_36 :: float
65
65
  yield %t41
@@ -67,16 +67,16 @@
67
67
  (Declaration cart_total_effective
68
68
  %acc_42 = decl_acc :: float
69
69
  %t43 = load_input "items" :: array
70
- %t69 = const 100.0 :: float
71
- %t63 = const 0.9 :: float
70
+ %t73 = const 100.0 :: float
71
+ %t67 = const 0.9 :: float
72
72
  loop items id=L7 in %t43 as el=%items_el_44, idx=%items_i_45
73
- %t68 = load_field items_el_44["price"] :: float
74
- %t73 = load_field items_el_44["qty"] :: integer
75
- %t70 = call core.gt(%t68, %t69) :: boolean
76
- %t74 = call core.mul(%t68, %t73) :: float
77
- %t64 = call core.mul(%t74, %t63) :: float
78
- %t66 = select %t70, %t64, %t74 :: float
79
- %acc_42 = acc_add agg.sum(%acc_42, %t66) :: float
73
+ %t72 = load_field items_el_44["price"] :: float
74
+ %t77 = load_field items_el_44["qty"] :: integer
75
+ %t74 = call core.gt(%t72, %t73) :: boolean
76
+ %t78 = call core.mul(%t72, %t77) :: float
77
+ %t68 = call core.mul(%t78, %t67) :: float
78
+ %t70 = select %t74, %t68, %t78 :: float
79
+ %acc_42 = acc_add agg.sum(%acc_42, %t70) :: float
80
80
  end_loop
81
81
  %t47 = acc_load %acc_42 :: float
82
82
  yield %t47
@@ -56,10 +56,10 @@
56
56
  %acc_36 = decl_acc :: float
57
57
  %t37 = load_input "items" :: array
58
58
  loop items id=L6 in %t37 as el=%items_el_38, idx=%items_i_39
59
- %t57 = load_field items_el_38["price"] :: float
60
- %t58 = load_field items_el_38["qty"] :: integer
61
- %t59 = call core.mul(%t57, %t58) :: float
62
- %acc_36 = acc_add agg.sum(%acc_36, %t59) :: float
59
+ %t61 = load_field items_el_38["price"] :: float
60
+ %t62 = load_field items_el_38["qty"] :: integer
61
+ %t63 = call core.mul(%t61, %t62) :: float
62
+ %acc_36 = acc_add agg.sum(%acc_36, %t63) :: float
63
63
  end_loop
64
64
  %t41 = acc_load %acc_36 :: float
65
65
  yield %t41
@@ -67,16 +67,16 @@
67
67
  (Declaration cart_total_effective
68
68
  %acc_42 = decl_acc :: float
69
69
  %t43 = load_input "items" :: array
70
- %t69 = const 100.0 :: float
71
- %t63 = const 0.9 :: float
70
+ %t73 = const 100.0 :: float
71
+ %t67 = const 0.9 :: float
72
72
  loop items id=L7 in %t43 as el=%items_el_44, idx=%items_i_45
73
- %t68 = load_field items_el_44["price"] :: float
74
- %t73 = load_field items_el_44["qty"] :: integer
75
- %t70 = call core.gt(%t68, %t69) :: boolean
76
- %t74 = call core.mul(%t68, %t73) :: float
77
- %t64 = call core.mul(%t74, %t63) :: float
78
- %t66 = select %t70, %t64, %t74 :: float
79
- %acc_42 = acc_add agg.sum(%acc_42, %t66) :: float
73
+ %t72 = load_field items_el_44["price"] :: float
74
+ %t77 = load_field items_el_44["qty"] :: integer
75
+ %t74 = call core.gt(%t72, %t73) :: boolean
76
+ %t78 = call core.mul(%t72, %t77) :: float
77
+ %t68 = call core.mul(%t78, %t67) :: float
78
+ %t70 = select %t74, %t68, %t78 :: float
79
+ %acc_42 = acc_add agg.sum(%acc_42, %t70) :: float
80
80
  end_loop
81
81
  %t47 = acc_load %acc_42 :: float
82
82
  yield %t47
@@ -1,14 +1,14 @@
1
1
  (NAST
2
2
  (VALUE items_subtotal
3
- (Call :"core.mul"
3
+ (Call :multiply
4
4
  (InputRef [:items, :item, :price])
5
5
  (InputRef [:items, :item, :qty])
6
6
  )
7
7
  )
8
8
  (VALUE items_discounted
9
- (Call :"core.mul"
9
+ (Call :multiply
10
10
  (InputRef [:items, :item, :price])
11
- (Call :"core.sub"
11
+ (Call :subtract
12
12
  (Const 1.0)
13
13
  (InputRef [:discount])
14
14
  )
@@ -21,9 +21,9 @@
21
21
  )
22
22
  )
23
23
  (VALUE items_effective
24
- (Call :__select__
24
+ (Call :select
25
25
  (Ref items_is_big)
26
- (Call :"core.mul"
26
+ (Call :multiply
27
27
  (Ref items_subtotal)
28
28
  (Const 0.9)
29
29
  )
@@ -31,17 +31,17 @@
31
31
  )
32
32
  )
33
33
  (VALUE total_qty
34
- (Call :"agg.sum"
34
+ (Call :sum
35
35
  (InputRef [:items, :item, :qty])
36
36
  )
37
37
  )
38
38
  (VALUE cart_total
39
- (Call :"agg.sum"
39
+ (Call :sum
40
40
  (Ref items_subtotal)
41
41
  )
42
42
  )
43
43
  (VALUE cart_total_effective
44
- (Call :"agg.sum"
44
+ (Call :sum
45
45
  (Ref items_effective)
46
46
  )
47
47
  )
@@ -67,10 +67,10 @@ export function _cart_total(input) {
67
67
  let acc_36 = 0.0;
68
68
  let t37 = input["items"];
69
69
  t37.forEach((items_el_38, items_i_39) => {
70
- let t57 = items_el_38["price"];
71
- let t58 = items_el_38["qty"];
72
- let t59 = t57 * t58;
73
- acc_36 += t59;
70
+ let t61 = items_el_38["price"];
71
+ let t62 = items_el_38["qty"];
72
+ let t63 = t61 * t62;
73
+ acc_36 += t63;
74
74
  });
75
75
  return acc_36;
76
76
  }
@@ -78,16 +78,16 @@ export function _cart_total(input) {
78
78
  export function _cart_total_effective(input) {
79
79
  let acc_42 = 0.0;
80
80
  let t43 = input["items"];
81
- const t69 = 100.0;
82
- const t63 = 0.9;
81
+ const t73 = 100.0;
82
+ const t67 = 0.9;
83
83
  t43.forEach((items_el_44, items_i_45) => {
84
- let t68 = items_el_44["price"];
85
- let t73 = items_el_44["qty"];
86
- let t70 = t68 > t69;
87
- let t74 = t68 * t73;
88
- let t64 = t74 * t63;
89
- let t66 = t70 ? t64 : t74;
90
- acc_42 += t66;
84
+ let t72 = items_el_44["price"];
85
+ let t77 = items_el_44["qty"];
86
+ let t74 = t72 > t73;
87
+ let t78 = t72 * t77;
88
+ let t68 = t78 * t67;
89
+ let t70 = t74 ? t68 : t78;
90
+ acc_42 += t70;
91
91
  });
92
92
  return acc_42;
93
93
  }
@@ -1,5 +1,5 @@
1
1
  # Autogenerated by Kumi Codegen
2
- module Kumi::Compiled::KUMI_9876b5b41b48be4393b4b7656e731d87a59d3f650e68d8d6602fd252b0836401
2
+ module Kumi::Compiled::KUMI_1d3b2fb0b1b00e7730f48d49c8c33acdea2ee603018ffacfc1349df73a8dd4ee
3
3
  def self.from(input_data = nil)
4
4
  instance = Object.new
5
5
  instance.extend(self)
@@ -100,10 +100,10 @@ module Kumi::Compiled::KUMI_9876b5b41b48be4393b4b7656e731d87a59d3f650e68d8d6602f
100
100
  acc_36 = 0.0
101
101
  t37 = input["items"] || input[:items]
102
102
  t37.each_with_index do |items_el_38, items_i_39|
103
- t57 = items_el_38["price"] || items_el_38[:price]
104
- t58 = items_el_38["qty"] || items_el_38[:qty]
105
- t59 = t57 * t58
106
- acc_36 += t59
103
+ t61 = items_el_38["price"] || items_el_38[:price]
104
+ t62 = items_el_38["qty"] || items_el_38[:qty]
105
+ t63 = t61 * t62
106
+ acc_36 += t63
107
107
  end
108
108
  acc_36
109
109
  end
@@ -111,16 +111,16 @@ module Kumi::Compiled::KUMI_9876b5b41b48be4393b4b7656e731d87a59d3f650e68d8d6602f
111
111
  def _cart_total_effective(input = @input)
112
112
  acc_42 = 0.0
113
113
  t43 = input["items"] || input[:items]
114
- t69 = 100.0
115
- t63 = 0.9
114
+ t73 = 100.0
115
+ t67 = 0.9
116
116
  t43.each_with_index do |items_el_44, items_i_45|
117
- t68 = items_el_44["price"] || items_el_44[:price]
118
- t73 = items_el_44["qty"] || items_el_44[:qty]
119
- t70 = t68 > t69
120
- t74 = t68 * t73
121
- t64 = t74 * t63
122
- t66 = t70 ? t64 : t74
123
- acc_42 += t66
117
+ t72 = items_el_44["price"] || items_el_44[:price]
118
+ t77 = items_el_44["qty"] || items_el_44[:qty]
119
+ t74 = t72 > t73
120
+ t78 = t72 * t77
121
+ t68 = t78 * t67
122
+ t70 = t74 ? t68 : t78
123
+ acc_42 += t70
124
124
  end
125
125
  acc_42
126
126
  end
@@ -14,7 +14,7 @@
14
14
  ) :: [] -> float
15
15
  ) :: [items] -> float
16
16
  ) :: [items] -> float
17
- (TRAIT items_is_big
17
+ (VALUE items_is_big
18
18
  (Call :core.gt
19
19
  (InputRef items.item.price key_chain=[]) :: [items] -> float
20
20
  (Const 100.0) :: [] -> float