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,24 +1,24 @@
|
|
1
1
|
(NAST
|
2
2
|
(VALUE x_sq
|
3
|
-
(Call :
|
3
|
+
(Call :multiply
|
4
4
|
(InputRef [:x])
|
5
5
|
(InputRef [:x])
|
6
6
|
)
|
7
7
|
)
|
8
8
|
(VALUE y_sq
|
9
|
-
(Call :
|
9
|
+
(Call :multiply
|
10
10
|
(InputRef [:y])
|
11
11
|
(InputRef [:y])
|
12
12
|
)
|
13
13
|
)
|
14
14
|
(VALUE distance_sq
|
15
|
-
(Call :
|
15
|
+
(Call :add
|
16
16
|
(Ref x_sq)
|
17
17
|
(Ref y_sq)
|
18
18
|
)
|
19
19
|
)
|
20
20
|
(VALUE distance
|
21
|
-
(Call :
|
21
|
+
(Call :power
|
22
22
|
(Ref distance_sq)
|
23
23
|
(Const 0.5)
|
24
24
|
)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Autogenerated by Kumi Codegen
|
2
|
-
module Kumi::Compiled::
|
2
|
+
module Kumi::Compiled::KUMI_85aba5f3d4113870359ea38cf7c574c50d05d66e700b059e3ca9c29e9d07d912
|
3
3
|
def self.from(input_data = nil)
|
4
4
|
instance = Object.new
|
5
5
|
instance.extend(self)
|
@@ -37,25 +37,25 @@
|
|
37
37
|
%t31 = load_input "departments" :: array
|
38
38
|
%acc33 = decl_acc :: integer
|
39
39
|
%t34 = load_field departments_el_25["employees"] :: any
|
40
|
-
loop employees id=L6 in %t34 as el=%
|
41
|
-
%
|
42
|
-
%acc33 = acc_add agg.sum(%acc33, %
|
40
|
+
loop employees id=L6 in %t34 as el=%t35, idx=%t36
|
41
|
+
%t37 = load_field t35["salary"] :: integer
|
42
|
+
%acc33 = acc_add agg.sum(%acc33, %t37) :: integer
|
43
43
|
end_loop
|
44
|
-
%
|
45
|
-
%
|
46
|
-
%
|
47
|
-
%
|
48
|
-
loop employees id=L7 in %
|
49
|
-
%
|
50
|
-
%
|
51
|
-
%
|
52
|
-
%
|
53
|
-
%
|
54
|
-
%
|
55
|
-
%
|
44
|
+
%t38 = acc_load %acc33 :: integer
|
45
|
+
%t39 = load_input "departments" :: array
|
46
|
+
%acc41 = decl_acc :: integer
|
47
|
+
%t42 = load_field departments_el_25["employees"] :: any
|
48
|
+
loop employees id=L7 in %t42 as el=%t43, idx=%t44
|
49
|
+
%t45 = load_field t43["role"] :: string
|
50
|
+
%t46 = const "manager" :: string
|
51
|
+
%t47 = call core.eq(%t45, %t46) :: boolean
|
52
|
+
%t48 = const 1 :: integer
|
53
|
+
%t49 = const 0 :: integer
|
54
|
+
%t50 = select %t47, %t48, %t49 :: integer
|
55
|
+
%acc41 = acc_add agg.sum(%acc41, %t50) :: integer
|
56
56
|
end_loop
|
57
|
-
%
|
58
|
-
%t30 = make_object{name: %t27, total_payroll: %
|
57
|
+
%t51 = acc_load %acc41 :: integer
|
58
|
+
%t30 = make_object{name: %t27, total_payroll: %t38, manager_count: %t51} :: object
|
59
59
|
yield %t30
|
60
60
|
end_loop
|
61
61
|
)
|
@@ -36,21 +36,21 @@
|
|
36
36
|
%t27 = load_field departments_el_25["name"] :: string
|
37
37
|
%acc33 = decl_acc :: integer
|
38
38
|
%t34 = load_field departments_el_25["employees"] :: any
|
39
|
-
%
|
40
|
-
loop employees id=L6 in %t34 as el=%
|
41
|
-
%
|
42
|
-
%acc33 = acc_add agg.sum(%acc33, %
|
43
|
-
%
|
44
|
-
%
|
45
|
-
%
|
46
|
-
%
|
47
|
-
%
|
48
|
-
%
|
49
|
-
%
|
39
|
+
%acc41 = decl_acc :: integer
|
40
|
+
loop employees id=L6 in %t34 as el=%t35, idx=%t36
|
41
|
+
%t37 = load_field t35["salary"] :: integer
|
42
|
+
%acc33 = acc_add agg.sum(%acc33, %t37) :: integer
|
43
|
+
%t45 = load_field t35["role"] :: string
|
44
|
+
%t46 = const "manager" :: string
|
45
|
+
%t47 = call core.eq(%t45, %t46) :: boolean
|
46
|
+
%t48 = const 1 :: integer
|
47
|
+
%t49 = const 0 :: integer
|
48
|
+
%t50 = select %t47, %t48, %t49 :: integer
|
49
|
+
%acc41 = acc_add agg.sum(%acc41, %t50) :: integer
|
50
50
|
end_loop
|
51
|
-
%
|
52
|
-
%
|
53
|
-
%t30 = make_object{name: %t27, total_payroll: %
|
51
|
+
%t38 = acc_load %acc33 :: integer
|
52
|
+
%t51 = acc_load %acc41 :: integer
|
53
|
+
%t30 = make_object{name: %t27, total_payroll: %t38, manager_count: %t51} :: object
|
54
54
|
yield %t30
|
55
55
|
end_loop
|
56
56
|
)
|
@@ -36,21 +36,21 @@
|
|
36
36
|
%t27 = load_field departments_el_25["name"] :: string
|
37
37
|
%acc33 = decl_acc :: integer
|
38
38
|
%t34 = load_field departments_el_25["employees"] :: any
|
39
|
-
%
|
40
|
-
loop employees id=L6 in %t34 as el=%
|
41
|
-
%
|
42
|
-
%acc33 = acc_add agg.sum(%acc33, %
|
43
|
-
%
|
44
|
-
%
|
45
|
-
%
|
46
|
-
%
|
47
|
-
%
|
48
|
-
%
|
49
|
-
%
|
39
|
+
%acc41 = decl_acc :: integer
|
40
|
+
loop employees id=L6 in %t34 as el=%t35, idx=%t36
|
41
|
+
%t37 = load_field t35["salary"] :: integer
|
42
|
+
%acc33 = acc_add agg.sum(%acc33, %t37) :: integer
|
43
|
+
%t45 = load_field t35["role"] :: string
|
44
|
+
%t46 = const "manager" :: string
|
45
|
+
%t47 = call core.eq(%t45, %t46) :: boolean
|
46
|
+
%t48 = const 1 :: integer
|
47
|
+
%t49 = const 0 :: integer
|
48
|
+
%t50 = select %t47, %t48, %t49 :: integer
|
49
|
+
%acc41 = acc_add agg.sum(%acc41, %t50) :: integer
|
50
50
|
end_loop
|
51
|
-
%
|
52
|
-
%
|
53
|
-
%t30 = make_object{name: %t27, total_payroll: %
|
51
|
+
%t38 = acc_load %acc33 :: integer
|
52
|
+
%t51 = acc_load %acc41 :: integer
|
53
|
+
%t30 = make_object{name: %t27, total_payroll: %t38, manager_count: %t51} :: object
|
54
54
|
yield %t30
|
55
55
|
end_loop
|
56
56
|
)
|
@@ -32,25 +32,25 @@
|
|
32
32
|
)
|
33
33
|
(Declaration department_summary
|
34
34
|
%t24 = load_input "departments" :: array
|
35
|
-
%
|
36
|
-
%
|
37
|
-
%
|
35
|
+
%t46 = const "manager" :: string
|
36
|
+
%t48 = const 1 :: integer
|
37
|
+
%t49 = const 0 :: integer
|
38
38
|
loop departments id=L5 in %t24 as el=%departments_el_25, idx=%departments_i_26
|
39
39
|
%t27 = load_field departments_el_25["name"] :: string
|
40
40
|
%acc33 = decl_acc :: integer
|
41
41
|
%t34 = load_field departments_el_25["employees"] :: any
|
42
|
-
%
|
43
|
-
loop employees id=L6 in %t34 as el=%
|
44
|
-
%
|
45
|
-
%acc33 = acc_add agg.sum(%acc33, %
|
46
|
-
%
|
47
|
-
%
|
48
|
-
%
|
49
|
-
%
|
42
|
+
%acc41 = decl_acc :: integer
|
43
|
+
loop employees id=L6 in %t34 as el=%t35, idx=%t36
|
44
|
+
%t37 = load_field t35["salary"] :: integer
|
45
|
+
%acc33 = acc_add agg.sum(%acc33, %t37) :: integer
|
46
|
+
%t45 = load_field t35["role"] :: string
|
47
|
+
%t47 = call core.eq(%t45, %t46) :: boolean
|
48
|
+
%t50 = select %t47, %t48, %t49 :: integer
|
49
|
+
%acc41 = acc_add agg.sum(%acc41, %t50) :: integer
|
50
50
|
end_loop
|
51
|
-
%
|
52
|
-
%
|
53
|
-
%t30 = make_object{name: %t27, total_payroll: %
|
51
|
+
%t38 = acc_load %acc33 :: integer
|
52
|
+
%t51 = acc_load %acc41 :: integer
|
53
|
+
%t30 = make_object{name: %t27, total_payroll: %t38, manager_count: %t51} :: object
|
54
54
|
yield %t30
|
55
55
|
end_loop
|
56
56
|
)
|
@@ -32,25 +32,25 @@
|
|
32
32
|
)
|
33
33
|
(Declaration department_summary
|
34
34
|
%t24 = load_input "departments" :: array
|
35
|
-
%
|
36
|
-
%
|
37
|
-
%
|
35
|
+
%t46 = const "manager" :: string
|
36
|
+
%t48 = const 1 :: integer
|
37
|
+
%t49 = const 0 :: integer
|
38
38
|
loop departments id=L5 in %t24 as el=%departments_el_25, idx=%departments_i_26
|
39
39
|
%t27 = load_field departments_el_25["name"] :: string
|
40
40
|
%acc33 = decl_acc :: integer
|
41
41
|
%t34 = load_field departments_el_25["employees"] :: any
|
42
|
-
%
|
43
|
-
loop employees id=L6 in %t34 as el=%
|
44
|
-
%
|
45
|
-
%acc33 = acc_add agg.sum(%acc33, %
|
46
|
-
%
|
47
|
-
%
|
48
|
-
%
|
49
|
-
%
|
42
|
+
%acc41 = decl_acc :: integer
|
43
|
+
loop employees id=L6 in %t34 as el=%t35, idx=%t36
|
44
|
+
%t37 = load_field t35["salary"] :: integer
|
45
|
+
%acc33 = acc_add agg.sum(%acc33, %t37) :: integer
|
46
|
+
%t45 = load_field t35["role"] :: string
|
47
|
+
%t47 = call core.eq(%t45, %t46) :: boolean
|
48
|
+
%t50 = select %t47, %t48, %t49 :: integer
|
49
|
+
%acc41 = acc_add agg.sum(%acc41, %t50) :: integer
|
50
50
|
end_loop
|
51
|
-
%
|
52
|
-
%
|
53
|
-
%t30 = make_object{name: %t27, total_payroll: %
|
51
|
+
%t38 = acc_load %acc33 :: integer
|
52
|
+
%t51 = acc_load %acc41 :: integer
|
53
|
+
%t30 = make_object{name: %t27, total_payroll: %t38, manager_count: %t51} :: object
|
54
54
|
yield %t30
|
55
55
|
end_loop
|
56
56
|
)
|
@@ -36,26 +36,26 @@ export function _manager_count(input) {
|
|
36
36
|
export function _department_summary(input) {
|
37
37
|
let out = [];
|
38
38
|
let t24 = input["departments"];
|
39
|
-
const
|
40
|
-
const
|
41
|
-
const
|
39
|
+
const t46 = "manager";
|
40
|
+
const t48 = 1;
|
41
|
+
const t49 = 0;
|
42
42
|
t24.forEach((departments_el_25, departments_i_26) => {
|
43
43
|
let t27 = departments_el_25["name"];
|
44
44
|
let acc33 = 0;
|
45
45
|
let t34 = departments_el_25["employees"];
|
46
|
-
let
|
47
|
-
t34.forEach((
|
48
|
-
let
|
49
|
-
acc33 +=
|
50
|
-
let
|
51
|
-
let
|
52
|
-
let
|
53
|
-
|
46
|
+
let acc41 = 0;
|
47
|
+
t34.forEach((t35, t36) => {
|
48
|
+
let t37 = t35["salary"];
|
49
|
+
acc33 += t37;
|
50
|
+
let t45 = t35["role"];
|
51
|
+
let t47 = t45 == t46;
|
52
|
+
let t50 = t47 ? t48 : t49;
|
53
|
+
acc41 += t50;
|
54
54
|
});
|
55
55
|
let t30 = {
|
56
56
|
"name": t27,
|
57
57
|
"total_payroll": acc33,
|
58
|
-
"manager_count":
|
58
|
+
"manager_count": acc41
|
59
59
|
};
|
60
60
|
out.push(t30);
|
61
61
|
});
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Autogenerated by Kumi Codegen
|
2
|
-
module Kumi::Compiled::
|
2
|
+
module Kumi::Compiled::KUMI_98bd6dd93ae6e80222b0a6d353bac6cc887e2b20924bf5e5cfc392e9aa0b705a
|
3
3
|
def self.from(input_data = nil)
|
4
4
|
instance = Object.new
|
5
5
|
instance.extend(self)
|
@@ -67,28 +67,28 @@ module Kumi::Compiled::KUMI_336c6ae90c9ed351f0bb7257fc77debf7b18d4e0f96efd6da3ff
|
|
67
67
|
def _department_summary(input = @input)
|
68
68
|
out = []
|
69
69
|
t24 = input["departments"] || input[:departments]
|
70
|
-
|
71
|
-
|
72
|
-
|
70
|
+
t46 = "manager"
|
71
|
+
t48 = 1
|
72
|
+
t49 = 0
|
73
73
|
t24.each_with_index do |departments_el_25, departments_i_26|
|
74
74
|
t27 = departments_el_25["name"] || departments_el_25[:name]
|
75
75
|
acc33 = 0
|
76
76
|
t34 = departments_el_25["employees"] || departments_el_25[:employees]
|
77
|
-
|
78
|
-
t34.each_with_index do |
|
79
|
-
|
80
|
-
acc33 +=
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
77
|
+
acc41 = 0
|
78
|
+
t34.each_with_index do |t35, t36|
|
79
|
+
t37 = t35["salary"] || t35[:salary]
|
80
|
+
acc33 += t37
|
81
|
+
t45 = t35["role"] || t35[:role]
|
82
|
+
t47 = t45 == t46
|
83
|
+
t50 = t47 ? t48 : t49
|
84
|
+
acc41 += t50
|
85
85
|
end
|
86
|
-
|
87
|
-
|
86
|
+
t38 = acc33
|
87
|
+
t51 = acc41
|
88
88
|
t30 = {
|
89
89
|
"name" => t27,
|
90
|
-
"total_payroll" =>
|
91
|
-
"manager_count" =>
|
90
|
+
"total_payroll" => t38,
|
91
|
+
"manager_count" => t51
|
92
92
|
}
|
93
93
|
out << t30
|
94
94
|
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
(NAST
|
2
2
|
(VALUE dept_total
|
3
|
-
(Call :
|
3
|
+
(Call :sum
|
4
4
|
(InputRef [:depts, :dept, :teams, :team, :headcount])
|
5
5
|
)
|
6
6
|
)
|
7
7
|
(VALUE company_total
|
8
|
-
(Call :
|
9
|
-
(Call :
|
8
|
+
(Call :sum
|
9
|
+
(Call :sum
|
10
10
|
(InputRef [:depts, :dept, :teams, :team, :headcount])
|
11
11
|
)
|
12
12
|
)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Autogenerated by Kumi Codegen
|
2
|
-
module Kumi::Compiled::
|
2
|
+
module Kumi::Compiled::KUMI_4d50da3cac1cc57f195f70b5a33c49b41a4b90846c1536c3d767df15b5c72b7a
|
3
3
|
def self.from(input_data = nil)
|
4
4
|
instance = Object.new
|
5
5
|
instance.extend(self)
|
@@ -26,17 +26,17 @@
|
|
26
26
|
%t16 = load_input "matrix" :: array
|
27
27
|
%acc28 = decl_acc :: integer
|
28
28
|
%t29 = load_input "numbers" :: array
|
29
|
-
loop numbers id=L6 in %t29 as el=%
|
30
|
-
%
|
31
|
-
%acc28 = acc_add agg.sum(%acc28, %
|
29
|
+
loop numbers id=L6 in %t29 as el=%t30, idx=%t31
|
30
|
+
%t32 = load_field t30["value"] :: integer
|
31
|
+
%acc28 = acc_add agg.sum(%acc28, %t32) :: integer
|
32
32
|
end_loop
|
33
|
-
%
|
33
|
+
%t33 = acc_load %acc28 :: integer
|
34
34
|
loop matrix id=L4 in %t16 as el=%matrix_el_17, idx=%matrix_i_18
|
35
35
|
%t19 = load_field matrix_el_17["row"] :: any
|
36
36
|
loop row id=L5 in %t19 as el=%row_el_20, idx=%row_i_21
|
37
37
|
%t22 = load_input "scalar_val" :: integer
|
38
38
|
%t24 = load_field row_el_20["cell"] :: float
|
39
|
-
%t25 = make_tuple(%t22, %
|
39
|
+
%t25 = make_tuple(%t22, %t33, %t24) :: tuple<integer, integer, float>
|
40
40
|
yield %t25
|
41
41
|
end_loop
|
42
42
|
end_loop
|
@@ -26,17 +26,17 @@
|
|
26
26
|
%t16 = load_input "matrix" :: array
|
27
27
|
%acc28 = decl_acc :: integer
|
28
28
|
%t29 = load_input "numbers" :: array
|
29
|
-
loop numbers id=L6 in %t29 as el=%
|
30
|
-
%
|
31
|
-
%acc28 = acc_add agg.sum(%acc28, %
|
29
|
+
loop numbers id=L6 in %t29 as el=%t30, idx=%t31
|
30
|
+
%t32 = load_field t30["value"] :: integer
|
31
|
+
%acc28 = acc_add agg.sum(%acc28, %t32) :: integer
|
32
32
|
end_loop
|
33
|
-
%
|
33
|
+
%t33 = acc_load %acc28 :: integer
|
34
34
|
loop matrix id=L4 in %t16 as el=%matrix_el_17, idx=%matrix_i_18
|
35
35
|
%t19 = load_field matrix_el_17["row"] :: any
|
36
36
|
loop row id=L5 in %t19 as el=%row_el_20, idx=%row_i_21
|
37
37
|
%t22 = load_input "scalar_val" :: integer
|
38
38
|
%t24 = load_field row_el_20["cell"] :: float
|
39
|
-
%t25 = make_tuple(%t22, %
|
39
|
+
%t25 = make_tuple(%t22, %t33, %t24) :: tuple<integer, integer, float>
|
40
40
|
yield %t25
|
41
41
|
end_loop
|
42
42
|
end_loop
|
@@ -26,17 +26,17 @@
|
|
26
26
|
%t16 = load_input "matrix" :: array
|
27
27
|
%acc28 = decl_acc :: integer
|
28
28
|
%t29 = load_input "numbers" :: array
|
29
|
-
loop numbers id=L6 in %t29 as el=%
|
30
|
-
%
|
31
|
-
%acc28 = acc_add agg.sum(%acc28, %
|
29
|
+
loop numbers id=L6 in %t29 as el=%t30, idx=%t31
|
30
|
+
%t32 = load_field t30["value"] :: integer
|
31
|
+
%acc28 = acc_add agg.sum(%acc28, %t32) :: integer
|
32
32
|
end_loop
|
33
|
-
%
|
33
|
+
%t33 = acc_load %acc28 :: integer
|
34
34
|
loop matrix id=L4 in %t16 as el=%matrix_el_17, idx=%matrix_i_18
|
35
35
|
%t19 = load_field matrix_el_17["row"] :: any
|
36
36
|
loop row id=L5 in %t19 as el=%row_el_20, idx=%row_i_21
|
37
37
|
%t22 = load_input "scalar_val" :: integer
|
38
38
|
%t24 = load_field row_el_20["cell"] :: float
|
39
|
-
%t25 = make_tuple(%t22, %
|
39
|
+
%t25 = make_tuple(%t22, %t33, %t24) :: tuple<integer, integer, float>
|
40
40
|
yield %t25
|
41
41
|
end_loop
|
42
42
|
end_loop
|
@@ -26,17 +26,17 @@
|
|
26
26
|
%t16 = load_input "matrix" :: array
|
27
27
|
%acc28 = decl_acc :: integer
|
28
28
|
%t29 = load_input "numbers" :: array
|
29
|
-
loop numbers id=L6 in %t29 as el=%
|
30
|
-
%
|
31
|
-
%acc28 = acc_add agg.sum(%acc28, %
|
29
|
+
loop numbers id=L6 in %t29 as el=%t30, idx=%t31
|
30
|
+
%t32 = load_field t30["value"] :: integer
|
31
|
+
%acc28 = acc_add agg.sum(%acc28, %t32) :: integer
|
32
32
|
end_loop
|
33
|
-
%
|
33
|
+
%t33 = acc_load %acc28 :: integer
|
34
34
|
%t22 = load_input "scalar_val" :: integer
|
35
35
|
loop matrix id=L4 in %t16 as el=%matrix_el_17, idx=%matrix_i_18
|
36
36
|
%t19 = load_field matrix_el_17["row"] :: any
|
37
37
|
loop row id=L5 in %t19 as el=%row_el_20, idx=%row_i_21
|
38
38
|
%t24 = load_field row_el_20["cell"] :: float
|
39
|
-
%t25 = make_tuple(%t22, %
|
39
|
+
%t25 = make_tuple(%t22, %t33, %t24) :: tuple<integer, integer, float>
|
40
40
|
yield %t25
|
41
41
|
end_loop
|
42
42
|
end_loop
|
@@ -26,17 +26,17 @@
|
|
26
26
|
%t16 = load_input "matrix" :: array
|
27
27
|
%acc28 = decl_acc :: integer
|
28
28
|
%t29 = load_input "numbers" :: array
|
29
|
-
loop numbers id=L6 in %t29 as el=%
|
30
|
-
%
|
31
|
-
%acc28 = acc_add agg.sum(%acc28, %
|
29
|
+
loop numbers id=L6 in %t29 as el=%t30, idx=%t31
|
30
|
+
%t32 = load_field t30["value"] :: integer
|
31
|
+
%acc28 = acc_add agg.sum(%acc28, %t32) :: integer
|
32
32
|
end_loop
|
33
|
-
%
|
33
|
+
%t33 = acc_load %acc28 :: integer
|
34
34
|
%t22 = load_input "scalar_val" :: integer
|
35
35
|
loop matrix id=L4 in %t16 as el=%matrix_el_17, idx=%matrix_i_18
|
36
36
|
%t19 = load_field matrix_el_17["row"] :: any
|
37
37
|
loop row id=L5 in %t19 as el=%row_el_20, idx=%row_i_21
|
38
38
|
%t24 = load_field row_el_20["cell"] :: float
|
39
|
-
%t25 = make_tuple(%t22, %
|
39
|
+
%t25 = make_tuple(%t22, %t33, %t24) :: tuple<integer, integer, float>
|
40
40
|
yield %t25
|
41
41
|
end_loop
|
42
42
|
end_loop
|
@@ -28,9 +28,9 @@ export function _mixed_array(input) {
|
|
28
28
|
let t16 = input["matrix"];
|
29
29
|
let acc28 = 0;
|
30
30
|
let t29 = input["numbers"];
|
31
|
-
t29.forEach((
|
32
|
-
let
|
33
|
-
acc28 +=
|
31
|
+
t29.forEach((t30, t31) => {
|
32
|
+
let t32 = t30["value"];
|
33
|
+
acc28 += t32;
|
34
34
|
});
|
35
35
|
let t22 = input["scalar_val"];
|
36
36
|
t16.forEach((matrix_el_17, matrix_i_18) => {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Autogenerated by Kumi Codegen
|
2
|
-
module Kumi::Compiled::
|
2
|
+
module Kumi::Compiled::KUMI_1563f579d65b5974c509af83b7aa99b8e340adf9ec2406de43d1f6278a76a50e
|
3
3
|
def self.from(input_data = nil)
|
4
4
|
instance = Object.new
|
5
5
|
instance.extend(self)
|
@@ -59,18 +59,18 @@ module Kumi::Compiled::KUMI_f287fabc5c73178904b2d2c681872bb3b1319afebf27a33602b6
|
|
59
59
|
t16 = input["matrix"] || input[:matrix]
|
60
60
|
acc28 = 0
|
61
61
|
t29 = input["numbers"] || input[:numbers]
|
62
|
-
t29.each_with_index do |
|
63
|
-
|
64
|
-
acc28 +=
|
62
|
+
t29.each_with_index do |t30, t31|
|
63
|
+
t32 = t30["value"] || t30[:value]
|
64
|
+
acc28 += t32
|
65
65
|
end
|
66
|
-
|
66
|
+
t33 = acc28
|
67
67
|
t22 = input["scalar_val"] || input[:scalar_val]
|
68
68
|
t16.each_with_index do |matrix_el_17, matrix_i_18|
|
69
69
|
out_1 = []
|
70
70
|
t19 = matrix_el_17["row"] || matrix_el_17[:row]
|
71
71
|
t19.each_with_index do |row_el_20, row_i_21|
|
72
72
|
t24 = row_el_20["cell"] || row_el_20[:cell]
|
73
|
-
t25 = [t22,
|
73
|
+
t25 = [t22, t33, t24]
|
74
74
|
out_1 << t25
|
75
75
|
end
|
76
76
|
out << out_1
|