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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/README.md +70 -71
- data/data/functions/agg/boolean.yaml +6 -2
- data/data/functions/agg/numeric.yaml +32 -16
- data/data/functions/agg/string.yaml +4 -3
- data/data/functions/core/arithmetic.yaml +62 -14
- data/data/functions/core/boolean.yaml +12 -6
- data/data/functions/core/comparison.yaml +25 -13
- data/data/functions/core/constructor.yaml +16 -8
- data/data/functions/core/select.yaml +3 -1
- data/data/functions/core/stencil.yaml +14 -5
- data/data/functions/core/string.yaml +9 -4
- data/data/kernels/ruby/agg/numeric.yaml +1 -1
- data/docs/UNSAT_DETECTION.md +83 -0
- data/golden/array_element/expected/nast.txt +1 -1
- data/golden/array_element/expected/schema_ruby.rb +1 -1
- data/golden/array_index/expected/nast.txt +7 -7
- data/golden/array_index/expected/schema_ruby.rb +1 -1
- data/golden/array_operations/expected/nast.txt +2 -2
- data/golden/array_operations/expected/schema_ruby.rb +1 -1
- data/golden/array_operations/expected/snast.txt +3 -3
- data/golden/cascade_logic/expected/lir_02_inlined.txt +8 -8
- data/golden/cascade_logic/expected/schema_ruby.rb +1 -1
- data/golden/cascade_logic/expected/snast.txt +2 -2
- data/golden/chained_fusion/expected/lir_02_inlined.txt +36 -36
- data/golden/chained_fusion/expected/lir_03_cse.txt +23 -23
- data/golden/chained_fusion/expected/lir_04_1_loop_fusion.txt +25 -25
- data/golden/chained_fusion/expected/lir_04_loop_invcm.txt +23 -23
- data/golden/chained_fusion/expected/lir_06_const_prop.txt +23 -23
- data/golden/chained_fusion/expected/nast.txt +2 -2
- data/golden/chained_fusion/expected/schema_javascript.mjs +23 -23
- data/golden/chained_fusion/expected/schema_ruby.rb +28 -28
- data/golden/element_arrays/expected/nast.txt +2 -2
- data/golden/element_arrays/expected/schema_ruby.rb +1 -1
- data/golden/element_arrays/expected/snast.txt +1 -1
- data/golden/empty_and_null_inputs/expected/lir_02_inlined.txt +18 -18
- data/golden/empty_and_null_inputs/expected/lir_03_cse.txt +17 -17
- data/golden/empty_and_null_inputs/expected/lir_04_1_loop_fusion.txt +17 -17
- data/golden/empty_and_null_inputs/expected/lir_04_loop_invcm.txt +17 -17
- data/golden/empty_and_null_inputs/expected/lir_06_const_prop.txt +17 -17
- data/golden/empty_and_null_inputs/expected/nast.txt +3 -3
- data/golden/empty_and_null_inputs/expected/schema_javascript.mjs +13 -13
- data/golden/empty_and_null_inputs/expected/schema_ruby.rb +18 -18
- data/golden/function_overload/expected/ast.txt +29 -0
- data/golden/function_overload/expected/input_plan.txt +4 -0
- data/golden/function_overload/expected/lir_00_unoptimized.txt +18 -0
- data/golden/function_overload/expected/lir_01_hoist_scalar_references.txt +18 -0
- data/golden/function_overload/expected/lir_02_inlined.txt +20 -0
- data/golden/function_overload/expected/lir_03_cse.txt +20 -0
- data/golden/function_overload/expected/lir_04_1_loop_fusion.txt +20 -0
- data/golden/function_overload/expected/lir_04_loop_invcm.txt +20 -0
- data/golden/function_overload/expected/lir_06_const_prop.txt +20 -0
- data/golden/function_overload/expected/nast.txt +22 -0
- data/golden/function_overload/expected/schema_javascript.mjs +12 -0
- data/golden/function_overload/expected/schema_ruby.rb +39 -0
- data/golden/function_overload/expected/snast.txt +22 -0
- data/golden/function_overload/input.json +8 -0
- data/golden/function_overload/schema.kumi +19 -0
- data/golden/game_of_life/expected/lir_00_unoptimized.txt +4 -4
- data/golden/game_of_life/expected/lir_01_hoist_scalar_references.txt +4 -4
- data/golden/game_of_life/expected/lir_02_inlined.txt +1294 -1294
- data/golden/game_of_life/expected/lir_03_cse.txt +403 -399
- data/golden/game_of_life/expected/lir_04_1_loop_fusion.txt +403 -399
- data/golden/game_of_life/expected/lir_04_loop_invcm.txt +403 -399
- data/golden/game_of_life/expected/lir_06_const_prop.txt +403 -399
- data/golden/game_of_life/expected/nast.txt +4 -4
- data/golden/game_of_life/expected/schema_javascript.mjs +87 -85
- data/golden/game_of_life/expected/schema_ruby.rb +88 -86
- data/golden/game_of_life/expected/snast.txt +10 -10
- data/golden/hash_keys/expected/schema_ruby.rb +1 -1
- data/golden/hash_value/expected/nast.txt +1 -1
- data/golden/hash_value/expected/schema_ruby.rb +1 -1
- data/golden/hash_value/expected/snast.txt +1 -1
- data/golden/hierarchical_complex/expected/lir_02_inlined.txt +15 -15
- data/golden/hierarchical_complex/expected/lir_03_cse.txt +1 -1
- data/golden/hierarchical_complex/expected/lir_04_1_loop_fusion.txt +1 -1
- data/golden/hierarchical_complex/expected/lir_04_loop_invcm.txt +1 -1
- data/golden/hierarchical_complex/expected/lir_06_const_prop.txt +1 -1
- data/golden/hierarchical_complex/expected/nast.txt +3 -3
- data/golden/hierarchical_complex/expected/schema_javascript.mjs +1 -1
- data/golden/hierarchical_complex/expected/schema_ruby.rb +2 -2
- data/golden/hierarchical_complex/expected/snast.txt +3 -3
- data/golden/inline_rename_scope_leak/expected/nast.txt +3 -3
- data/golden/inline_rename_scope_leak/expected/schema_ruby.rb +1 -1
- data/golden/input_reference/expected/nast.txt +2 -2
- data/golden/input_reference/expected/schema_ruby.rb +1 -1
- data/golden/interleaved_fusion/expected/lir_02_inlined.txt +35 -35
- data/golden/interleaved_fusion/expected/lir_03_cse.txt +26 -26
- data/golden/interleaved_fusion/expected/lir_04_1_loop_fusion.txt +27 -26
- data/golden/interleaved_fusion/expected/lir_04_loop_invcm.txt +26 -26
- data/golden/interleaved_fusion/expected/lir_06_const_prop.txt +26 -26
- data/golden/interleaved_fusion/expected/nast.txt +2 -2
- data/golden/interleaved_fusion/expected/schema_javascript.mjs +23 -23
- data/golden/interleaved_fusion/expected/schema_ruby.rb +29 -29
- data/golden/let_inline/expected/nast.txt +4 -4
- data/golden/let_inline/expected/schema_ruby.rb +1 -1
- data/golden/loop_fusion/expected/lir_02_inlined.txt +17 -17
- data/golden/loop_fusion/expected/lir_03_cse.txt +14 -14
- data/golden/loop_fusion/expected/lir_04_1_loop_fusion.txt +14 -14
- data/golden/loop_fusion/expected/lir_04_loop_invcm.txt +14 -14
- data/golden/loop_fusion/expected/lir_06_const_prop.txt +14 -14
- data/golden/loop_fusion/expected/nast.txt +1 -1
- data/golden/loop_fusion/expected/schema_javascript.mjs +12 -12
- data/golden/loop_fusion/expected/schema_ruby.rb +16 -16
- data/golden/min_reduce_scope/expected/nast.txt +3 -3
- data/golden/min_reduce_scope/expected/schema_ruby.rb +1 -1
- data/golden/min_reduce_scope/expected/snast.txt +1 -1
- data/golden/mixed_dimensions/expected/lir_02_inlined.txt +5 -5
- data/golden/mixed_dimensions/expected/lir_03_cse.txt +5 -5
- data/golden/mixed_dimensions/expected/lir_04_1_loop_fusion.txt +5 -5
- data/golden/mixed_dimensions/expected/lir_04_loop_invcm.txt +5 -5
- data/golden/mixed_dimensions/expected/lir_06_const_prop.txt +5 -5
- data/golden/mixed_dimensions/expected/nast.txt +2 -2
- data/golden/mixed_dimensions/expected/schema_javascript.mjs +3 -3
- data/golden/mixed_dimensions/expected/schema_ruby.rb +6 -6
- data/golden/multirank_hoisting/expected/lir_02_inlined.txt +48 -48
- data/golden/multirank_hoisting/expected/lir_03_cse.txt +35 -35
- data/golden/multirank_hoisting/expected/lir_04_1_loop_fusion.txt +35 -35
- data/golden/multirank_hoisting/expected/lir_04_loop_invcm.txt +35 -35
- data/golden/multirank_hoisting/expected/lir_06_const_prop.txt +35 -35
- data/golden/multirank_hoisting/expected/nast.txt +7 -7
- data/golden/multirank_hoisting/expected/schema_javascript.mjs +34 -34
- data/golden/multirank_hoisting/expected/schema_ruby.rb +36 -36
- data/golden/nested_hash/expected/nast.txt +1 -1
- data/golden/nested_hash/expected/schema_ruby.rb +1 -1
- data/golden/reduction_broadcast/expected/lir_02_inlined.txt +30 -30
- data/golden/reduction_broadcast/expected/lir_03_cse.txt +22 -22
- data/golden/reduction_broadcast/expected/lir_04_1_loop_fusion.txt +22 -22
- data/golden/reduction_broadcast/expected/lir_04_loop_invcm.txt +22 -22
- data/golden/reduction_broadcast/expected/lir_06_const_prop.txt +22 -22
- data/golden/reduction_broadcast/expected/nast.txt +3 -3
- data/golden/reduction_broadcast/expected/schema_javascript.mjs +18 -18
- data/golden/reduction_broadcast/expected/schema_ruby.rb +23 -23
- data/golden/reduction_broadcast/expected/snast.txt +1 -1
- data/golden/roll/expected/schema_ruby.rb +1 -1
- data/golden/shift/expected/schema_ruby.rb +1 -1
- data/golden/shift_2d/expected/schema_ruby.rb +1 -1
- data/golden/simple_math/expected/lir_00_unoptimized.txt +1 -1
- data/golden/simple_math/expected/lir_01_hoist_scalar_references.txt +1 -1
- data/golden/simple_math/expected/lir_02_inlined.txt +1 -1
- data/golden/simple_math/expected/lir_03_cse.txt +1 -1
- data/golden/simple_math/expected/lir_04_1_loop_fusion.txt +1 -1
- data/golden/simple_math/expected/lir_04_loop_invcm.txt +1 -1
- data/golden/simple_math/expected/lir_06_const_prop.txt +1 -1
- data/golden/simple_math/expected/nast.txt +5 -5
- data/golden/simple_math/expected/schema_ruby.rb +1 -1
- data/golden/simple_math/expected/snast.txt +2 -2
- data/golden/streaming_basics/expected/lir_02_inlined.txt +25 -25
- data/golden/streaming_basics/expected/lir_03_cse.txt +13 -13
- data/golden/streaming_basics/expected/lir_04_1_loop_fusion.txt +13 -13
- data/golden/streaming_basics/expected/lir_04_loop_invcm.txt +13 -13
- data/golden/streaming_basics/expected/lir_06_const_prop.txt +13 -13
- data/golden/streaming_basics/expected/nast.txt +8 -8
- data/golden/streaming_basics/expected/schema_javascript.mjs +13 -13
- data/golden/streaming_basics/expected/schema_ruby.rb +14 -14
- data/golden/streaming_basics/expected/snast.txt +1 -1
- data/golden/tuples/expected/lir_00_unoptimized.txt +5 -5
- data/golden/tuples/expected/lir_01_hoist_scalar_references.txt +5 -5
- data/golden/tuples/expected/lir_02_inlined.txt +5 -5
- data/golden/tuples/expected/lir_03_cse.txt +5 -5
- data/golden/tuples/expected/lir_04_1_loop_fusion.txt +5 -5
- data/golden/tuples/expected/lir_04_loop_invcm.txt +5 -5
- data/golden/tuples/expected/lir_06_const_prop.txt +5 -5
- data/golden/tuples/expected/nast.txt +4 -4
- data/golden/tuples/expected/schema_ruby.rb +1 -1
- data/golden/tuples/expected/snast.txt +6 -6
- data/golden/tuples_and_arrays/expected/lir_00_unoptimized.txt +1 -1
- data/golden/tuples_and_arrays/expected/lir_01_hoist_scalar_references.txt +1 -1
- data/golden/tuples_and_arrays/expected/lir_02_inlined.txt +17 -17
- data/golden/tuples_and_arrays/expected/lir_03_cse.txt +13 -13
- data/golden/tuples_and_arrays/expected/lir_04_1_loop_fusion.txt +13 -13
- data/golden/tuples_and_arrays/expected/lir_04_loop_invcm.txt +13 -13
- data/golden/tuples_and_arrays/expected/lir_06_const_prop.txt +13 -13
- data/golden/tuples_and_arrays/expected/nast.txt +3 -3
- data/golden/tuples_and_arrays/expected/schema_javascript.mjs +13 -13
- data/golden/tuples_and_arrays/expected/schema_ruby.rb +14 -14
- data/golden/tuples_and_arrays/expected/snast.txt +2 -2
- data/golden/us_tax_2024/expected/ast.txt +63 -670
- data/golden/us_tax_2024/expected/input_plan.txt +8 -45
- data/golden/us_tax_2024/expected/lir_00_unoptimized.txt +253 -863
- data/golden/us_tax_2024/expected/lir_01_hoist_scalar_references.txt +253 -863
- data/golden/us_tax_2024/expected/lir_02_inlined.txt +1215 -5139
- data/golden/us_tax_2024/expected/lir_03_cse.txt +587 -2460
- data/golden/us_tax_2024/expected/lir_04_1_loop_fusion.txt +632 -2480
- data/golden/us_tax_2024/expected/lir_04_loop_invcm.txt +587 -2400
- data/golden/us_tax_2024/expected/lir_06_const_prop.txt +587 -2400
- data/golden/us_tax_2024/expected/nast.txt +123 -826
- data/golden/us_tax_2024/expected/schema_javascript.mjs +127 -581
- data/golden/us_tax_2024/expected/schema_ruby.rb +135 -610
- data/golden/us_tax_2024/expected/snast.txt +155 -858
- data/golden/us_tax_2024/expected.json +120 -1
- data/golden/us_tax_2024/input.json +18 -9
- data/golden/us_tax_2024/schema.kumi +48 -178
- data/golden/with_constants/expected/lir_00_unoptimized.txt +1 -1
- data/golden/with_constants/expected/lir_01_hoist_scalar_references.txt +1 -1
- data/golden/with_constants/expected/lir_02_inlined.txt +1 -1
- data/golden/with_constants/expected/lir_03_cse.txt +1 -1
- data/golden/with_constants/expected/lir_04_1_loop_fusion.txt +1 -1
- data/golden/with_constants/expected/lir_04_loop_invcm.txt +1 -1
- data/golden/with_constants/expected/lir_06_const_prop.txt +1 -1
- data/golden/with_constants/expected/nast.txt +2 -2
- data/golden/with_constants/expected/schema_ruby.rb +1 -1
- data/golden/with_constants/expected/snast.txt +2 -2
- data/lib/kumi/analyzer.rb +12 -12
- data/lib/kumi/core/analyzer/passes/formal_constraint_propagator.rb +236 -0
- data/lib/kumi/core/analyzer/passes/input_collector.rb +22 -4
- data/lib/kumi/core/analyzer/passes/lir/inline_declarations_pass.rb +118 -74
- data/lib/kumi/core/analyzer/passes/nast_dimensional_analyzer_pass.rb +64 -18
- data/lib/kumi/core/analyzer/passes/normalize_to_nast_pass.rb +9 -4
- data/lib/kumi/core/analyzer/passes/snast_pass.rb +3 -1
- data/lib/kumi/core/analyzer/passes/unsat_detector.rb +172 -198
- data/lib/kumi/core/error_reporter.rb +36 -1
- data/lib/kumi/core/errors.rb +33 -1
- data/lib/kumi/core/functions/function_spec.rb +5 -4
- data/lib/kumi/core/functions/loader.rb +17 -1
- data/lib/kumi/core/functions/overload_resolver.rb +164 -0
- data/lib/kumi/core/functions/type_error_reporter.rb +118 -0
- data/lib/kumi/core/functions/type_rules.rb +155 -35
- data/lib/kumi/core/types/inference.rb +29 -22
- data/lib/kumi/core/types/normalizer.rb +29 -45
- data/lib/kumi/core/types/validator.rb +16 -27
- data/lib/kumi/core/types/value_objects.rb +116 -0
- data/lib/kumi/core/types.rb +45 -37
- data/lib/kumi/registry_v2/loader.rb +90 -0
- data/lib/kumi/registry_v2.rb +18 -1
- data/lib/kumi/version.rb +1 -1
- metadata +21 -7
- data/lib/kumi/core/analyzer/unsat_constant_evaluator.rb +0 -59
- data/lib/kumi/core/atom_unsat_solver.rb +0 -396
- data/lib/kumi/core/constraint_relationship_solver.rb +0 -641
- data/lib/kumi/core/types/builder.rb +0 -23
- data/lib/kumi/core/types/compatibility.rb +0 -96
- data/lib/kumi/core/types/formatter.rb +0 -26
@@ -1,5 +1,5 @@
|
|
1
1
|
# Autogenerated by Kumi Codegen
|
2
|
-
module Kumi::Compiled::
|
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
|
-
|
70
|
-
t37.each_with_index do |
|
71
|
-
|
72
|
-
acc36 +=
|
73
|
-
|
74
|
-
|
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
|
-
|
77
|
-
|
78
|
-
t24 =
|
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
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
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
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
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 >
|
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
|
-
(
|
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::
|
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::
|
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::
|
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 :
|
3
|
+
(Call :add
|
4
4
|
(InputRef [:x])
|
5
5
|
(InputRef [:y])
|
6
6
|
)
|
7
7
|
)
|
8
8
|
(VALUE product
|
9
|
-
(Call :
|
9
|
+
(Call :multiply
|
10
10
|
(InputRef [:x])
|
11
11
|
(InputRef [:y])
|
12
12
|
)
|
13
13
|
)
|
14
14
|
(VALUE difference
|
15
|
-
(Call :
|
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 :
|
23
|
+
(Call :add
|
24
24
|
(InputRef [:x])
|
25
25
|
(Const 10)
|
26
26
|
)
|
27
|
-
(Call :
|
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::
|
2
|
+
module Kumi::Compiled::KUMI_52c858dd08717cf97edaff33a54004b4af6c064f32453eb33012e14cd18d48c2
|
3
3
|
def self.from(input_data = nil)
|
4
4
|
instance = Object.new
|
5
5
|
instance.extend(self)
|
@@ -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
|
-
%
|
45
|
-
%
|
46
|
-
%
|
47
|
-
%
|
48
|
-
%t29 = select %t51, %t27, %
|
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
|
-
%
|
67
|
-
%
|
68
|
-
%
|
69
|
-
%
|
70
|
-
%acc_36 = acc_add agg.sum(%acc_36, %
|
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
|
-
%
|
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 =
|
93
|
-
%t74 = call core.
|
94
|
-
%
|
95
|
-
%
|
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
|
-
%
|
60
|
-
%
|
61
|
-
%
|
62
|
-
%acc_36 = acc_add agg.sum(%acc_36, %
|
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
|
-
%
|
72
|
-
%
|
73
|
-
%
|
74
|
-
%
|
75
|
-
%
|
76
|
-
%
|
77
|
-
%
|
78
|
-
%
|
79
|
-
%acc_42 = acc_add agg.sum(%acc_42, %
|
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
|
-
%
|
60
|
-
%
|
61
|
-
%
|
62
|
-
%acc_36 = acc_add agg.sum(%acc_36, %
|
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
|
-
%
|
72
|
-
%
|
73
|
-
%
|
74
|
-
%
|
75
|
-
%
|
76
|
-
%
|
77
|
-
%
|
78
|
-
%
|
79
|
-
%acc_42 = acc_add agg.sum(%acc_42, %
|
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
|
-
%
|
60
|
-
%
|
61
|
-
%
|
62
|
-
%acc_36 = acc_add agg.sum(%acc_36, %
|
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
|
-
%
|
71
|
-
%
|
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
|
-
%
|
74
|
-
%
|
75
|
-
%
|
76
|
-
%
|
77
|
-
%
|
78
|
-
%
|
79
|
-
%acc_42 = acc_add agg.sum(%acc_42, %
|
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
|
-
%
|
60
|
-
%
|
61
|
-
%
|
62
|
-
%acc_36 = acc_add agg.sum(%acc_36, %
|
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
|
-
%
|
71
|
-
%
|
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
|
-
%
|
74
|
-
%
|
75
|
-
%
|
76
|
-
%
|
77
|
-
%
|
78
|
-
%
|
79
|
-
%acc_42 = acc_add agg.sum(%acc_42, %
|
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 :
|
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 :
|
9
|
+
(Call :multiply
|
10
10
|
(InputRef [:items, :item, :price])
|
11
|
-
(Call :
|
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 :
|
24
|
+
(Call :select
|
25
25
|
(Ref items_is_big)
|
26
|
-
(Call :
|
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 :
|
34
|
+
(Call :sum
|
35
35
|
(InputRef [:items, :item, :qty])
|
36
36
|
)
|
37
37
|
)
|
38
38
|
(VALUE cart_total
|
39
|
-
(Call :
|
39
|
+
(Call :sum
|
40
40
|
(Ref items_subtotal)
|
41
41
|
)
|
42
42
|
)
|
43
43
|
(VALUE cart_total_effective
|
44
|
-
(Call :
|
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
|
71
|
-
let
|
72
|
-
let
|
73
|
-
acc_36 +=
|
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
|
82
|
-
const
|
81
|
+
const t73 = 100.0;
|
82
|
+
const t67 = 0.9;
|
83
83
|
t43.forEach((items_el_44, items_i_45) => {
|
84
|
-
let
|
85
|
-
let
|
86
|
-
let
|
87
|
-
let
|
88
|
-
let
|
89
|
-
let
|
90
|
-
acc_42 +=
|
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::
|
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
|
-
|
104
|
-
|
105
|
-
|
106
|
-
acc_36 +=
|
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
|
-
|
115
|
-
|
114
|
+
t73 = 100.0
|
115
|
+
t67 = 0.9
|
116
116
|
t43.each_with_index do |items_el_44, items_i_45|
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
acc_42 +=
|
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
|