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_1a4593b5476e9c7cc85dedf77f0d089845a959e9f9031f5838efaf26e3bc5486
|
3
3
|
def self.from(input_data = nil)
|
4
4
|
instance = Object.new
|
5
5
|
instance.extend(self)
|
@@ -121,9 +121,9 @@ module Kumi::Compiled::KUMI_c432011fb1d3ae36f896bdc610664fb1e3aed88af214541fcb7f
|
|
121
121
|
t49 = offices_el_47["teams"] || offices_el_47[:teams]
|
122
122
|
t49.each_with_index do |teams_el_50, teams_i_51|
|
123
123
|
out_3 = []
|
124
|
-
t52 = teams_el_50["employees"] || teams_el_50[:employees]
|
125
124
|
t91 = teams_el_50["performance_score"] || teams_el_50[:performance_score]
|
126
125
|
t93 = t91 >= t92
|
126
|
+
t52 = teams_el_50["employees"] || teams_el_50[:employees]
|
127
127
|
t52.each_with_index do |employees_el_53, employees_i_54|
|
128
128
|
t78 = employees_el_53["rating"] || employees_el_53[:rating]
|
129
129
|
t80 = t78 >= t79
|
@@ -1,17 +1,17 @@
|
|
1
1
|
(SNAST
|
2
|
-
(
|
2
|
+
(VALUE high_performer
|
3
3
|
(Call :core.gte
|
4
4
|
(InputRef regions.region.offices.office.teams.team.employees.employee.rating key_chain=[]) :: [regions, offices, teams, employees] -> float
|
5
5
|
(Const 4.5) :: [] -> float
|
6
6
|
) :: [regions, offices, teams, employees] -> boolean
|
7
7
|
) :: [regions, offices, teams, employees] -> boolean
|
8
|
-
(
|
8
|
+
(VALUE senior_level
|
9
9
|
(Call :core.eq
|
10
10
|
(InputRef regions.region.offices.office.teams.team.employees.employee.level key_chain=[]) :: [regions, offices, teams, employees] -> string
|
11
11
|
(Const "senior") :: [] -> string
|
12
12
|
) :: [regions, offices, teams, employees] -> boolean
|
13
13
|
) :: [regions, offices, teams, employees] -> boolean
|
14
|
-
(
|
14
|
+
(VALUE top_team
|
15
15
|
(Call :core.gte
|
16
16
|
(InputRef regions.region.offices.office.teams.team.performance_score key_chain=[]) :: [regions, offices, teams] -> float
|
17
17
|
(Const 0.9) :: [] -> float
|
@@ -1,16 +1,16 @@
|
|
1
1
|
(NAST
|
2
2
|
(VALUE sum_x
|
3
|
-
(Call :
|
3
|
+
(Call :sum
|
4
4
|
(InputRef [:xs, :el, :v])
|
5
5
|
)
|
6
6
|
)
|
7
7
|
(VALUE sum_y
|
8
|
-
(Call :
|
8
|
+
(Call :sum
|
9
9
|
(InputRef [:ys, :el, :v])
|
10
10
|
)
|
11
11
|
)
|
12
12
|
(VALUE tail
|
13
|
-
(Call :
|
13
|
+
(Call :add
|
14
14
|
(Const 7.0)
|
15
15
|
(Const 5.0)
|
16
16
|
)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Autogenerated by Kumi Codegen
|
2
|
-
module Kumi::Compiled::
|
2
|
+
module Kumi::Compiled::KUMI_148f63c5601013e142e410da768bff3a0570a673ed771762348612e71bedced6
|
3
3
|
def self.from(input_data = nil)
|
4
4
|
instance = Object.new
|
5
5
|
instance.extend(self)
|
@@ -9,12 +9,12 @@
|
|
9
9
|
(InputRef [:config, :servers, :server, :hostname])
|
10
10
|
)
|
11
11
|
(VALUE server_count
|
12
|
-
(Call :
|
12
|
+
(Call :array_size
|
13
13
|
(InputRef [:config, :servers])
|
14
14
|
)
|
15
15
|
)
|
16
16
|
(VALUE total_ports
|
17
|
-
(Call :
|
17
|
+
(Call :sum
|
18
18
|
(InputRef [:config, :servers, :server, :port])
|
19
19
|
)
|
20
20
|
)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Autogenerated by Kumi Codegen
|
2
|
-
module Kumi::Compiled::
|
2
|
+
module Kumi::Compiled::KUMI_fed43480c1728be2102a0f4594e980fcf8558d62874f4f96c32d502b00ea16ae
|
3
3
|
def self.from(input_data = nil)
|
4
4
|
instance = Object.new
|
5
5
|
instance.extend(self)
|
@@ -18,13 +18,13 @@
|
|
18
18
|
%t38 = load_input "departments" :: array
|
19
19
|
%acc40 = decl_acc :: integer
|
20
20
|
%t41 = load_field departments_el_11["employees"] :: any
|
21
|
-
loop employees id=L7 in %t41 as el=%
|
22
|
-
%
|
23
|
-
%acc40 = acc_add agg.sum(%acc40, %
|
21
|
+
loop employees id=L7 in %t41 as el=%t42, idx=%t43
|
22
|
+
%t44 = load_field t42["salary"] :: integer
|
23
|
+
%acc40 = acc_add agg.sum(%acc40, %t44) :: integer
|
24
24
|
end_loop
|
25
|
-
%
|
25
|
+
%t45 = acc_load %acc40 :: integer
|
26
26
|
%t14 = const 0.15 :: float
|
27
|
-
%t15 = call core.mul(%
|
27
|
+
%t15 = call core.mul(%t45, %t14) :: float
|
28
28
|
yield %t15
|
29
29
|
end_loop
|
30
30
|
)
|
@@ -50,39 +50,39 @@
|
|
50
50
|
%t30 = load_input "departments" :: array
|
51
51
|
loop departments id=L6 in %t30 as el=%departments_el_31, idx=%departments_i_32
|
52
52
|
%t33 = load_field departments_el_31["name"] :: string
|
53
|
-
%
|
54
|
-
%
|
55
|
-
%
|
56
|
-
loop employees id=L8 in %
|
57
|
-
%
|
58
|
-
%
|
53
|
+
%t46 = load_input "departments" :: array
|
54
|
+
%acc48 = decl_acc :: integer
|
55
|
+
%t49 = load_field departments_el_31["employees"] :: any
|
56
|
+
loop employees id=L8 in %t49 as el=%t50, idx=%t51
|
57
|
+
%t52 = load_field t50["salary"] :: integer
|
58
|
+
%acc48 = acc_add agg.sum(%acc48, %t52) :: integer
|
59
59
|
end_loop
|
60
|
-
%
|
61
|
-
%t50 = load_input "departments" :: array
|
62
|
-
%t65 = load_input "departments" :: array
|
63
|
-
%acc67 = decl_acc :: integer
|
64
|
-
%t68 = load_field departments_el_31["employees"] :: any
|
65
|
-
loop employees id=L10 in %t68 as el=%employees_el_6, idx=%employees_i_7
|
66
|
-
%t69 = load_field employees_el_6["salary"] :: integer
|
67
|
-
%acc67 = acc_add agg.sum(%acc67, %t69) :: integer
|
68
|
-
end_loop
|
69
|
-
%t70 = acc_load %acc67 :: integer
|
70
|
-
%t52 = const 0.15 :: float
|
71
|
-
%t53 = call core.mul(%t70, %t52) :: float
|
60
|
+
%t53 = acc_load %acc48 :: integer
|
72
61
|
%t54 = load_input "departments" :: array
|
73
|
-
%
|
74
|
-
%
|
75
|
-
|
76
|
-
|
77
|
-
%
|
78
|
-
%
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
62
|
+
%t58 = load_input "departments" :: array
|
63
|
+
%acc60 = decl_acc :: integer
|
64
|
+
%t61 = load_field departments_el_31["employees"] :: any
|
65
|
+
loop employees id=L9 in %t61 as el=%t62, idx=%t63
|
66
|
+
%t64 = load_field t62["salary"] :: integer
|
67
|
+
%acc60 = acc_add agg.sum(%acc60, %t64) :: integer
|
68
|
+
end_loop
|
69
|
+
%t65 = acc_load %acc60 :: integer
|
70
|
+
%t56 = const 0.15 :: float
|
71
|
+
%t57 = call core.mul(%t65, %t56) :: float
|
72
|
+
%t66 = load_input "departments" :: array
|
73
|
+
%acc68 = decl_acc :: integer
|
74
|
+
%t69 = load_field departments_el_31["employees"] :: any
|
75
|
+
loop employees id=L10 in %t69 as el=%t70, idx=%t71
|
76
|
+
%t72 = load_field t70["role"] :: string
|
77
|
+
%t73 = const "manager" :: string
|
78
|
+
%t74 = call core.eq(%t72, %t73) :: boolean
|
79
|
+
%t75 = const 1 :: integer
|
80
|
+
%t76 = const 0 :: integer
|
81
|
+
%t77 = select %t74, %t75, %t76 :: integer
|
82
|
+
%acc68 = acc_add agg.sum(%acc68, %t77) :: integer
|
83
83
|
end_loop
|
84
|
-
%
|
85
|
-
%t37 = make_object{name: %t33, payroll: %
|
84
|
+
%t78 = acc_load %acc68 :: integer
|
85
|
+
%t37 = make_object{name: %t33, payroll: %t53, tax: %t57, managers: %t78} :: object
|
86
86
|
yield %t37
|
87
87
|
end_loop
|
88
88
|
)
|
@@ -18,12 +18,12 @@
|
|
18
18
|
%acc40 = decl_acc :: integer
|
19
19
|
%t41 = load_field departments_el_11["employees"] :: any
|
20
20
|
%t14 = const 0.15 :: float
|
21
|
-
loop employees id=L7 in %t41 as el=%
|
22
|
-
%
|
23
|
-
%acc40 = acc_add agg.sum(%acc40, %
|
21
|
+
loop employees id=L7 in %t41 as el=%t42, idx=%t43
|
22
|
+
%t44 = load_field t42["salary"] :: integer
|
23
|
+
%acc40 = acc_add agg.sum(%acc40, %t44) :: integer
|
24
24
|
end_loop
|
25
|
-
%
|
26
|
-
%t15 = call core.mul(%
|
25
|
+
%t45 = acc_load %acc40 :: integer
|
26
|
+
%t15 = call core.mul(%t45, %t14) :: float
|
27
27
|
yield %t15
|
28
28
|
end_loop
|
29
29
|
)
|
@@ -49,28 +49,28 @@
|
|
49
49
|
%t30 = load_input "departments" :: array
|
50
50
|
loop departments id=L6 in %t30 as el=%departments_el_31, idx=%departments_i_32
|
51
51
|
%t33 = load_field departments_el_31["name"] :: string
|
52
|
-
%
|
53
|
-
%
|
54
|
-
%
|
55
|
-
%
|
56
|
-
%
|
57
|
-
loop employees id=L8 in %
|
58
|
-
%
|
59
|
-
%
|
60
|
-
%
|
61
|
-
%
|
62
|
-
%
|
63
|
-
%
|
64
|
-
%
|
65
|
-
%
|
66
|
-
%
|
67
|
-
%
|
52
|
+
%acc48 = decl_acc :: integer
|
53
|
+
%t49 = load_field departments_el_31["employees"] :: any
|
54
|
+
%acc60 = decl_acc :: integer
|
55
|
+
%t56 = const 0.15 :: float
|
56
|
+
%acc68 = decl_acc :: integer
|
57
|
+
loop employees id=L8 in %t49 as el=%t50, idx=%t51
|
58
|
+
%t52 = load_field t50["salary"] :: integer
|
59
|
+
%acc48 = acc_add agg.sum(%acc48, %t52) :: integer
|
60
|
+
%acc60 = acc_add agg.sum(%acc60, %t52) :: integer
|
61
|
+
%t72 = load_field t50["role"] :: string
|
62
|
+
%t73 = const "manager" :: string
|
63
|
+
%t74 = call core.eq(%t72, %t73) :: boolean
|
64
|
+
%t75 = const 1 :: integer
|
65
|
+
%t76 = const 0 :: integer
|
66
|
+
%t77 = select %t74, %t75, %t76 :: integer
|
67
|
+
%acc68 = acc_add agg.sum(%acc68, %t77) :: integer
|
68
68
|
end_loop
|
69
|
-
%
|
70
|
-
%
|
71
|
-
%
|
72
|
-
%
|
73
|
-
%t37 = make_object{name: %t33, payroll: %
|
69
|
+
%t53 = acc_load %acc48 :: integer
|
70
|
+
%t65 = acc_load %acc60 :: integer
|
71
|
+
%t78 = acc_load %acc68 :: integer
|
72
|
+
%t57 = call core.mul(%t65, %t56) :: float
|
73
|
+
%t37 = make_object{name: %t33, payroll: %t53, tax: %t57, managers: %t78} :: object
|
74
74
|
yield %t37
|
75
75
|
end_loop
|
76
76
|
)
|
@@ -18,12 +18,12 @@
|
|
18
18
|
%acc40 = decl_acc :: integer
|
19
19
|
%t41 = load_field departments_el_11["employees"] :: any
|
20
20
|
%t14 = const 0.15 :: float
|
21
|
-
loop employees id=L7 in %t41 as el=%
|
22
|
-
%
|
23
|
-
%acc40 = acc_add agg.sum(%acc40, %
|
21
|
+
loop employees id=L7 in %t41 as el=%t42, idx=%t43
|
22
|
+
%t44 = load_field t42["salary"] :: integer
|
23
|
+
%acc40 = acc_add agg.sum(%acc40, %t44) :: integer
|
24
24
|
end_loop
|
25
|
-
%
|
26
|
-
%t15 = call core.mul(%
|
25
|
+
%t45 = acc_load %acc40 :: integer
|
26
|
+
%t15 = call core.mul(%t45, %t14) :: float
|
27
27
|
yield %t15
|
28
28
|
end_loop
|
29
29
|
)
|
@@ -49,28 +49,29 @@
|
|
49
49
|
%t30 = load_input "departments" :: array
|
50
50
|
loop departments id=L6 in %t30 as el=%departments_el_31, idx=%departments_i_32
|
51
51
|
%t33 = load_field departments_el_31["name"] :: string
|
52
|
-
%
|
53
|
-
%
|
54
|
-
%
|
55
|
-
%
|
56
|
-
%
|
57
|
-
loop employees id=L8 in %
|
58
|
-
%
|
59
|
-
%
|
60
|
-
%
|
61
|
-
%
|
62
|
-
%
|
63
|
-
%
|
64
|
-
%
|
65
|
-
%
|
66
|
-
%
|
67
|
-
%
|
52
|
+
%acc48 = decl_acc :: integer
|
53
|
+
%t49 = load_field departments_el_31["employees"] :: any
|
54
|
+
%acc60 = decl_acc :: integer
|
55
|
+
%t56 = const 0.15 :: float
|
56
|
+
%acc68 = decl_acc :: integer
|
57
|
+
loop employees id=L8 in %t49 as el=%t50, idx=%t51
|
58
|
+
%t52 = load_field t50["salary"] :: integer
|
59
|
+
%acc48 = acc_add agg.sum(%acc48, %t52) :: integer
|
60
|
+
%t64 = load_field t50["salary"] :: integer
|
61
|
+
%acc60 = acc_add agg.sum(%acc60, %t64) :: integer
|
62
|
+
%t72 = load_field t50["role"] :: string
|
63
|
+
%t73 = const "manager" :: string
|
64
|
+
%t74 = call core.eq(%t72, %t73) :: boolean
|
65
|
+
%t75 = const 1 :: integer
|
66
|
+
%t76 = const 0 :: integer
|
67
|
+
%t77 = select %t74, %t75, %t76 :: integer
|
68
|
+
%acc68 = acc_add agg.sum(%acc68, %t77) :: integer
|
68
69
|
end_loop
|
69
|
-
%
|
70
|
-
%
|
71
|
-
%
|
72
|
-
%
|
73
|
-
%t37 = make_object{name: %t33, payroll: %
|
70
|
+
%t53 = acc_load %acc48 :: integer
|
71
|
+
%t65 = acc_load %acc60 :: integer
|
72
|
+
%t78 = acc_load %acc68 :: integer
|
73
|
+
%t57 = call core.mul(%t65, %t56) :: float
|
74
|
+
%t37 = make_object{name: %t33, payroll: %t53, tax: %t57, managers: %t78} :: object
|
74
75
|
yield %t37
|
75
76
|
end_loop
|
76
77
|
)
|
@@ -18,12 +18,12 @@
|
|
18
18
|
loop departments id=L3 in %t10 as el=%departments_el_11, idx=%departments_i_12
|
19
19
|
%acc40 = decl_acc :: integer
|
20
20
|
%t41 = load_field departments_el_11["employees"] :: any
|
21
|
-
loop employees id=L7 in %t41 as el=%
|
22
|
-
%
|
23
|
-
%acc40 = acc_add agg.sum(%acc40, %
|
21
|
+
loop employees id=L7 in %t41 as el=%t42, idx=%t43
|
22
|
+
%t44 = load_field t42["salary"] :: integer
|
23
|
+
%acc40 = acc_add agg.sum(%acc40, %t44) :: integer
|
24
24
|
end_loop
|
25
|
-
%
|
26
|
-
%t15 = call core.mul(%
|
25
|
+
%t45 = acc_load %acc40 :: integer
|
26
|
+
%t15 = call core.mul(%t45, %t14) :: float
|
27
27
|
yield %t15
|
28
28
|
end_loop
|
29
29
|
)
|
@@ -47,30 +47,30 @@
|
|
47
47
|
)
|
48
48
|
(Declaration department_summary
|
49
49
|
%t30 = load_input "departments" :: array
|
50
|
-
%
|
51
|
-
%
|
52
|
-
%
|
53
|
-
%
|
50
|
+
%t56 = const 0.15 :: float
|
51
|
+
%t73 = const "manager" :: string
|
52
|
+
%t75 = const 1 :: integer
|
53
|
+
%t76 = const 0 :: integer
|
54
54
|
loop departments id=L6 in %t30 as el=%departments_el_31, idx=%departments_i_32
|
55
55
|
%t33 = load_field departments_el_31["name"] :: string
|
56
|
-
%
|
57
|
-
%
|
58
|
-
%
|
59
|
-
%
|
60
|
-
loop employees id=L8 in %
|
61
|
-
%
|
62
|
-
%
|
63
|
-
%
|
64
|
-
%
|
65
|
-
%
|
66
|
-
%
|
67
|
-
%
|
56
|
+
%acc48 = decl_acc :: integer
|
57
|
+
%t49 = load_field departments_el_31["employees"] :: any
|
58
|
+
%acc60 = decl_acc :: integer
|
59
|
+
%acc68 = decl_acc :: integer
|
60
|
+
loop employees id=L8 in %t49 as el=%t50, idx=%t51
|
61
|
+
%t52 = load_field t50["salary"] :: integer
|
62
|
+
%acc48 = acc_add agg.sum(%acc48, %t52) :: integer
|
63
|
+
%acc60 = acc_add agg.sum(%acc60, %t52) :: integer
|
64
|
+
%t72 = load_field t50["role"] :: string
|
65
|
+
%t74 = call core.eq(%t72, %t73) :: boolean
|
66
|
+
%t77 = select %t74, %t75, %t76 :: integer
|
67
|
+
%acc68 = acc_add agg.sum(%acc68, %t77) :: integer
|
68
68
|
end_loop
|
69
|
-
%
|
70
|
-
%
|
71
|
-
%
|
72
|
-
%
|
73
|
-
%t37 = make_object{name: %t33, payroll: %
|
69
|
+
%t53 = acc_load %acc48 :: integer
|
70
|
+
%t65 = acc_load %acc60 :: integer
|
71
|
+
%t78 = acc_load %acc68 :: integer
|
72
|
+
%t57 = call core.mul(%t65, %t56) :: float
|
73
|
+
%t37 = make_object{name: %t33, payroll: %t53, tax: %t57, managers: %t78} :: object
|
74
74
|
yield %t37
|
75
75
|
end_loop
|
76
76
|
)
|
@@ -18,12 +18,12 @@
|
|
18
18
|
loop departments id=L3 in %t10 as el=%departments_el_11, idx=%departments_i_12
|
19
19
|
%acc40 = decl_acc :: integer
|
20
20
|
%t41 = load_field departments_el_11["employees"] :: any
|
21
|
-
loop employees id=L7 in %t41 as el=%
|
22
|
-
%
|
23
|
-
%acc40 = acc_add agg.sum(%acc40, %
|
21
|
+
loop employees id=L7 in %t41 as el=%t42, idx=%t43
|
22
|
+
%t44 = load_field t42["salary"] :: integer
|
23
|
+
%acc40 = acc_add agg.sum(%acc40, %t44) :: integer
|
24
24
|
end_loop
|
25
|
-
%
|
26
|
-
%t15 = call core.mul(%
|
25
|
+
%t45 = acc_load %acc40 :: integer
|
26
|
+
%t15 = call core.mul(%t45, %t14) :: float
|
27
27
|
yield %t15
|
28
28
|
end_loop
|
29
29
|
)
|
@@ -47,30 +47,30 @@
|
|
47
47
|
)
|
48
48
|
(Declaration department_summary
|
49
49
|
%t30 = load_input "departments" :: array
|
50
|
-
%
|
51
|
-
%
|
52
|
-
%
|
53
|
-
%
|
50
|
+
%t56 = const 0.15 :: float
|
51
|
+
%t73 = const "manager" :: string
|
52
|
+
%t75 = const 1 :: integer
|
53
|
+
%t76 = const 0 :: integer
|
54
54
|
loop departments id=L6 in %t30 as el=%departments_el_31, idx=%departments_i_32
|
55
55
|
%t33 = load_field departments_el_31["name"] :: string
|
56
|
-
%
|
57
|
-
%
|
58
|
-
%
|
59
|
-
%
|
60
|
-
loop employees id=L8 in %
|
61
|
-
%
|
62
|
-
%
|
63
|
-
%
|
64
|
-
%
|
65
|
-
%
|
66
|
-
%
|
67
|
-
%
|
56
|
+
%acc48 = decl_acc :: integer
|
57
|
+
%t49 = load_field departments_el_31["employees"] :: any
|
58
|
+
%acc60 = decl_acc :: integer
|
59
|
+
%acc68 = decl_acc :: integer
|
60
|
+
loop employees id=L8 in %t49 as el=%t50, idx=%t51
|
61
|
+
%t52 = load_field t50["salary"] :: integer
|
62
|
+
%acc48 = acc_add agg.sum(%acc48, %t52) :: integer
|
63
|
+
%acc60 = acc_add agg.sum(%acc60, %t52) :: integer
|
64
|
+
%t72 = load_field t50["role"] :: string
|
65
|
+
%t74 = call core.eq(%t72, %t73) :: boolean
|
66
|
+
%t77 = select %t74, %t75, %t76 :: integer
|
67
|
+
%acc68 = acc_add agg.sum(%acc68, %t77) :: integer
|
68
68
|
end_loop
|
69
|
-
%
|
70
|
-
%
|
71
|
-
%
|
72
|
-
%
|
73
|
-
%t37 = make_object{name: %t33, payroll: %
|
69
|
+
%t53 = acc_load %acc48 :: integer
|
70
|
+
%t65 = acc_load %acc60 :: integer
|
71
|
+
%t78 = acc_load %acc68 :: integer
|
72
|
+
%t57 = call core.mul(%t65, %t56) :: float
|
73
|
+
%t37 = make_object{name: %t33, payroll: %t53, tax: %t57, managers: %t78} :: object
|
74
74
|
yield %t37
|
75
75
|
end_loop
|
76
76
|
)
|
@@ -20,9 +20,9 @@ export function _payroll_tax(input) {
|
|
20
20
|
t10.forEach((departments_el_11, departments_i_12) => {
|
21
21
|
let acc40 = 0;
|
22
22
|
let t41 = departments_el_11["employees"];
|
23
|
-
t41.forEach((
|
24
|
-
let
|
25
|
-
acc40 +=
|
23
|
+
t41.forEach((t42, t43) => {
|
24
|
+
let t44 = t42["salary"];
|
25
|
+
acc40 += t44;
|
26
26
|
});
|
27
27
|
let t15 = acc40 * t14;
|
28
28
|
out.push(t15);
|
@@ -53,31 +53,31 @@ export function _manager_count(input) {
|
|
53
53
|
export function _department_summary(input) {
|
54
54
|
let out = [];
|
55
55
|
let t30 = input["departments"];
|
56
|
-
const
|
57
|
-
const
|
58
|
-
const
|
59
|
-
const
|
56
|
+
const t56 = 0.15;
|
57
|
+
const t73 = "manager";
|
58
|
+
const t75 = 1;
|
59
|
+
const t76 = 0;
|
60
60
|
t30.forEach((departments_el_31, departments_i_32) => {
|
61
61
|
let t33 = departments_el_31["name"];
|
62
|
-
let
|
63
|
-
let
|
64
|
-
let
|
65
|
-
let
|
66
|
-
|
67
|
-
let
|
68
|
-
|
69
|
-
|
70
|
-
let
|
71
|
-
let
|
72
|
-
|
73
|
-
|
62
|
+
let acc48 = 0;
|
63
|
+
let t49 = departments_el_31["employees"];
|
64
|
+
let acc60 = 0;
|
65
|
+
let acc68 = 0;
|
66
|
+
t49.forEach((t50, t51) => {
|
67
|
+
let t52 = t50["salary"];
|
68
|
+
acc48 += t52;
|
69
|
+
acc60 += t52;
|
70
|
+
let t72 = t50["role"];
|
71
|
+
let t74 = t72 == t73;
|
72
|
+
let t77 = t74 ? t75 : t76;
|
73
|
+
acc68 += t77;
|
74
74
|
});
|
75
|
-
let
|
75
|
+
let t57 = acc60 * t56;
|
76
76
|
let t37 = {
|
77
77
|
"name": t33,
|
78
|
-
"payroll":
|
79
|
-
"tax":
|
80
|
-
"managers":
|
78
|
+
"payroll": acc48,
|
79
|
+
"tax": t57,
|
80
|
+
"managers": acc68
|
81
81
|
};
|
82
82
|
out.push(t37);
|
83
83
|
});
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Autogenerated by Kumi Codegen
|
2
|
-
module Kumi::Compiled::
|
2
|
+
module Kumi::Compiled::KUMI_87ffe0a010684a3e05fc7ee0390ec80c776ceea5e0f6e32d7438702ccd542084
|
3
3
|
def self.from(input_data = nil)
|
4
4
|
instance = Object.new
|
5
5
|
instance.extend(self)
|
@@ -51,12 +51,12 @@ module Kumi::Compiled::KUMI_439c5f78b9f09ead0135b22b7e3f99b28fbd8f9cf85471d95331
|
|
51
51
|
t10.each_with_index do |departments_el_11, departments_i_12|
|
52
52
|
acc40 = 0
|
53
53
|
t41 = departments_el_11["employees"] || departments_el_11[:employees]
|
54
|
-
t41.each_with_index do |
|
55
|
-
|
56
|
-
acc40 +=
|
54
|
+
t41.each_with_index do |t42, t43|
|
55
|
+
t44 = t42["salary"] || t42[:salary]
|
56
|
+
acc40 += t44
|
57
57
|
end
|
58
|
-
|
59
|
-
t15 =
|
58
|
+
t45 = acc40
|
59
|
+
t15 = t45 * t14
|
60
60
|
out << t15
|
61
61
|
end
|
62
62
|
out
|
@@ -86,34 +86,34 @@ module Kumi::Compiled::KUMI_439c5f78b9f09ead0135b22b7e3f99b28fbd8f9cf85471d95331
|
|
86
86
|
def _department_summary(input = @input)
|
87
87
|
out = []
|
88
88
|
t30 = input["departments"] || input[:departments]
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
89
|
+
t56 = 0.15
|
90
|
+
t73 = "manager"
|
91
|
+
t75 = 1
|
92
|
+
t76 = 0
|
93
93
|
t30.each_with_index do |departments_el_31, departments_i_32|
|
94
94
|
t33 = departments_el_31["name"] || departments_el_31[:name]
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
95
|
+
acc48 = 0
|
96
|
+
t49 = departments_el_31["employees"] || departments_el_31[:employees]
|
97
|
+
acc60 = 0
|
98
|
+
acc68 = 0
|
99
|
+
t49.each_with_index do |t50, t51|
|
100
|
+
t52 = t50["salary"] || t50[:salary]
|
101
|
+
acc48 += t52
|
102
|
+
acc60 += t52
|
103
|
+
t72 = t50["role"] || t50[:role]
|
104
|
+
t74 = t72 == t73
|
105
|
+
t77 = t74 ? t75 : t76
|
106
|
+
acc68 += t77
|
107
107
|
end
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
108
|
+
t53 = acc48
|
109
|
+
t65 = acc60
|
110
|
+
t78 = acc68
|
111
|
+
t57 = t65 * t56
|
112
112
|
t37 = {
|
113
113
|
"name" => t33,
|
114
|
-
"payroll" =>
|
115
|
-
"tax" =>
|
116
|
-
"managers" =>
|
114
|
+
"payroll" => t53,
|
115
|
+
"tax" => t57,
|
116
|
+
"managers" => t78
|
117
117
|
}
|
118
118
|
out << t37
|
119
119
|
end
|