kumi 0.0.27 → 0.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -0
  3. data/README.md +24 -9
  4. data/data/functions/core/arithmetic.yaml +28 -8
  5. data/data/functions/core/boolean.yaml +8 -3
  6. data/data/functions/core/comparison.yaml +12 -4
  7. data/data/kernels/javascript/core/arithmetic.yaml +6 -2
  8. data/data/kernels/ruby/core/arithmetic.yaml +7 -2
  9. data/golden/array_element/expected/schema_ruby.rb +1 -1
  10. data/golden/array_index/expected/lir_00_unoptimized.txt +2 -2
  11. data/golden/array_index/expected/lir_01_hoist_scalar_references.txt +2 -2
  12. data/golden/array_index/expected/lir_02_inlined.txt +2 -2
  13. data/golden/array_index/expected/lir_03_cse.txt +2 -2
  14. data/golden/array_index/expected/lir_04_1_loop_fusion.txt +2 -2
  15. data/golden/array_index/expected/lir_04_loop_invcm.txt +2 -2
  16. data/golden/array_index/expected/lir_06_const_prop.txt +2 -2
  17. data/golden/array_index/expected/schema_ruby.rb +1 -1
  18. data/golden/array_index/expected/snast.txt +2 -2
  19. data/golden/array_operations/expected/lir_00_unoptimized.txt +2 -2
  20. data/golden/array_operations/expected/lir_01_hoist_scalar_references.txt +2 -2
  21. data/golden/array_operations/expected/lir_02_inlined.txt +2 -2
  22. data/golden/array_operations/expected/lir_03_cse.txt +2 -2
  23. data/golden/array_operations/expected/lir_04_1_loop_fusion.txt +2 -2
  24. data/golden/array_operations/expected/lir_04_loop_invcm.txt +2 -2
  25. data/golden/array_operations/expected/lir_06_const_prop.txt +2 -2
  26. data/golden/array_operations/expected/schema_ruby.rb +1 -1
  27. data/golden/array_operations/expected/snast.txt +2 -2
  28. data/golden/cascade_logic/expected/schema_ruby.rb +1 -1
  29. data/golden/chained_fusion/expected/schema_ruby.rb +1 -1
  30. data/golden/decimal_explicit/expected/lir_00_unoptimized.txt +2 -2
  31. data/golden/decimal_explicit/expected/lir_01_hoist_scalar_references.txt +2 -2
  32. data/golden/decimal_explicit/expected/lir_02_inlined.txt +6 -6
  33. data/golden/decimal_explicit/expected/lir_03_cse.txt +5 -5
  34. data/golden/decimal_explicit/expected/lir_04_1_loop_fusion.txt +5 -5
  35. data/golden/decimal_explicit/expected/lir_04_loop_invcm.txt +5 -5
  36. data/golden/decimal_explicit/expected/lir_06_const_prop.txt +5 -5
  37. data/golden/decimal_explicit/expected/schema_ruby.rb +1 -1
  38. data/golden/decimal_explicit/expected/snast.txt +2 -2
  39. data/golden/element_arrays/expected/schema_ruby.rb +1 -1
  40. data/golden/empty_and_null_inputs/expected/schema_ruby.rb +1 -1
  41. data/golden/function_overload/expected/schema_ruby.rb +1 -1
  42. data/golden/game_of_life/expected/schema_ruby.rb +1 -1
  43. data/golden/hash_keys/expected/schema_ruby.rb +1 -1
  44. data/golden/hash_value/expected/schema_ruby.rb +1 -1
  45. data/golden/hierarchical_complex/expected/lir_00_unoptimized.txt +3 -3
  46. data/golden/hierarchical_complex/expected/lir_01_hoist_scalar_references.txt +3 -3
  47. data/golden/hierarchical_complex/expected/lir_02_inlined.txt +3 -3
  48. data/golden/hierarchical_complex/expected/lir_03_cse.txt +3 -3
  49. data/golden/hierarchical_complex/expected/lir_04_1_loop_fusion.txt +3 -3
  50. data/golden/hierarchical_complex/expected/lir_04_loop_invcm.txt +3 -3
  51. data/golden/hierarchical_complex/expected/lir_06_const_prop.txt +3 -3
  52. data/golden/hierarchical_complex/expected/schema_ruby.rb +1 -1
  53. data/golden/hierarchical_complex/expected/snast.txt +3 -3
  54. data/golden/inline_rename_scope_leak/expected/schema_ruby.rb +1 -1
  55. data/golden/input_reference/expected/schema_ruby.rb +1 -1
  56. data/golden/interleaved_fusion/expected/lir_00_unoptimized.txt +1 -1
  57. data/golden/interleaved_fusion/expected/lir_01_hoist_scalar_references.txt +1 -1
  58. data/golden/interleaved_fusion/expected/lir_02_inlined.txt +2 -2
  59. data/golden/interleaved_fusion/expected/lir_03_cse.txt +2 -2
  60. data/golden/interleaved_fusion/expected/lir_04_1_loop_fusion.txt +2 -2
  61. data/golden/interleaved_fusion/expected/lir_04_loop_invcm.txt +2 -2
  62. data/golden/interleaved_fusion/expected/lir_06_const_prop.txt +2 -2
  63. data/golden/interleaved_fusion/expected/schema_ruby.rb +1 -1
  64. data/golden/interleaved_fusion/expected/snast.txt +1 -1
  65. data/golden/let_inline/expected/lir_00_unoptimized.txt +2 -2
  66. data/golden/let_inline/expected/lir_01_hoist_scalar_references.txt +2 -2
  67. data/golden/let_inline/expected/lir_02_inlined.txt +6 -6
  68. data/golden/let_inline/expected/lir_03_cse.txt +6 -6
  69. data/golden/let_inline/expected/lir_04_1_loop_fusion.txt +6 -6
  70. data/golden/let_inline/expected/lir_04_loop_invcm.txt +6 -6
  71. data/golden/let_inline/expected/lir_06_const_prop.txt +6 -6
  72. data/golden/let_inline/expected/schema_ruby.rb +1 -1
  73. data/golden/let_inline/expected/snast.txt +2 -2
  74. data/golden/loop_fusion/expected/schema_ruby.rb +1 -1
  75. data/golden/min_reduce_scope/expected/schema_ruby.rb +1 -1
  76. data/golden/mixed_dimensions/expected/schema_ruby.rb +1 -1
  77. data/golden/multirank_hoisting/expected/lir_00_unoptimized.txt +2 -2
  78. data/golden/multirank_hoisting/expected/lir_01_hoist_scalar_references.txt +2 -2
  79. data/golden/multirank_hoisting/expected/lir_02_inlined.txt +7 -7
  80. data/golden/multirank_hoisting/expected/lir_03_cse.txt +7 -7
  81. data/golden/multirank_hoisting/expected/lir_04_1_loop_fusion.txt +7 -7
  82. data/golden/multirank_hoisting/expected/lir_04_loop_invcm.txt +7 -7
  83. data/golden/multirank_hoisting/expected/lir_06_const_prop.txt +7 -7
  84. data/golden/multirank_hoisting/expected/schema_ruby.rb +1 -1
  85. data/golden/multirank_hoisting/expected/snast.txt +2 -2
  86. data/golden/nested_hash/expected/lir_00_unoptimized.txt +1 -1
  87. data/golden/nested_hash/expected/lir_01_hoist_scalar_references.txt +1 -1
  88. data/golden/nested_hash/expected/lir_02_inlined.txt +1 -1
  89. data/golden/nested_hash/expected/lir_03_cse.txt +1 -1
  90. data/golden/nested_hash/expected/lir_04_1_loop_fusion.txt +1 -1
  91. data/golden/nested_hash/expected/lir_04_loop_invcm.txt +1 -1
  92. data/golden/nested_hash/expected/lir_06_const_prop.txt +1 -1
  93. data/golden/nested_hash/expected/schema_ruby.rb +1 -1
  94. data/golden/nested_hash/expected/snast.txt +1 -1
  95. data/golden/reduction_broadcast/expected/schema_ruby.rb +1 -1
  96. data/golden/roll/expected/schema_ruby.rb +1 -1
  97. data/golden/shift/expected/schema_ruby.rb +1 -1
  98. data/golden/shift_2d/expected/schema_ruby.rb +1 -1
  99. data/golden/simple_math/expected/lir_00_unoptimized.txt +2 -2
  100. data/golden/simple_math/expected/lir_01_hoist_scalar_references.txt +2 -2
  101. data/golden/simple_math/expected/lir_02_inlined.txt +2 -2
  102. data/golden/simple_math/expected/lir_03_cse.txt +2 -2
  103. data/golden/simple_math/expected/lir_04_1_loop_fusion.txt +2 -2
  104. data/golden/simple_math/expected/lir_04_loop_invcm.txt +2 -2
  105. data/golden/simple_math/expected/lir_06_const_prop.txt +2 -2
  106. data/golden/simple_math/expected/schema_ruby.rb +1 -1
  107. data/golden/simple_math/expected/snast.txt +2 -2
  108. data/golden/streaming_basics/expected/lir_00_unoptimized.txt +3 -3
  109. data/golden/streaming_basics/expected/lir_01_hoist_scalar_references.txt +3 -3
  110. data/golden/streaming_basics/expected/lir_02_inlined.txt +9 -9
  111. data/golden/streaming_basics/expected/lir_03_cse.txt +7 -7
  112. data/golden/streaming_basics/expected/lir_04_1_loop_fusion.txt +7 -7
  113. data/golden/streaming_basics/expected/lir_04_loop_invcm.txt +7 -7
  114. data/golden/streaming_basics/expected/lir_06_const_prop.txt +7 -7
  115. data/golden/streaming_basics/expected/schema_ruby.rb +1 -1
  116. data/golden/streaming_basics/expected/snast.txt +3 -3
  117. data/golden/tuples/expected/schema_ruby.rb +1 -1
  118. data/golden/tuples_and_arrays/expected/schema_ruby.rb +1 -1
  119. data/golden/us_tax_2024/expected/lir_00_unoptimized.txt +6 -6
  120. data/golden/us_tax_2024/expected/lir_01_hoist_scalar_references.txt +6 -6
  121. data/golden/us_tax_2024/expected/lir_02_inlined.txt +71 -71
  122. data/golden/us_tax_2024/expected/lir_03_cse.txt +43 -43
  123. data/golden/us_tax_2024/expected/lir_04_1_loop_fusion.txt +48 -48
  124. data/golden/us_tax_2024/expected/lir_04_loop_invcm.txt +43 -43
  125. data/golden/us_tax_2024/expected/lir_06_const_prop.txt +43 -43
  126. data/golden/us_tax_2024/expected/schema_ruby.rb +1 -1
  127. data/golden/us_tax_2024/expected/snast.txt +6 -6
  128. data/golden/with_constants/expected/schema_ruby.rb +1 -1
  129. data/lib/kumi/core/analyzer/passes/nast_dimensional_analyzer_pass.rb +1 -1
  130. data/lib/kumi/core/error_reporter.rb +1 -1
  131. data/lib/kumi/core/errors.rb +1 -1
  132. data/lib/kumi/core/functions/overload_resolver.rb +57 -11
  133. data/lib/kumi/core/functions/type_categories.rb +44 -0
  134. data/lib/kumi/frontends/text.rb +33 -5
  135. data/lib/kumi/syntax/location.rb +5 -1
  136. data/lib/kumi/version.rb +1 -1
  137. metadata +2 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a850b47be185d9e65a5b86121f6208b80eac6eba1f8a4bc78879893304cd02ea
4
- data.tar.gz: f8a14f4516963be8c6ff8e4b9839189ead2ee134f790ea46f8945e2be6b06876
3
+ metadata.gz: 644df492ff48a0f3490909636f678554b93cfea464e7c133366609743d6ac8a8
4
+ data.tar.gz: df9b82c1e0e29466e033fac43dafda4ad990402d005d606acdf41133c3860f25
5
5
  SHA512:
6
- metadata.gz: 2f4e71671cf52c9fbbdede6da6d401f44c4e55a6562fdda0b5d866f11d284a1a2645138e8f469d21fe0f7ab3546e5509348b6223f08d914a60a133b21ca9f57b
7
- data.tar.gz: 7fa1e8c26b801ce265310f4dc8837ec7ec7f4218798d10360c4ab707f856ef8bb833c80f04cd08f52e1590df502c1d54fa44f270db384e7269abbda79de3eeec
6
+ metadata.gz: 71555d229915f8a71d47fe719f976c3d0e212576f1bbf5061463ede08c0e49e7126b338646036eb2573e3f1492297da8e42bc40331ce02289d4112b9d71be6f2
7
+ data.tar.gz: '09cd854fca02d7e15f52ea51f7153e9105075d4509b19219cd4cc0924c25048126df97de350e06d845ab6d65c5027e23e710ef2cf0a1ca59922fea3cefb45a3a'
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.0.28] – 2025-10-20
4
+ ### Changed
5
+ - Error location formatting now uses explicit `line=` and `column=` keywords for clarity
6
+ - Location extraction prioritizes structured Location objects over message parsing
7
+ - Default file label changed from "(string)" to "schema" for better UX
8
+
9
+ ### Fixed
10
+ - Removed redundant location information from error messages
11
+ - Parse error messages now properly format location details
12
+
3
13
  ## [0.0.27] – 2025-10-20
4
14
  ### Added
5
15
  - Decimal type system for precise money/bignum calculations
data/README.md CHANGED
@@ -7,20 +7,37 @@
7
7
 
8
8
  ---
9
9
 
10
- **Declarative, typed, vectorized calculation DSL (Ruby-embedded) that builds a deterministic dependency graph.**
11
- Normalized, typed **AST → IR → LIR**. Static checks and **constraint UNSAT** at compile time. Codegen is thin.
10
+ ## What is Kumi?
11
+
12
+ Kumi is a **declarative DSL for building calculation systems** that are:
13
+ - **Typed & verifiable at compile time** (catch errors before they hit production)
14
+ - **Vectorized** (arrays and nested data structures work naturally)
15
+ - **Transparent** (inspect generated code and execution order)
16
+ - **Portable** (compile the same schema to Ruby or JavaScript)
17
+
18
+ Instead of writing procedural formulas, you declare *what* values depend on *what*, and Kumi figures out the computation order, validates types, detects impossible constraints, and generates efficient code.
19
+
20
+ ## Why Kumi Exists
21
+
22
+ Calculation systems are everywhere: tax engines, pricing models, financial projections, compliance checks. They're usually:
23
+ - Hard to verify (logic spread across multiple files)
24
+ - Fragile (changing one formula breaks hidden dependencies)
25
+ - Duplicated (same logic needed in backend and frontend)
26
+ - Opaque (hard to audit which rules applied to which data)
27
+
28
+ Kumi makes them explicit, testable, and portable.
12
29
 
13
30
  ---
14
31
 
15
32
  **Status**: experimental. Public API may change. Typing and some static checks are still evolving.
16
33
 
17
- **Feedback**: have a use case or a paper cut? Open an issue or reach out.
34
+ **Feedback**: have a use case or hit a rough edge? Open an issue or reach out.
18
35
 
19
36
  ---
20
37
 
21
38
  ## Example: US Tax Calculator (2024)
22
39
 
23
- See the [interactive demo](https://kumi-play-web.fly.dev/) or browse the [golden test files](golden/us_tax_2024/) (schema, input, expected output, generated code).
40
+ A single schema computes federal, state, FICA taxes across multiple filing statuses—all types verified at compile time. Try it in the [interactive demo](https://kumi-play-web.fly.dev/) or inspect the [full schema, input, output, and generated code](golden/us_tax_2024/).
24
41
 
25
42
  <details>
26
43
  <summary><strong>Schema</strong></summary>
@@ -118,10 +135,6 @@ Requires Ruby 3.1+. No external dependencies.
118
135
  ```ruby
119
136
  require 'kumi'
120
137
 
121
- Kumi.configure do |config|
122
- config.compilation_mode = :jit
123
- end
124
-
125
138
  module Double
126
139
  extend Kumi::Schema
127
140
 
@@ -135,10 +148,12 @@ end
135
148
  result = Double.from(x: 5)
136
149
  result[:doubled] # => 10
137
150
 
138
- # Export to JavaScript
151
+ # Export to JavaScript (same logic)
139
152
  Double.write_source("output.mjs", platform: :javascript)
140
153
  ```
141
154
 
155
+ Try the [interactive demo](https://kumi-play-web.fly.dev/) (no setup required).
156
+
142
157
  ---
143
158
 
144
159
  ## Documentation
@@ -9,7 +9,9 @@ functions:
9
9
 
10
10
  - id: core.add
11
11
  kind: elementwise
12
- params: [{ name: left_operand }, { name: right_operand }]
12
+ params:
13
+ - { name: left_operand, dtype: numeric }
14
+ - { name: right_operand, dtype: numeric }
13
15
  dtype:
14
16
  rule: promote
15
17
  params: [left_operand, right_operand]
@@ -33,15 +35,19 @@ functions:
33
35
 
34
36
  - id: core.sub
35
37
  kind: elementwise
36
- params: [{ name: left_operand }, { name: right_operand }]
38
+ params:
39
+ - { name: left_operand, dtype: numeric }
40
+ - { name: right_operand, dtype: numeric }
37
41
  dtype:
38
42
  rule: promote
39
43
  params: [left_operand, right_operand]
40
44
  aliases: ["sub", "subtract"]
41
45
 
42
- - id: core.mul
46
+ - id: core.mul:numeric
43
47
  kind: elementwise
44
- params: [{ name: left_operand }, { name: right_operand }]
48
+ params:
49
+ - { name: left_operand, dtype: numeric }
50
+ - { name: right_operand, dtype: numeric }
45
51
  dtype:
46
52
  rule: promote
47
53
  params: [left_operand, right_operand]
@@ -63,9 +69,21 @@ functions:
63
69
  # For multiplication: divide by absolute values considering sign changes
64
70
  range: "derive from result bounds and operand bounds considering sign combinations"
65
71
 
72
+ - id: core.mul:string_repeat
73
+ kind: elementwise
74
+ params:
75
+ - { name: string_value, dtype: string }
76
+ - { name: repeat_count, dtype: integer }
77
+ dtype:
78
+ rule: scalar
79
+ kind: string
80
+ aliases: ["mul", "multiply"]
81
+
66
82
  - id: core.pow
67
83
  kind: elementwise
68
- params: [{ name: base }, { name: exponent }]
84
+ params:
85
+ - { name: base, dtype: numeric }
86
+ - { name: exponent, dtype: numeric }
69
87
  dtype:
70
88
  rule: promote
71
89
  params: [base, exponent]
@@ -73,7 +91,9 @@ functions:
73
91
 
74
92
  - id: core.div
75
93
  kind: elementwise
76
- params: [{ name: left_operand }, { name: right_operand }]
94
+ params:
95
+ - { name: left_operand, dtype: numeric }
96
+ - { name: right_operand, dtype: numeric }
77
97
  dtype:
78
98
  rule: scalar
79
99
  kind: float
@@ -82,8 +102,8 @@ functions:
82
102
  - id: core.mod
83
103
  kind: elementwise
84
104
  params:
85
- - { name: left_operand }
86
- - { name: right_operand }
105
+ - { name: left_operand, dtype: numeric }
106
+ - { name: right_operand, dtype: numeric }
87
107
  dtype:
88
108
  rule: promote
89
109
  params: [left_operand, right_operand]
@@ -1,7 +1,9 @@
1
1
  functions:
2
2
  - id: core.and
3
3
  kind: elementwise
4
- params: [{ name: left_operand }, { name: right_operand }]
4
+ params:
5
+ - { name: left_operand, dtype: boolean }
6
+ - { name: right_operand, dtype: boolean }
5
7
  dtype:
6
8
  rule: scalar
7
9
  kind: boolean
@@ -9,7 +11,9 @@ functions:
9
11
 
10
12
  - id: core.or
11
13
  kind: elementwise
12
- params: [{ name: left_operand }, { name: right_operand }]
14
+ params:
15
+ - { name: left_operand, dtype: boolean }
16
+ - { name: right_operand, dtype: boolean }
13
17
  dtype:
14
18
  rule: scalar
15
19
  kind: boolean
@@ -17,7 +21,8 @@ functions:
17
21
 
18
22
  - id: core.not
19
23
  kind: elementwise
20
- params: [{ name: operand }]
24
+ params:
25
+ - { name: operand, dtype: boolean }
21
26
  dtype:
22
27
  rule: scalar
23
28
  kind: boolean
@@ -1,7 +1,9 @@
1
1
  functions:
2
2
  - id: core.gte
3
3
  kind: elementwise
4
- params: [{ name: left_operand }, { name: right_operand }]
4
+ params:
5
+ - { name: left_operand, dtype: orderable }
6
+ - { name: right_operand, dtype: orderable }
5
7
  dtype:
6
8
  rule: scalar
7
9
  kind: boolean
@@ -10,7 +12,9 @@ functions:
10
12
 
11
13
  - id: core.gt
12
14
  kind: elementwise
13
- params: [{ name: left_operand }, { name: right_operand }]
15
+ params:
16
+ - { name: left_operand, dtype: orderable }
17
+ - { name: right_operand, dtype: orderable }
14
18
  dtype:
15
19
  rule: scalar
16
20
  kind: boolean
@@ -19,7 +23,9 @@ functions:
19
23
 
20
24
  - id: core.lte
21
25
  kind: elementwise
22
- params: [{ name: left_operand }, { name: right_operand }]
26
+ params:
27
+ - { name: left_operand, dtype: orderable }
28
+ - { name: right_operand, dtype: orderable }
23
29
  dtype:
24
30
  rule: scalar
25
31
  kind: boolean
@@ -28,7 +34,9 @@ functions:
28
34
 
29
35
  - id: core.lt
30
36
  kind: elementwise
31
- params: [{ name: left_operand }, { name: right_operand }]
37
+ params:
38
+ - { name: left_operand, dtype: orderable }
39
+ - { name: right_operand, dtype: orderable }
32
40
  dtype:
33
41
  rule: scalar
34
42
  kind: boolean
@@ -15,10 +15,14 @@ kernels:
15
15
  fn: core.sub
16
16
  inline: "= $0 - $1"
17
17
 
18
- - id: mul:javascript:v1
19
- fn: core.mul
18
+ - id: mul:numeric:javascript:v1
19
+ fn: core.mul:numeric
20
20
  inline: "= $0 * $1"
21
21
 
22
+ - id: mul:string_repeat:javascript:v1
23
+ fn: core.mul:string_repeat
24
+ inline: "= $0.repeat($1)"
25
+
22
26
  - id: pow:javascript:v1
23
27
  fn: core.pow
24
28
  inline: "= Math.pow($0, $1)"
@@ -17,11 +17,16 @@ kernels:
17
17
  inline: "= $0 - $1"
18
18
  impl: "(a, b)\n a - b"
19
19
 
20
- - id: mul:ruby:v1
21
- fn: core.mul
20
+ - id: mul:numeric:ruby:v1
21
+ fn: core.mul:numeric
22
22
  inline: "= $0 * $1"
23
23
  impl: "(a, b)\n a * b"
24
24
 
25
+ - id: mul:string_repeat:ruby:v1
26
+ fn: core.mul:string_repeat
27
+ inline: "= $0 * $1"
28
+ impl: "(str, count)\n str * count"
29
+
25
30
  - id: pow:ruby:v1
26
31
  fn: core.pow
27
32
  inline: "= $0 ** $1"
@@ -1,5 +1,5 @@
1
1
  # Autogenerated by Kumi Codegen
2
- module Kumi::Compiled::KUMI_89360babebc3896b16e46cb4cf2f0f8feb3d6f6428e9bf430575b05328fa27eb
2
+ module Kumi::Compiled::KUMI_c471bb50d63caec69c74f4f90a802a61121c5d8df77d991ce58327c31c003c54
3
3
  def self.from(input_data = nil)
4
4
  instance = Object.new
5
5
  instance.extend(self)
@@ -11,7 +11,7 @@
11
11
  loop x id=L2 in %t5 as el=%x_el_6, idx=%x_i_7
12
12
  loop y id=L3 in %x_el_6 as el=%y_el_8, idx=%y_i_9
13
13
  %t10 = load_decl W axes=[x] :: integer
14
- %t11 = call core.mul(%x_i_7, %t10) :: integer
14
+ %t11 = call core.mul:numeric(%x_i_7, %t10) :: integer
15
15
  %t12 = call core.add(%t11, %y_i_9) :: integer
16
16
  yield %t12
17
17
  end_loop
@@ -23,7 +23,7 @@
23
23
  loop y id=L5 in %x_el_14 as el=%y_el_16, idx=%y_i_17
24
24
  %t18 = load_input "x" :: array
25
25
  %t19 = call core.array_size(%t18) :: integer
26
- %t20 = call core.mul(%y_i_17, %t19) :: integer
26
+ %t20 = call core.mul:numeric(%y_i_17, %t19) :: integer
27
27
  %t21 = call core.add(%t20, %x_i_15) :: integer
28
28
  yield %t21
29
29
  end_loop
@@ -11,7 +11,7 @@
11
11
  loop x id=L2 in %t5 as el=%x_el_6, idx=%x_i_7
12
12
  loop y id=L3 in %x_el_6 as el=%y_el_8, idx=%y_i_9
13
13
  %t10 = load_decl W axes=[x] :: integer
14
- %t11 = call core.mul(%x_i_7, %t10) :: integer
14
+ %t11 = call core.mul:numeric(%x_i_7, %t10) :: integer
15
15
  %t12 = call core.add(%t11, %y_i_9) :: integer
16
16
  yield %t12
17
17
  end_loop
@@ -23,7 +23,7 @@
23
23
  loop y id=L5 in %x_el_14 as el=%y_el_16, idx=%y_i_17
24
24
  %t18 = load_input "x" :: array
25
25
  %t19 = call core.array_size(%t18) :: integer
26
- %t20 = call core.mul(%y_i_17, %t19) :: integer
26
+ %t20 = call core.mul:numeric(%y_i_17, %t19) :: integer
27
27
  %t21 = call core.add(%t20, %x_i_15) :: integer
28
28
  yield %t21
29
29
  end_loop
@@ -12,7 +12,7 @@
12
12
  %t28 = load_input "x" :: array
13
13
  %t29 = call core.array_size(%x_el_6) :: integer
14
14
  loop y id=L3 in %x_el_6 as el=%y_el_8, idx=%y_i_9
15
- %t11 = call core.mul(%x_i_7, %t29) :: integer
15
+ %t11 = call core.mul:numeric(%x_i_7, %t29) :: integer
16
16
  %t12 = call core.add(%t11, %y_i_9) :: integer
17
17
  yield %t12
18
18
  end_loop
@@ -24,7 +24,7 @@
24
24
  loop y id=L5 in %x_el_14 as el=%y_el_16, idx=%y_i_17
25
25
  %t18 = load_input "x" :: array
26
26
  %t19 = call core.array_size(%t18) :: integer
27
- %t20 = call core.mul(%y_i_17, %t19) :: integer
27
+ %t20 = call core.mul:numeric(%y_i_17, %t19) :: integer
28
28
  %t21 = call core.add(%t20, %x_i_15) :: integer
29
29
  yield %t21
30
30
  end_loop
@@ -11,7 +11,7 @@
11
11
  loop x id=L2 in %t5 as el=%x_el_6, idx=%x_i_7
12
12
  %t29 = call core.array_size(%x_el_6) :: integer
13
13
  loop y id=L3 in %x_el_6 as el=%y_el_8, idx=%y_i_9
14
- %t11 = call core.mul(%x_i_7, %t29) :: integer
14
+ %t11 = call core.mul:numeric(%x_i_7, %t29) :: integer
15
15
  %t12 = call core.add(%t11, %y_i_9) :: integer
16
16
  yield %t12
17
17
  end_loop
@@ -22,7 +22,7 @@
22
22
  loop x id=L4 in %t13 as el=%x_el_14, idx=%x_i_15
23
23
  loop y id=L5 in %x_el_14 as el=%y_el_16, idx=%y_i_17
24
24
  %t19 = call core.array_size(%t13) :: integer
25
- %t20 = call core.mul(%y_i_17, %t19) :: integer
25
+ %t20 = call core.mul:numeric(%y_i_17, %t19) :: integer
26
26
  %t21 = call core.add(%t20, %x_i_15) :: integer
27
27
  yield %t21
28
28
  end_loop
@@ -11,7 +11,7 @@
11
11
  loop x id=L2 in %t5 as el=%x_el_6, idx=%x_i_7
12
12
  %t29 = call core.array_size(%x_el_6) :: integer
13
13
  loop y id=L3 in %x_el_6 as el=%y_el_8, idx=%y_i_9
14
- %t11 = call core.mul(%x_i_7, %t29) :: integer
14
+ %t11 = call core.mul:numeric(%x_i_7, %t29) :: integer
15
15
  %t12 = call core.add(%t11, %y_i_9) :: integer
16
16
  yield %t12
17
17
  end_loop
@@ -22,7 +22,7 @@
22
22
  loop x id=L4 in %t13 as el=%x_el_14, idx=%x_i_15
23
23
  loop y id=L5 in %x_el_14 as el=%y_el_16, idx=%y_i_17
24
24
  %t19 = call core.array_size(%t13) :: integer
25
- %t20 = call core.mul(%y_i_17, %t19) :: integer
25
+ %t20 = call core.mul:numeric(%y_i_17, %t19) :: integer
26
26
  %t21 = call core.add(%t20, %x_i_15) :: integer
27
27
  yield %t21
28
28
  end_loop
@@ -10,7 +10,7 @@
10
10
  %t5 = load_input "x" :: array
11
11
  loop x id=L2 in %t5 as el=%x_el_6, idx=%x_i_7
12
12
  %t29 = call core.array_size(%x_el_6) :: integer
13
- %t11 = call core.mul(%x_i_7, %t29) :: integer
13
+ %t11 = call core.mul:numeric(%x_i_7, %t29) :: integer
14
14
  loop y id=L3 in %x_el_6 as el=%y_el_8, idx=%y_i_9
15
15
  %t12 = call core.add(%t11, %y_i_9) :: integer
16
16
  yield %t12
@@ -22,7 +22,7 @@
22
22
  %t19 = call core.array_size(%t13) :: integer
23
23
  loop x id=L4 in %t13 as el=%x_el_14, idx=%x_i_15
24
24
  loop y id=L5 in %x_el_14 as el=%y_el_16, idx=%y_i_17
25
- %t20 = call core.mul(%y_i_17, %t19) :: integer
25
+ %t20 = call core.mul:numeric(%y_i_17, %t19) :: integer
26
26
  %t21 = call core.add(%t20, %x_i_15) :: integer
27
27
  yield %t21
28
28
  end_loop
@@ -10,7 +10,7 @@
10
10
  %t5 = load_input "x" :: array
11
11
  loop x id=L2 in %t5 as el=%x_el_6, idx=%x_i_7
12
12
  %t29 = call core.array_size(%x_el_6) :: integer
13
- %t11 = call core.mul(%x_i_7, %t29) :: integer
13
+ %t11 = call core.mul:numeric(%x_i_7, %t29) :: integer
14
14
  loop y id=L3 in %x_el_6 as el=%y_el_8, idx=%y_i_9
15
15
  %t12 = call core.add(%t11, %y_i_9) :: integer
16
16
  yield %t12
@@ -22,7 +22,7 @@
22
22
  %t19 = call core.array_size(%t13) :: integer
23
23
  loop x id=L4 in %t13 as el=%x_el_14, idx=%x_i_15
24
24
  loop y id=L5 in %x_el_14 as el=%y_el_16, idx=%y_i_17
25
- %t20 = call core.mul(%y_i_17, %t19) :: integer
25
+ %t20 = call core.mul:numeric(%y_i_17, %t19) :: integer
26
26
  %t21 = call core.add(%t20, %x_i_15) :: integer
27
27
  yield %t21
28
28
  end_loop
@@ -1,5 +1,5 @@
1
1
  # Autogenerated by Kumi Codegen
2
- module Kumi::Compiled::KUMI_1ee54aec6cf6cfd2570cdd73e6ce47bc23c82e4faaf4a03ca6bd11d1e8d34b0e
2
+ module Kumi::Compiled::KUMI_874ab4afa8620b57bf0b29130c4beab47d4b6f3e93de001a63d88e7fe497a308
3
3
  def self.from(input_data = nil)
4
4
  instance = Object.new
5
5
  instance.extend(self)
@@ -6,7 +6,7 @@
6
6
  ) :: [x] -> integer
7
7
  (VALUE box
8
8
  (Call :core.add
9
- (Call :core.mul
9
+ (Call :core.mul:numeric
10
10
  (IndexRef i input=x.__index(i)) :: [x] -> integer
11
11
  (Ref W) :: [x] -> integer
12
12
  ) :: [x] -> integer
@@ -15,7 +15,7 @@
15
15
  ) :: [x, y] -> integer
16
16
  (VALUE col_major
17
17
  (Call :core.add
18
- (Call :core.mul
18
+ (Call :core.mul:numeric
19
19
  (IndexRef j input=x.y.__index(j)) :: [x, y] -> integer
20
20
  (Call :core.array_size
21
21
  (InputRef x key_chain=[]) :: [] -> array
@@ -4,7 +4,7 @@
4
4
  loop items id=L1 in %t1 as el=%items_el_2, idx=%items_i_3
5
5
  %t4 = load_field items_el_2["price"] :: float
6
6
  %t5 = load_field items_el_2["quantity"] :: integer
7
- %t6 = call core.mul(%t4, %t5) :: float
7
+ %t6 = call core.mul:numeric(%t4, %t5) :: float
8
8
  yield %t6
9
9
  end_loop
10
10
  )
@@ -13,7 +13,7 @@
13
13
  loop items id=L2 in %t7 as el=%items_el_8, idx=%items_i_9
14
14
  %t10 = load_field items_el_8["price"] :: float
15
15
  %t11 = const 0.9 :: float
16
- %t12 = call core.mul(%t10, %t11) :: float
16
+ %t12 = call core.mul:numeric(%t10, %t11) :: float
17
17
  yield %t12
18
18
  end_loop
19
19
  )
@@ -4,7 +4,7 @@
4
4
  loop items id=L1 in %t1 as el=%items_el_2, idx=%items_i_3
5
5
  %t4 = load_field items_el_2["price"] :: float
6
6
  %t5 = load_field items_el_2["quantity"] :: integer
7
- %t6 = call core.mul(%t4, %t5) :: float
7
+ %t6 = call core.mul:numeric(%t4, %t5) :: float
8
8
  yield %t6
9
9
  end_loop
10
10
  )
@@ -13,7 +13,7 @@
13
13
  loop items id=L2 in %t7 as el=%items_el_8, idx=%items_i_9
14
14
  %t10 = load_field items_el_8["price"] :: float
15
15
  %t11 = const 0.9 :: float
16
- %t12 = call core.mul(%t10, %t11) :: float
16
+ %t12 = call core.mul:numeric(%t10, %t11) :: float
17
17
  yield %t12
18
18
  end_loop
19
19
  )
@@ -4,7 +4,7 @@
4
4
  loop items id=L1 in %t1 as el=%items_el_2, idx=%items_i_3
5
5
  %t4 = load_field items_el_2["price"] :: float
6
6
  %t5 = load_field items_el_2["quantity"] :: integer
7
- %t6 = call core.mul(%t4, %t5) :: float
7
+ %t6 = call core.mul:numeric(%t4, %t5) :: float
8
8
  yield %t6
9
9
  end_loop
10
10
  )
@@ -13,7 +13,7 @@
13
13
  loop items id=L2 in %t7 as el=%items_el_8, idx=%items_i_9
14
14
  %t10 = load_field items_el_8["price"] :: float
15
15
  %t11 = const 0.9 :: float
16
- %t12 = call core.mul(%t10, %t11) :: float
16
+ %t12 = call core.mul:numeric(%t10, %t11) :: float
17
17
  yield %t12
18
18
  end_loop
19
19
  )
@@ -4,7 +4,7 @@
4
4
  loop items id=L1 in %t1 as el=%items_el_2, idx=%items_i_3
5
5
  %t4 = load_field items_el_2["price"] :: float
6
6
  %t5 = load_field items_el_2["quantity"] :: integer
7
- %t6 = call core.mul(%t4, %t5) :: float
7
+ %t6 = call core.mul:numeric(%t4, %t5) :: float
8
8
  yield %t6
9
9
  end_loop
10
10
  )
@@ -13,7 +13,7 @@
13
13
  loop items id=L2 in %t7 as el=%items_el_8, idx=%items_i_9
14
14
  %t10 = load_field items_el_8["price"] :: float
15
15
  %t11 = const 0.9 :: float
16
- %t12 = call core.mul(%t10, %t11) :: float
16
+ %t12 = call core.mul:numeric(%t10, %t11) :: float
17
17
  yield %t12
18
18
  end_loop
19
19
  )
@@ -4,7 +4,7 @@
4
4
  loop items id=L1 in %t1 as el=%items_el_2, idx=%items_i_3
5
5
  %t4 = load_field items_el_2["price"] :: float
6
6
  %t5 = load_field items_el_2["quantity"] :: integer
7
- %t6 = call core.mul(%t4, %t5) :: float
7
+ %t6 = call core.mul:numeric(%t4, %t5) :: float
8
8
  yield %t6
9
9
  end_loop
10
10
  )
@@ -13,7 +13,7 @@
13
13
  loop items id=L2 in %t7 as el=%items_el_8, idx=%items_i_9
14
14
  %t10 = load_field items_el_8["price"] :: float
15
15
  %t11 = const 0.9 :: float
16
- %t12 = call core.mul(%t10, %t11) :: float
16
+ %t12 = call core.mul:numeric(%t10, %t11) :: float
17
17
  yield %t12
18
18
  end_loop
19
19
  )
@@ -4,7 +4,7 @@
4
4
  loop items id=L1 in %t1 as el=%items_el_2, idx=%items_i_3
5
5
  %t4 = load_field items_el_2["price"] :: float
6
6
  %t5 = load_field items_el_2["quantity"] :: integer
7
- %t6 = call core.mul(%t4, %t5) :: float
7
+ %t6 = call core.mul:numeric(%t4, %t5) :: float
8
8
  yield %t6
9
9
  end_loop
10
10
  )
@@ -13,7 +13,7 @@
13
13
  %t11 = const 0.9 :: float
14
14
  loop items id=L2 in %t7 as el=%items_el_8, idx=%items_i_9
15
15
  %t10 = load_field items_el_8["price"] :: float
16
- %t12 = call core.mul(%t10, %t11) :: float
16
+ %t12 = call core.mul:numeric(%t10, %t11) :: float
17
17
  yield %t12
18
18
  end_loop
19
19
  )
@@ -4,7 +4,7 @@
4
4
  loop items id=L1 in %t1 as el=%items_el_2, idx=%items_i_3
5
5
  %t4 = load_field items_el_2["price"] :: float
6
6
  %t5 = load_field items_el_2["quantity"] :: integer
7
- %t6 = call core.mul(%t4, %t5) :: float
7
+ %t6 = call core.mul:numeric(%t4, %t5) :: float
8
8
  yield %t6
9
9
  end_loop
10
10
  )
@@ -13,7 +13,7 @@
13
13
  %t11 = const 0.9 :: float
14
14
  loop items id=L2 in %t7 as el=%items_el_8, idx=%items_i_9
15
15
  %t10 = load_field items_el_8["price"] :: float
16
- %t12 = call core.mul(%t10, %t11) :: float
16
+ %t12 = call core.mul:numeric(%t10, %t11) :: float
17
17
  yield %t12
18
18
  end_loop
19
19
  )
@@ -1,5 +1,5 @@
1
1
  # Autogenerated by Kumi Codegen
2
- module Kumi::Compiled::KUMI_0cb193cac7097725954d884c342db7afb7158942e3608106d1d84042f47fb997
2
+ module Kumi::Compiled::KUMI_b08d7f192e1ffb8868072e38be0c03320a56a08950f1fa98a5982614dd5d7a6d
3
3
  def self.from(input_data = nil)
4
4
  instance = Object.new
5
5
  instance.extend(self)
@@ -1,12 +1,12 @@
1
1
  (SNAST
2
2
  (VALUE subtotals
3
- (Call :core.mul
3
+ (Call :core.mul:numeric
4
4
  (InputRef items.item.price key_chain=[]) :: [items] -> float
5
5
  (InputRef items.item.quantity key_chain=[]) :: [items] -> integer
6
6
  ) :: [items] -> float
7
7
  ) :: [items] -> float
8
8
  (VALUE discounted_price
9
- (Call :core.mul
9
+ (Call :core.mul:numeric
10
10
  (InputRef items.item.price key_chain=[]) :: [items] -> float
11
11
  (Const 0.9) :: [] -> float
12
12
  ) :: [items] -> float
@@ -1,5 +1,5 @@
1
1
  # Autogenerated by Kumi Codegen
2
- module Kumi::Compiled::KUMI_ced9076f56216648b58d9ecbfaf37f152c120ca7fbea32964e0ef891829acbca
2
+ module Kumi::Compiled::KUMI_ea8e631bd824ece5423ddafc69362e81b847190a419fa644cf040bbe81b3c9f6
3
3
  def self.from(input_data = nil)
4
4
  instance = Object.new
5
5
  instance.extend(self)
@@ -1,5 +1,5 @@
1
1
  # Autogenerated by Kumi Codegen
2
- module Kumi::Compiled::KUMI_48491984ea6dc439d6851cae7cc74e9d139f13ab6290dea881bd89a3ee853b3b
2
+ module Kumi::Compiled::KUMI_6a70b58297ad4cc11ad823969c665f4a3b1fd2bfd9121ea025c8c5d197e491fe
3
3
  def self.from(input_data = nil)
4
4
  instance = Object.new
5
5
  instance.extend(self)
@@ -12,13 +12,13 @@
12
12
  (Declaration subtotal
13
13
  %t5 = load_decl price :: decimal
14
14
  %t6 = load_input "quantity" :: integer
15
- %t7 = call core.mul(%t5, %t6) :: integer
15
+ %t7 = call core.mul:numeric(%t5, %t6) :: integer
16
16
  yield %t7
17
17
  )
18
18
  (Declaration tax_amount
19
19
  %t8 = load_decl subtotal :: integer
20
20
  %t9 = load_decl rate :: decimal
21
- %t10 = call core.mul(%t8, %t9) :: integer
21
+ %t10 = call core.mul:numeric(%t8, %t9) :: integer
22
22
  yield %t10
23
23
  )
24
24
  (Declaration total
@@ -12,13 +12,13 @@
12
12
  (Declaration subtotal
13
13
  %t5 = load_decl price :: decimal
14
14
  %t6 = load_input "quantity" :: integer
15
- %t7 = call core.mul(%t5, %t6) :: integer
15
+ %t7 = call core.mul:numeric(%t5, %t6) :: integer
16
16
  yield %t7
17
17
  )
18
18
  (Declaration tax_amount
19
19
  %t8 = load_decl subtotal :: integer
20
20
  %t9 = load_decl rate :: decimal
21
- %t10 = call core.mul(%t8, %t9) :: integer
21
+ %t10 = call core.mul:numeric(%t8, %t9) :: integer
22
22
  yield %t10
23
23
  )
24
24
  (Declaration total