eyelang 1.3.8 → 1.4.0

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 (219) hide show
  1. package/README.md +19 -14
  2. package/SPEC.md +4 -4
  3. package/conformance/expected/core/001_fact_query.out +0 -8
  4. package/conformance/expected/core/002_rule_recursion.out +0 -41
  5. package/conformance/expected/core/003_terms_and_readback.out +0 -104
  6. package/conformance/expected/core/004_conjunction_and_parentheses.out +0 -25
  7. package/conformance/expected/core/005_list_deconstruction.out +0 -32
  8. package/conformance/expected/core/006_comma_formula_data.out +0 -15
  9. package/conformance/expected/core/007_anonymous_variables.out +0 -19
  10. package/conformance/expected/core/008_graphic_atoms.out +0 -24
  11. package/conformance/expected/core/009_comments_and_whitespace.out +0 -30
  12. package/conformance/expected/core/010_variable_scope_and_reuse.out +0 -52
  13. package/conformance/expected/core/011_predicate_arity.out +0 -30
  14. package/conformance/expected/core/012_nested_compound_unification.out +0 -30
  15. package/conformance/expected/core/013_multiple_clauses_order.out +0 -44
  16. package/conformance/expected/core/014_failure_filters_answers.out +0 -19
  17. package/conformance/expected/core/015_improper_list_unification.out +0 -45
  18. package/conformance/expected/core/016_zero_arity_compound.out +0 -15
  19. package/conformance/expected/core/017_three_step_recursion.out +0 -99
  20. package/conformance/expected/core/018_quoted_atom_readback.out +0 -45
  21. package/conformance/expected/core/019_parenthesized_three_conjuncts.out +0 -36
  22. package/conformance/expected/core/020_nested_list_terms.out +0 -30
  23. package/conformance/expected/extension/001_default_derived_output.out +0 -56
  24. package/conformance/expected/extension/002_materialize_focus.out +0 -22
  25. package/conformance/expected/extension/003_arithmetic_and_comparison.out +0 -148
  26. package/conformance/expected/extension/004_strings_and_atoms.out +0 -58
  27. package/conformance/expected/extension/005_lists_aggregation_ordering.out +0 -135
  28. package/conformance/expected/extension/006_formula_terms.out +0 -76
  29. package/conformance/expected/extension/007_negation_once_generators.out +0 -40
  30. package/conformance/expected/extension/008_equality_and_inequality.out +0 -58
  31. package/conformance/expected/extension/009_list_relations.out +0 -73
  32. package/conformance/expected/extension/010_append_splits.out +0 -45
  33. package/conformance/expected/extension/011_matching_and_comparison.out +0 -70
  34. package/conformance/expected/extension/012_memoize_declaration.out +0 -41
  35. package/conformance/expected/extension/013_numeric_functions.out +0 -105
  36. package/conformance/expected/extension/014_between_enumeration.out +0 -45
  37. package/conformance/expected/extension/015_smallest_divisor.out +0 -15
  38. package/conformance/expected/extension/016_negation_filter.out +0 -38
  39. package/conformance/expected/extension/017_once_user_predicate.out +0 -21
  40. package/conformance/expected/extension/018_findall_user_goal.out +0 -15
  41. package/conformance/expected/extension/019_sort_deduplicates_atoms.out +0 -15
  42. package/conformance/expected/extension/020_append_bound_prefix_suffix.out +0 -30
  43. package/conformance/expected/extension/021_nth0_index_generation.out +0 -15
  44. package/conformance/expected/extension/022_set_nth0_edges.out +0 -30
  45. package/conformance/expected/extension/023_select_duplicate_occurrences.out +0 -30
  46. package/conformance/expected/extension/024_not_member_filter.out +0 -19
  47. package/conformance/expected/extension/025_is_list_filter.out +0 -19
  48. package/conformance/expected/extension/026_nested_formula_terms.out +0 -114
  49. package/conformance/expected/extension/027_materialize_excludes_source_fact.out +0 -14
  50. package/conformance/expected/extension/028_numeric_and_lexical_comparison.out +0 -42
  51. package/conformance/expected/extension/029_string_matching_filters.out +0 -38
  52. package/conformance/expected/extension/030_string_and_atom_concat.out +0 -30
  53. package/conformance/expected/extension/031_countall_empty_and_nonempty.out +0 -18
  54. package/conformance/expected/extension/032_sumall_numeric_template.out +0 -8
  55. package/conformance/expected/extension/033_aggregate_min_template.out +0 -8
  56. package/conformance/expected/extension/034_aggregate_max_compound_key.out +0 -8
  57. package/examples/output/access-control-policy.pl +0 -156
  58. package/examples/output/ackermann.pl +0 -1240
  59. package/examples/output/age.pl +0 -69
  60. package/examples/output/aliases-and-namespaces.pl +0 -73
  61. package/examples/output/alignment-demo.pl +0 -862
  62. package/examples/output/allen-interval-calculus.pl +0 -9169
  63. package/examples/output/ancestor.pl +0 -134
  64. package/examples/output/animal.pl +0 -64
  65. package/examples/output/annotation.pl +0 -76
  66. package/examples/output/backward.pl +0 -21
  67. package/examples/output/basic-monadic.pl +0 -22770
  68. package/examples/output/bayes-diagnosis.pl +0 -195
  69. package/examples/output/bayes-therapy.pl +0 -34873
  70. package/examples/output/beam-deflection.pl +0 -222
  71. package/examples/output/blocks-world-planning.pl +0 -1339
  72. package/examples/output/bmi.pl +0 -1903
  73. package/examples/output/braking-safety-worlds.pl +0 -2452
  74. package/examples/output/buck-converter-design.pl +0 -663
  75. package/examples/output/cache-performance.pl +0 -306
  76. package/examples/output/canary-release.pl +0 -167
  77. package/examples/output/cat-koko.pl +0 -83
  78. package/examples/output/clinical-trial-screening.pl +0 -380
  79. package/examples/output/collatz-1000.pl +0 -19000
  80. package/examples/output/combinatorics-findall-sort.pl +0 -56
  81. package/examples/output/competitive-enzyme-kinetics.pl +0 -563
  82. package/examples/output/complex-matrix-stability.pl +0 -250
  83. package/examples/output/complex.pl +0 -653
  84. package/examples/output/composition-of-injective-functions-is-injective.pl +0 -256
  85. package/examples/output/context-association.pl +0 -75
  86. package/examples/output/control-system.pl +0 -328
  87. package/examples/output/cryptarithmetic-send-more-money.pl +0 -168
  88. package/examples/output/cyclic-path.pl +0 -504
  89. package/examples/output/d3-group.pl +0 -56
  90. package/examples/output/dairy-energy-balance.pl +0 -1034
  91. package/examples/output/data-negotiation.pl +0 -75
  92. package/examples/output/deep-taxonomy-10.pl +0 -1235
  93. package/examples/output/deep-taxonomy-100.pl +0 -1235
  94. package/examples/output/deep-taxonomy-1000.pl +0 -1235
  95. package/examples/output/deep-taxonomy-10000.pl +0 -2915
  96. package/examples/output/deep-taxonomy-100000.pl +0 -20240
  97. package/examples/output/delfour.pl +0 -2829
  98. package/examples/output/dense-hamiltonian-cycle.pl +0 -207
  99. package/examples/output/deontic-logic.pl +0 -105
  100. package/examples/output/derived-rule.pl +0 -41
  101. package/examples/output/diamond-property.pl +0 -303
  102. package/examples/output/dijkstra-findall-sort.pl +0 -484
  103. package/examples/output/dijkstra-risk-path.pl +0 -4841
  104. package/examples/output/dijkstra.pl +0 -1336
  105. package/examples/output/dining-philosophers.pl +0 -21646
  106. package/examples/output/dog.pl +0 -30
  107. package/examples/output/drone-corridor-planner.pl +0 -2466
  108. package/examples/output/easter-computus.pl +0 -5690
  109. package/examples/output/electrical-rc-filter.pl +0 -102
  110. package/examples/output/epidemic-policy.pl +0 -760
  111. package/examples/output/equivalence-classes-overlap-implies-same-class.pl +0 -1080
  112. package/examples/output/eulerian-path.pl +0 -383
  113. package/examples/output/ev-range-worlds.pl +0 -2294
  114. package/examples/output/exact-cover-sudoku.pl +0 -396
  115. package/examples/output/existential-rule.pl +0 -38
  116. package/examples/output/exoplanet-validation-worlds.pl +0 -1904
  117. package/examples/output/expression-eval.pl +0 -104
  118. package/examples/output/family-cousins.pl +0 -3852
  119. package/examples/output/fastpow.pl +0 -1064
  120. package/examples/output/fft8-numeric.pl +0 -2556
  121. package/examples/output/fibonacci.pl +0 -2060
  122. package/examples/output/field-nitrogen-balance.pl +0 -1452
  123. package/examples/output/floating-point.pl +0 -151
  124. package/examples/output/four-color-map.pl +0 -191
  125. package/examples/output/fundamental-theorem-arithmetic.pl +0 -1610
  126. package/examples/output/gcd-bezout-identity.pl +0 -1842
  127. package/examples/output/gd-step-certified.pl +0 -32354
  128. package/examples/output/gdpr-compliance.pl +0 -193
  129. package/examples/output/goldbach-1000.pl +0 -17490
  130. package/examples/output/good-cobbler.pl +0 -15
  131. package/examples/output/gps.pl +0 -4166
  132. package/examples/output/graph-reachability.pl +0 -148
  133. package/examples/output/gray-code-counter.pl +0 -835
  134. package/examples/output/greatest-lower-bound-uniqueness.pl +0 -148
  135. package/examples/output/group-inverse-uniqueness.pl +0 -82
  136. package/examples/output/hamiltonian-cycle.pl +0 -102
  137. package/examples/output/hamiltonian-path.pl +0 -14157
  138. package/examples/output/hamming-code.pl +0 -2665
  139. package/examples/output/hanoi.pl +0 -184
  140. package/examples/output/heat-loss.pl +0 -223
  141. package/examples/output/heron-theorem.pl +0 -253
  142. package/examples/output/ideal-gas-law.pl +0 -148
  143. package/examples/output/illegitimate-reasoning.pl +0 -530
  144. package/examples/output/kaprekar.pl +0 -208
  145. package/examples/output/law-of-cosines.pl +0 -165
  146. package/examples/output/least-squares-regression.pl +0 -1447
  147. package/examples/output/list-collection.pl +0 -49
  148. package/examples/output/lldm.pl +0 -17298
  149. package/examples/output/manufacturing-quality-control.pl +0 -562
  150. package/examples/output/matrix.pl +0 -206
  151. package/examples/output/microgrid-dispatch.pl +0 -787
  152. package/examples/output/monkey-bananas.pl +0 -575
  153. package/examples/output/n-queens.pl +0 -2046
  154. package/examples/output/network-sla.pl +0 -282
  155. package/examples/output/newton-raphson.pl +0 -756
  156. package/examples/output/nixon-diamond.pl +0 -176
  157. package/examples/output/odrl-dpv-healthcare-risk-ranked.pl +0 -6148
  158. package/examples/output/odrl-dpv-risk-ranked.pl +0 -12961
  159. package/examples/output/orbital-transfer-design.pl +0 -961
  160. package/examples/output/path-discovery.pl +0 -333
  161. package/examples/output/peano-arithmetic.pl +0 -1432
  162. package/examples/output/peasant.pl +0 -190
  163. package/examples/output/pendulum-period.pl +0 -271
  164. package/examples/output/polynomial.pl +0 -7952
  165. package/examples/output/project-portfolio-optimization.pl +0 -93
  166. package/examples/output/proof-contrapositive.pl +0 -75
  167. package/examples/output/quadratic-formula.pl +0 -454
  168. package/examples/output/quine-mccluskey.pl +0 -188
  169. package/examples/output/radioactive-decay.pl +0 -299
  170. package/examples/output/sat-dpll.pl +0 -121
  171. package/examples/output/security-incident-correlation.pl +0 -267
  172. package/examples/output/service-impact.pl +0 -457
  173. package/examples/output/sieve.pl +0 -19
  174. package/examples/output/skolem-functions.pl +0 -264
  175. package/examples/output/socket-age.pl +0 -31
  176. package/examples/output/socket-family.pl +0 -56
  177. package/examples/output/socrates.pl +0 -36
  178. package/examples/output/statistics-summary.pl +0 -741
  179. package/examples/output/sudoku.pl +0 -38
  180. package/examples/output/superdense-coding.pl +0 -476
  181. package/examples/output/traveling-salesman.pl +0 -284
  182. package/examples/output/turing.pl +0 -2144
  183. package/examples/output/vector-similarity.pl +0 -421
  184. package/examples/output/witch.pl +0 -209
  185. package/examples/output/wolf-goat-cabbage.pl +0 -900
  186. package/examples/output/zebra.pl +0 -401
  187. package/examples/proof/age.pl +71 -0
  188. package/examples/proof/aliases-and-namespaces.pl +78 -0
  189. package/examples/proof/ancestor.pl +140 -0
  190. package/examples/proof/animal.pl +68 -0
  191. package/examples/proof/annotation.pl +80 -0
  192. package/examples/proof/backward.pl +22 -0
  193. package/examples/proof/cat-koko.pl +86 -0
  194. package/examples/proof/data-negotiation.pl +76 -0
  195. package/examples/proof/derived-rule.pl +43 -0
  196. package/examples/proof/dog.pl +31 -0
  197. package/examples/proof/electrical-rc-filter.pl +105 -0
  198. package/examples/proof/existential-rule.pl +40 -0
  199. package/examples/proof/floating-point.pl +160 -0
  200. package/examples/proof/good-cobbler.pl +16 -0
  201. package/examples/proof/group-inverse-uniqueness.pl +84 -0
  202. package/examples/proof/list-collection.pl +52 -0
  203. package/examples/proof/proof-contrapositive.pl +78 -0
  204. package/examples/proof/socket-age.pl +32 -0
  205. package/examples/proof/socket-family.pl +59 -0
  206. package/examples/proof/socrates.pl +38 -0
  207. package/examples/socket-age.pl +4 -4
  208. package/examples/socket-family.pl +4 -4
  209. package/package.json +1 -1
  210. package/playground-worker.mjs +4 -4
  211. package/playground.html +15 -15
  212. package/src/cli.js +10 -10
  213. package/src/index.js +3 -2
  214. package/src/parser.js +130 -1
  215. package/src/program.js +33 -27
  216. package/test/run-all.js +0 -0
  217. package/test/run-conformance.js +0 -0
  218. package/test/run-examples.js +38 -8
  219. package/test/run-regression.js +29 -28
@@ -1,1935 +1,32 @@
1
1
  weightKg(case, 72.0).
2
- why(
3
- weightKg(case, 72.0),
4
- proof(
5
- goal(weightKg(case, 72.0)),
6
- by(rule("bmi.pl", clause(35))),
7
- bindings([binding("W", 72.0)]),
8
- uses([
9
- proof(
10
- goal(unitSystem(input, metric)),
11
- by(fact("bmi.pl", clause(32)))
12
- ),
13
- proof(
14
- goal(weight(input, 72.0)),
15
- by(fact("bmi.pl", clause(33)))
16
- )
17
- ])
18
- )
19
- ).
20
-
21
2
  heightM(case, 1.78).
22
- why(
23
- heightM(case, 1.78),
24
- proof(
25
- goal(heightM(case, 1.78)),
26
- by(rule("bmi.pl", clause(36))),
27
- bindings([binding("M", 1.78), binding("H", 178.0)]),
28
- uses([
29
- proof(
30
- goal(unitSystem(input, metric)),
31
- by(fact("bmi.pl", clause(32)))
32
- ),
33
- proof(
34
- goal(height(input, 178.0)),
35
- by(fact("bmi.pl", clause(34)))
36
- ),
37
- proof(
38
- goal(div(178.0, 100.0, 1.78)),
39
- by(builtin(div, 3))
40
- )
41
- ])
42
- )
43
- ).
44
-
45
3
  units(reason, "Inputs were already metric, so kilograms stay kilograms and centimeters are divided by 100 to obtain meters.").
46
- why(
47
- units(reason, "Inputs were already metric, so kilograms stay kilograms and centimeters are divided by 100 to obtain meters."),
48
- proof(
49
- goal(units(reason, "Inputs were already metric, so kilograms stay kilograms and centimeters are divided by 100 to obtain meters.")),
50
- by(rule("bmi.pl", clause(37))),
51
- uses([
52
- proof(
53
- goal(unitSystem(input, metric)),
54
- by(fact("bmi.pl", clause(32)))
55
- )
56
- ])
57
- )
58
- ).
59
-
60
4
  heightSquared(case, 3.1684000000000001).
61
- why(
62
- heightSquared(case, 3.1684000000000001),
63
- proof(
64
- goal(heightSquared(case, 3.1684000000000001)),
65
- by(rule("bmi.pl", clause(41))),
66
- bindings([binding("M2", 3.1684000000000001), binding("M", 1.78)]),
67
- uses([
68
- proof(
69
- goal(heightM(case, 1.78)),
70
- by(rule("bmi.pl", clause(36))),
71
- bindings([binding("M", 1.78), binding("H", 178.0)]),
72
- uses([
73
- proof(
74
- goal(unitSystem(input, metric)),
75
- by(fact("bmi.pl", clause(32)))
76
- ),
77
- proof(
78
- goal(height(input, 178.0)),
79
- by(fact("bmi.pl", clause(34)))
80
- ),
81
- proof(
82
- goal(div(178.0, 100.0, 1.78)),
83
- by(builtin(div, 3))
84
- )
85
- ])
86
- ),
87
- proof(
88
- goal(mul(1.78, 1.78, 3.1684000000000001)),
89
- by(builtin(mul, 3))
90
- )
91
- ])
92
- )
93
- ).
94
-
95
5
  bmi(case, 22.724403484408533).
96
- why(
97
- bmi(case, 22.724403484408533),
98
- proof(
99
- goal(bmi(case, 22.724403484408533)),
100
- by(rule("bmi.pl", clause(42))),
101
- bindings([binding("Bmi", 22.724403484408533), binding("Kg", 72.0), binding("M2", 3.1684000000000001)]),
102
- uses([
103
- proof(
104
- goal(weightKg(case, 72.0)),
105
- by(rule("bmi.pl", clause(35))),
106
- bindings([binding("W", 72.0)]),
107
- uses([
108
- proof(
109
- goal(unitSystem(input, metric)),
110
- by(fact("bmi.pl", clause(32)))
111
- ),
112
- proof(
113
- goal(weight(input, 72.0)),
114
- by(fact("bmi.pl", clause(33)))
115
- )
116
- ])
117
- ),
118
- proof(
119
- goal(heightSquared(case, 3.1684000000000001)),
120
- by(rule("bmi.pl", clause(41))),
121
- bindings([binding("M2", 3.1684000000000001), binding("M", 1.78)]),
122
- uses([
123
- proof(
124
- goal(heightM(case, 1.78)),
125
- by(rule("bmi.pl", clause(36))),
126
- bindings([binding("M", 1.78), binding("H", 178.0)]),
127
- uses([
128
- proof(
129
- goal(unitSystem(input, metric)),
130
- by(fact("bmi.pl", clause(32)))
131
- ),
132
- proof(
133
- goal(height(input, 178.0)),
134
- by(fact("bmi.pl", clause(34)))
135
- ),
136
- proof(
137
- goal(div(178.0, 100.0, 1.78)),
138
- by(builtin(div, 3))
139
- )
140
- ])
141
- ),
142
- proof(
143
- goal(mul(1.78, 1.78, 3.1684000000000001)),
144
- by(builtin(mul, 3))
145
- )
146
- ])
147
- ),
148
- proof(
149
- goal(div(72.0, 3.1684000000000001, 22.724403484408533)),
150
- by(builtin(div, 3))
151
- )
152
- ])
153
- )
154
- ).
155
-
156
6
  bmi(answer, 22.72).
157
- why(
158
- bmi(answer, 22.72),
159
- proof(
160
- goal(bmi(answer, 22.72)),
161
- by(rule("bmi.pl", clause(54))),
162
- uses([
163
- proof(
164
- goal(bmiRoundedInt(case, 2272)),
165
- by(rule("bmi.pl", clause(43))),
166
- bindings([binding("BmiRoundedInt", 2272), binding("Bmi", 22.724403484408533), binding("BmiX100", 2272.4403484408535)]),
167
- uses([
168
- proof(
169
- goal(bmi(case, 22.724403484408533)),
170
- by(rule("bmi.pl", clause(42))),
171
- bindings([binding("Bmi", 22.724403484408533), binding("Kg", 72.0), binding("M2", 3.1684000000000001)]),
172
- uses([
173
- proof(
174
- goal(weightKg(case, 72.0)),
175
- by(rule("bmi.pl", clause(35))),
176
- bindings([binding("W", 72.0)]),
177
- uses([
178
- proof(
179
- goal(unitSystem(input, metric)),
180
- by(fact("bmi.pl", clause(32)))
181
- ),
182
- proof(
183
- goal(weight(input, 72.0)),
184
- by(fact("bmi.pl", clause(33)))
185
- )
186
- ])
187
- ),
188
- proof(
189
- goal(heightSquared(case, 3.1684000000000001)),
190
- by(rule("bmi.pl", clause(41))),
191
- bindings([binding("M2", 3.1684000000000001), binding("M", 1.78)]),
192
- uses([
193
- proof(
194
- goal(heightM(case, 1.78)),
195
- by(rule("bmi.pl", clause(36))),
196
- bindings([binding("M", 1.78), binding("H", 178.0)]),
197
- uses([
198
- proof(
199
- goal(unitSystem(input, metric)),
200
- by(fact("bmi.pl", clause(32)))
201
- ),
202
- proof(
203
- goal(height(input, 178.0)),
204
- by(fact("bmi.pl", clause(34)))
205
- ),
206
- proof(
207
- goal(div(178.0, 100.0, 1.78)),
208
- by(builtin(div, 3))
209
- )
210
- ])
211
- ),
212
- proof(
213
- goal(mul(1.78, 1.78, 3.1684000000000001)),
214
- by(builtin(mul, 3))
215
- )
216
- ])
217
- ),
218
- proof(
219
- goal(div(72.0, 3.1684000000000001, 22.724403484408533)),
220
- by(builtin(div, 3))
221
- )
222
- ])
223
- ),
224
- proof(
225
- goal(mul(22.724403484408533, 100.0, 2272.4403484408535)),
226
- by(builtin(mul, 3))
227
- ),
228
- proof(
229
- goal(rounded(2272.4403484408535, 2272)),
230
- by(builtin(rounded, 2))
231
- )
232
- ])
233
- )
234
- ])
235
- )
236
- ).
237
-
238
7
  bmiRoundedInt(case, 2272).
239
- why(
240
- bmiRoundedInt(case, 2272),
241
- proof(
242
- goal(bmiRoundedInt(case, 2272)),
243
- by(rule("bmi.pl", clause(43))),
244
- bindings([binding("BmiRoundedInt", 2272), binding("Bmi", 22.724403484408533), binding("BmiX100", 2272.4403484408535)]),
245
- uses([
246
- proof(
247
- goal(bmi(case, 22.724403484408533)),
248
- by(rule("bmi.pl", clause(42))),
249
- bindings([binding("Bmi", 22.724403484408533), binding("Kg", 72.0), binding("M2", 3.1684000000000001)]),
250
- uses([
251
- proof(
252
- goal(weightKg(case, 72.0)),
253
- by(rule("bmi.pl", clause(35))),
254
- bindings([binding("W", 72.0)]),
255
- uses([
256
- proof(
257
- goal(unitSystem(input, metric)),
258
- by(fact("bmi.pl", clause(32)))
259
- ),
260
- proof(
261
- goal(weight(input, 72.0)),
262
- by(fact("bmi.pl", clause(33)))
263
- )
264
- ])
265
- ),
266
- proof(
267
- goal(heightSquared(case, 3.1684000000000001)),
268
- by(rule("bmi.pl", clause(41))),
269
- bindings([binding("M2", 3.1684000000000001), binding("M", 1.78)]),
270
- uses([
271
- proof(
272
- goal(heightM(case, 1.78)),
273
- by(rule("bmi.pl", clause(36))),
274
- bindings([binding("M", 1.78), binding("H", 178.0)]),
275
- uses([
276
- proof(
277
- goal(unitSystem(input, metric)),
278
- by(fact("bmi.pl", clause(32)))
279
- ),
280
- proof(
281
- goal(height(input, 178.0)),
282
- by(fact("bmi.pl", clause(34)))
283
- ),
284
- proof(
285
- goal(div(178.0, 100.0, 1.78)),
286
- by(builtin(div, 3))
287
- )
288
- ])
289
- ),
290
- proof(
291
- goal(mul(1.78, 1.78, 3.1684000000000001)),
292
- by(builtin(mul, 3))
293
- )
294
- ])
295
- ),
296
- proof(
297
- goal(div(72.0, 3.1684000000000001, 22.724403484408533)),
298
- by(builtin(div, 3))
299
- )
300
- ])
301
- ),
302
- proof(
303
- goal(mul(22.724403484408533, 100.0, 2272.4403484408535)),
304
- by(builtin(mul, 3))
305
- ),
306
- proof(
307
- goal(rounded(2272.4403484408535, 2272)),
308
- by(builtin(rounded, 2))
309
- )
310
- ])
311
- )
312
- ).
313
-
314
8
  healthyMinKg(case, 58.615400000000001).
315
- why(
316
- healthyMinKg(case, 58.615400000000001),
317
- proof(
318
- goal(healthyMinKg(case, 58.615400000000001)),
319
- by(rule("bmi.pl", clause(44))),
320
- bindings([binding("HealthyMin", 58.615400000000001), binding("M2", 3.1684000000000001)]),
321
- uses([
322
- proof(
323
- goal(heightSquared(case, 3.1684000000000001)),
324
- by(rule("bmi.pl", clause(41))),
325
- bindings([binding("M2", 3.1684000000000001), binding("M", 1.78)]),
326
- uses([
327
- proof(
328
- goal(heightM(case, 1.78)),
329
- by(rule("bmi.pl", clause(36))),
330
- bindings([binding("M", 1.78), binding("H", 178.0)]),
331
- uses([
332
- proof(
333
- goal(unitSystem(input, metric)),
334
- by(fact("bmi.pl", clause(32)))
335
- ),
336
- proof(
337
- goal(height(input, 178.0)),
338
- by(fact("bmi.pl", clause(34)))
339
- ),
340
- proof(
341
- goal(div(178.0, 100.0, 1.78)),
342
- by(builtin(div, 3))
343
- )
344
- ])
345
- ),
346
- proof(
347
- goal(mul(1.78, 1.78, 3.1684000000000001)),
348
- by(builtin(mul, 3))
349
- )
350
- ])
351
- ),
352
- proof(
353
- goal(mul(18.5, 3.1684000000000001, 58.615400000000001)),
354
- by(builtin(mul, 3))
355
- )
356
- ])
357
- )
358
- ).
359
-
360
9
  healthyMinKg(answer, 58.6).
361
- why(
362
- healthyMinKg(answer, 58.6),
363
- proof(
364
- goal(healthyMinKg(answer, 58.6)),
365
- by(rule("bmi.pl", clause(56))),
366
- uses([
367
- proof(
368
- goal(healthyMinKgRoundedInt(case, 586)),
369
- by(rule("bmi.pl", clause(46))),
370
- bindings([binding("MinRoundedInt", 586), binding("HealthyMin", 58.615400000000001), binding("MinX10", 586.154)]),
371
- uses([
372
- proof(
373
- goal(healthyMinKg(case, 58.615400000000001)),
374
- by(rule("bmi.pl", clause(44))),
375
- bindings([binding("HealthyMin", 58.615400000000001), binding("M2", 3.1684000000000001)]),
376
- uses([
377
- proof(
378
- goal(heightSquared(case, 3.1684000000000001)),
379
- by(rule("bmi.pl", clause(41))),
380
- bindings([binding("M2", 3.1684000000000001), binding("M", 1.78)]),
381
- uses([
382
- proof(
383
- goal(heightM(case, 1.78)),
384
- by(rule("bmi.pl", clause(36))),
385
- bindings([binding("M", 1.78), binding("H", 178.0)]),
386
- uses([
387
- proof(
388
- goal(unitSystem(input, metric)),
389
- by(fact("bmi.pl", clause(32)))
390
- ),
391
- proof(
392
- goal(height(input, 178.0)),
393
- by(fact("bmi.pl", clause(34)))
394
- ),
395
- proof(
396
- goal(div(178.0, 100.0, 1.78)),
397
- by(builtin(div, 3))
398
- )
399
- ])
400
- ),
401
- proof(
402
- goal(mul(1.78, 1.78, 3.1684000000000001)),
403
- by(builtin(mul, 3))
404
- )
405
- ])
406
- ),
407
- proof(
408
- goal(mul(18.5, 3.1684000000000001, 58.615400000000001)),
409
- by(builtin(mul, 3))
410
- )
411
- ])
412
- ),
413
- proof(
414
- goal(mul(58.615400000000001, 10.0, 586.154)),
415
- by(builtin(mul, 3))
416
- ),
417
- proof(
418
- goal(rounded(586.154, 586)),
419
- by(builtin(rounded, 2))
420
- )
421
- ])
422
- )
423
- ])
424
- )
425
- ).
426
-
427
10
  healthyMaxKg(case, 78.893159999999995).
428
- why(
429
- healthyMaxKg(case, 78.893159999999995),
430
- proof(
431
- goal(healthyMaxKg(case, 78.893159999999995)),
432
- by(rule("bmi.pl", clause(45))),
433
- bindings([binding("HealthyMax", 78.893159999999995), binding("M2", 3.1684000000000001)]),
434
- uses([
435
- proof(
436
- goal(heightSquared(case, 3.1684000000000001)),
437
- by(rule("bmi.pl", clause(41))),
438
- bindings([binding("M2", 3.1684000000000001), binding("M", 1.78)]),
439
- uses([
440
- proof(
441
- goal(heightM(case, 1.78)),
442
- by(rule("bmi.pl", clause(36))),
443
- bindings([binding("M", 1.78), binding("H", 178.0)]),
444
- uses([
445
- proof(
446
- goal(unitSystem(input, metric)),
447
- by(fact("bmi.pl", clause(32)))
448
- ),
449
- proof(
450
- goal(height(input, 178.0)),
451
- by(fact("bmi.pl", clause(34)))
452
- ),
453
- proof(
454
- goal(div(178.0, 100.0, 1.78)),
455
- by(builtin(div, 3))
456
- )
457
- ])
458
- ),
459
- proof(
460
- goal(mul(1.78, 1.78, 3.1684000000000001)),
461
- by(builtin(mul, 3))
462
- )
463
- ])
464
- ),
465
- proof(
466
- goal(mul(24.9, 3.1684000000000001, 78.893159999999995)),
467
- by(builtin(mul, 3))
468
- )
469
- ])
470
- )
471
- ).
472
-
473
11
  healthyMaxKg(answer, 78.9).
474
- why(
475
- healthyMaxKg(answer, 78.9),
476
- proof(
477
- goal(healthyMaxKg(answer, 78.9)),
478
- by(rule("bmi.pl", clause(57))),
479
- uses([
480
- proof(
481
- goal(healthyMaxKgRoundedInt(case, 789)),
482
- by(rule("bmi.pl", clause(47))),
483
- bindings([binding("MaxRoundedInt", 789), binding("HealthyMax", 78.893159999999995), binding("MaxX10", 788.93159999999989)]),
484
- uses([
485
- proof(
486
- goal(healthyMaxKg(case, 78.893159999999995)),
487
- by(rule("bmi.pl", clause(45))),
488
- bindings([binding("HealthyMax", 78.893159999999995), binding("M2", 3.1684000000000001)]),
489
- uses([
490
- proof(
491
- goal(heightSquared(case, 3.1684000000000001)),
492
- by(rule("bmi.pl", clause(41))),
493
- bindings([binding("M2", 3.1684000000000001), binding("M", 1.78)]),
494
- uses([
495
- proof(
496
- goal(heightM(case, 1.78)),
497
- by(rule("bmi.pl", clause(36))),
498
- bindings([binding("M", 1.78), binding("H", 178.0)]),
499
- uses([
500
- proof(
501
- goal(unitSystem(input, metric)),
502
- by(fact("bmi.pl", clause(32)))
503
- ),
504
- proof(
505
- goal(height(input, 178.0)),
506
- by(fact("bmi.pl", clause(34)))
507
- ),
508
- proof(
509
- goal(div(178.0, 100.0, 1.78)),
510
- by(builtin(div, 3))
511
- )
512
- ])
513
- ),
514
- proof(
515
- goal(mul(1.78, 1.78, 3.1684000000000001)),
516
- by(builtin(mul, 3))
517
- )
518
- ])
519
- ),
520
- proof(
521
- goal(mul(24.9, 3.1684000000000001, 78.893159999999995)),
522
- by(builtin(mul, 3))
523
- )
524
- ])
525
- ),
526
- proof(
527
- goal(mul(78.893159999999995, 10.0, 788.93159999999989)),
528
- by(builtin(mul, 3))
529
- ),
530
- proof(
531
- goal(rounded(788.93159999999989, 789)),
532
- by(builtin(rounded, 2))
533
- )
534
- ])
535
- )
536
- ])
537
- )
538
- ).
539
-
540
12
  healthyMinKgRoundedInt(case, 586).
541
- why(
542
- healthyMinKgRoundedInt(case, 586),
543
- proof(
544
- goal(healthyMinKgRoundedInt(case, 586)),
545
- by(rule("bmi.pl", clause(46))),
546
- bindings([binding("MinRoundedInt", 586), binding("HealthyMin", 58.615400000000001), binding("MinX10", 586.154)]),
547
- uses([
548
- proof(
549
- goal(healthyMinKg(case, 58.615400000000001)),
550
- by(rule("bmi.pl", clause(44))),
551
- bindings([binding("HealthyMin", 58.615400000000001), binding("M2", 3.1684000000000001)]),
552
- uses([
553
- proof(
554
- goal(heightSquared(case, 3.1684000000000001)),
555
- by(rule("bmi.pl", clause(41))),
556
- bindings([binding("M2", 3.1684000000000001), binding("M", 1.78)]),
557
- uses([
558
- proof(
559
- goal(heightM(case, 1.78)),
560
- by(rule("bmi.pl", clause(36))),
561
- bindings([binding("M", 1.78), binding("H", 178.0)]),
562
- uses([
563
- proof(
564
- goal(unitSystem(input, metric)),
565
- by(fact("bmi.pl", clause(32)))
566
- ),
567
- proof(
568
- goal(height(input, 178.0)),
569
- by(fact("bmi.pl", clause(34)))
570
- ),
571
- proof(
572
- goal(div(178.0, 100.0, 1.78)),
573
- by(builtin(div, 3))
574
- )
575
- ])
576
- ),
577
- proof(
578
- goal(mul(1.78, 1.78, 3.1684000000000001)),
579
- by(builtin(mul, 3))
580
- )
581
- ])
582
- ),
583
- proof(
584
- goal(mul(18.5, 3.1684000000000001, 58.615400000000001)),
585
- by(builtin(mul, 3))
586
- )
587
- ])
588
- ),
589
- proof(
590
- goal(mul(58.615400000000001, 10.0, 586.154)),
591
- by(builtin(mul, 3))
592
- ),
593
- proof(
594
- goal(rounded(586.154, 586)),
595
- by(builtin(rounded, 2))
596
- )
597
- ])
598
- )
599
- ).
600
-
601
13
  healthyMaxKgRoundedInt(case, 789).
602
- why(
603
- healthyMaxKgRoundedInt(case, 789),
604
- proof(
605
- goal(healthyMaxKgRoundedInt(case, 789)),
606
- by(rule("bmi.pl", clause(47))),
607
- bindings([binding("MaxRoundedInt", 789), binding("HealthyMax", 78.893159999999995), binding("MaxX10", 788.93159999999989)]),
608
- uses([
609
- proof(
610
- goal(healthyMaxKg(case, 78.893159999999995)),
611
- by(rule("bmi.pl", clause(45))),
612
- bindings([binding("HealthyMax", 78.893159999999995), binding("M2", 3.1684000000000001)]),
613
- uses([
614
- proof(
615
- goal(heightSquared(case, 3.1684000000000001)),
616
- by(rule("bmi.pl", clause(41))),
617
- bindings([binding("M2", 3.1684000000000001), binding("M", 1.78)]),
618
- uses([
619
- proof(
620
- goal(heightM(case, 1.78)),
621
- by(rule("bmi.pl", clause(36))),
622
- bindings([binding("M", 1.78), binding("H", 178.0)]),
623
- uses([
624
- proof(
625
- goal(unitSystem(input, metric)),
626
- by(fact("bmi.pl", clause(32)))
627
- ),
628
- proof(
629
- goal(height(input, 178.0)),
630
- by(fact("bmi.pl", clause(34)))
631
- ),
632
- proof(
633
- goal(div(178.0, 100.0, 1.78)),
634
- by(builtin(div, 3))
635
- )
636
- ])
637
- ),
638
- proof(
639
- goal(mul(1.78, 1.78, 3.1684000000000001)),
640
- by(builtin(mul, 3))
641
- )
642
- ])
643
- ),
644
- proof(
645
- goal(mul(24.9, 3.1684000000000001, 78.893159999999995)),
646
- by(builtin(mul, 3))
647
- )
648
- ])
649
- ),
650
- proof(
651
- goal(mul(78.893159999999995, 10.0, 788.93159999999989)),
652
- by(builtin(mul, 3))
653
- ),
654
- proof(
655
- goal(rounded(788.93159999999989, 789)),
656
- by(builtin(rounded, 2))
657
- )
658
- ])
659
- )
660
- ).
661
-
662
14
  category(decision, "Normal").
663
- why(
664
- category(decision, "Normal"),
665
- proof(
666
- goal(category(decision, "Normal")),
667
- by(rule("bmi.pl", clause(49))),
668
- bindings([binding("Bmi", 22.724403484408533)]),
669
- uses([
670
- proof(
671
- goal(bmi(case, 22.724403484408533)),
672
- by(rule("bmi.pl", clause(42))),
673
- bindings([binding("Bmi", 22.724403484408533), binding("Kg", 72.0), binding("M2", 3.1684000000000001)]),
674
- uses([
675
- proof(
676
- goal(weightKg(case, 72.0)),
677
- by(rule("bmi.pl", clause(35))),
678
- bindings([binding("W", 72.0)]),
679
- uses([
680
- proof(
681
- goal(unitSystem(input, metric)),
682
- by(fact("bmi.pl", clause(32)))
683
- ),
684
- proof(
685
- goal(weight(input, 72.0)),
686
- by(fact("bmi.pl", clause(33)))
687
- )
688
- ])
689
- ),
690
- proof(
691
- goal(heightSquared(case, 3.1684000000000001)),
692
- by(rule("bmi.pl", clause(41))),
693
- bindings([binding("M2", 3.1684000000000001), binding("M", 1.78)]),
694
- uses([
695
- proof(
696
- goal(heightM(case, 1.78)),
697
- by(rule("bmi.pl", clause(36))),
698
- bindings([binding("M", 1.78), binding("H", 178.0)]),
699
- uses([
700
- proof(
701
- goal(unitSystem(input, metric)),
702
- by(fact("bmi.pl", clause(32)))
703
- ),
704
- proof(
705
- goal(height(input, 178.0)),
706
- by(fact("bmi.pl", clause(34)))
707
- ),
708
- proof(
709
- goal(div(178.0, 100.0, 1.78)),
710
- by(builtin(div, 3))
711
- )
712
- ])
713
- ),
714
- proof(
715
- goal(mul(1.78, 1.78, 3.1684000000000001)),
716
- by(builtin(mul, 3))
717
- )
718
- ])
719
- ),
720
- proof(
721
- goal(div(72.0, 3.1684000000000001, 22.724403484408533)),
722
- by(builtin(div, 3))
723
- )
724
- ])
725
- ),
726
- proof(
727
- goal(ge(22.724403484408533, 18.5)),
728
- by(builtin(ge, 2))
729
- ),
730
- proof(
731
- goal(lt(22.724403484408533, 25.0)),
732
- by(builtin(lt, 2))
733
- )
734
- ])
735
- )
736
- ).
737
-
738
15
  category(answer, "Normal").
739
- why(
740
- category(answer, "Normal"),
741
- proof(
742
- goal(category(answer, "Normal")),
743
- by(rule("bmi.pl", clause(55))),
744
- bindings([binding("Category", "Normal")]),
745
- uses([
746
- proof(
747
- goal(category(decision, "Normal")),
748
- by(rule("bmi.pl", clause(49))),
749
- bindings([binding("Bmi", 22.724403484408533)]),
750
- uses([
751
- proof(
752
- goal(bmi(case, 22.724403484408533)),
753
- by(rule("bmi.pl", clause(42))),
754
- bindings([binding("Bmi", 22.724403484408533), binding("Kg", 72.0), binding("M2", 3.1684000000000001)]),
755
- uses([
756
- proof(
757
- goal(weightKg(case, 72.0)),
758
- by(rule("bmi.pl", clause(35))),
759
- bindings([binding("W", 72.0)]),
760
- uses([
761
- proof(
762
- goal(unitSystem(input, metric)),
763
- by(fact("bmi.pl", clause(32)))
764
- ),
765
- proof(
766
- goal(weight(input, 72.0)),
767
- by(fact("bmi.pl", clause(33)))
768
- )
769
- ])
770
- ),
771
- proof(
772
- goal(heightSquared(case, 3.1684000000000001)),
773
- by(rule("bmi.pl", clause(41))),
774
- bindings([binding("M2", 3.1684000000000001), binding("M", 1.78)]),
775
- uses([
776
- proof(
777
- goal(heightM(case, 1.78)),
778
- by(rule("bmi.pl", clause(36))),
779
- bindings([binding("M", 1.78), binding("H", 178.0)]),
780
- uses([
781
- proof(
782
- goal(unitSystem(input, metric)),
783
- by(fact("bmi.pl", clause(32)))
784
- ),
785
- proof(
786
- goal(height(input, 178.0)),
787
- by(fact("bmi.pl", clause(34)))
788
- ),
789
- proof(
790
- goal(div(178.0, 100.0, 1.78)),
791
- by(builtin(div, 3))
792
- )
793
- ])
794
- ),
795
- proof(
796
- goal(mul(1.78, 1.78, 3.1684000000000001)),
797
- by(builtin(mul, 3))
798
- )
799
- ])
800
- ),
801
- proof(
802
- goal(div(72.0, 3.1684000000000001, 22.724403484408533)),
803
- by(builtin(div, 3))
804
- )
805
- ])
806
- ),
807
- proof(
808
- goal(ge(22.724403484408533, 18.5)),
809
- by(builtin(ge, 2))
810
- ),
811
- proof(
812
- goal(lt(22.724403484408533, 25.0)),
813
- by(builtin(lt, 2))
814
- )
815
- ])
816
- )
817
- ])
818
- )
819
- ).
820
-
821
16
  heightCm(answer, 178).
822
- why(
823
- heightCm(answer, 178),
824
- proof(
825
- goal(heightCm(answer, 178)),
826
- by(rule("bmi.pl", clause(58))),
827
- bindings([binding("CmRounded", 178), binding("M", 1.78), binding("Cm", 178.0)]),
828
- uses([
829
- proof(
830
- goal(heightM(case, 1.78)),
831
- by(rule("bmi.pl", clause(36))),
832
- bindings([binding("M", 1.78), binding("H", 178.0)]),
833
- uses([
834
- proof(
835
- goal(unitSystem(input, metric)),
836
- by(fact("bmi.pl", clause(32)))
837
- ),
838
- proof(
839
- goal(height(input, 178.0)),
840
- by(fact("bmi.pl", clause(34)))
841
- ),
842
- proof(
843
- goal(div(178.0, 100.0, 1.78)),
844
- by(builtin(div, 3))
845
- )
846
- ])
847
- ),
848
- proof(
849
- goal(mul(1.78, 100.0, 178.0)),
850
- by(builtin(mul, 3))
851
- ),
852
- proof(
853
- goal(rounded(178.0, 178)),
854
- by(builtin(rounded, 2))
855
- )
856
- ])
857
- )
858
- ).
859
-
860
17
  heightCm(report, 178).
861
- why(
862
- heightCm(report, 178),
863
- proof(
864
- goal(heightCm(report, 178)),
865
- by(rule("bmi.pl", clause(74))),
866
- bindings([binding("Height", 178)]),
867
- uses([
868
- proof(
869
- goal(heightCm(answer, 178)),
870
- by(rule("bmi.pl", clause(58))),
871
- bindings([binding("CmRounded", 178), binding("M", 1.78), binding("Cm", 178.0)]),
872
- uses([
873
- proof(
874
- goal(heightM(case, 1.78)),
875
- by(rule("bmi.pl", clause(36))),
876
- bindings([binding("M", 1.78), binding("H", 178.0)]),
877
- uses([
878
- proof(
879
- goal(unitSystem(input, metric)),
880
- by(fact("bmi.pl", clause(32)))
881
- ),
882
- proof(
883
- goal(height(input, 178.0)),
884
- by(fact("bmi.pl", clause(34)))
885
- ),
886
- proof(
887
- goal(div(178.0, 100.0, 1.78)),
888
- by(builtin(div, 3))
889
- )
890
- ])
891
- ),
892
- proof(
893
- goal(mul(1.78, 100.0, 178.0)),
894
- by(builtin(mul, 3))
895
- ),
896
- proof(
897
- goal(rounded(178.0, 178)),
898
- by(builtin(rounded, 2))
899
- )
900
- ])
901
- )
902
- ])
903
- )
904
- ).
905
-
906
18
  formula(reason, "BMI is defined as weight in kilograms divided by height in meters squared.").
907
- why(
908
- formula(reason, "BMI is defined as weight in kilograms divided by height in meters squared."),
909
- proof(
910
- goal(formula(reason, "BMI is defined as weight in kilograms divided by height in meters squared.")),
911
- by(rule("bmi.pl", clause(59))),
912
- bindings([binding("_Bmi", 22.724403484408533)]),
913
- uses([
914
- proof(
915
- goal(bmi(case, 22.724403484408533)),
916
- by(rule("bmi.pl", clause(42))),
917
- bindings([binding("Bmi", 22.724403484408533), binding("Kg", 72.0), binding("M2", 3.1684000000000001)]),
918
- uses([
919
- proof(
920
- goal(weightKg(case, 72.0)),
921
- by(rule("bmi.pl", clause(35))),
922
- bindings([binding("W", 72.0)]),
923
- uses([
924
- proof(
925
- goal(unitSystem(input, metric)),
926
- by(fact("bmi.pl", clause(32)))
927
- ),
928
- proof(
929
- goal(weight(input, 72.0)),
930
- by(fact("bmi.pl", clause(33)))
931
- )
932
- ])
933
- ),
934
- proof(
935
- goal(heightSquared(case, 3.1684000000000001)),
936
- by(rule("bmi.pl", clause(41))),
937
- bindings([binding("M2", 3.1684000000000001), binding("M", 1.78)]),
938
- uses([
939
- proof(
940
- goal(heightM(case, 1.78)),
941
- by(rule("bmi.pl", clause(36))),
942
- bindings([binding("M", 1.78), binding("H", 178.0)]),
943
- uses([
944
- proof(
945
- goal(unitSystem(input, metric)),
946
- by(fact("bmi.pl", clause(32)))
947
- ),
948
- proof(
949
- goal(height(input, 178.0)),
950
- by(fact("bmi.pl", clause(34)))
951
- ),
952
- proof(
953
- goal(div(178.0, 100.0, 1.78)),
954
- by(builtin(div, 3))
955
- )
956
- ])
957
- ),
958
- proof(
959
- goal(mul(1.78, 1.78, 3.1684000000000001)),
960
- by(builtin(mul, 3))
961
- )
962
- ])
963
- ),
964
- proof(
965
- goal(div(72.0, 3.1684000000000001, 22.724403484408533)),
966
- by(builtin(div, 3))
967
- )
968
- ])
969
- )
970
- ])
971
- )
972
- ).
973
-
974
19
  calculation(reason, "The normalized weight and height were used to compute BMI, then the result was mapped to the WHO adult category table.").
975
- why(
976
- calculation(reason, "The normalized weight and height were used to compute BMI, then the result was mapped to the WHO adult category table."),
977
- proof(
978
- goal(calculation(reason, "The normalized weight and height were used to compute BMI, then the result was mapped to the WHO adult category table.")),
979
- by(rule("bmi.pl", clause(60))),
980
- bindings([binding("_Category", "Normal")]),
981
- uses([
982
- proof(
983
- goal(category(decision, "Normal")),
984
- by(rule("bmi.pl", clause(49))),
985
- bindings([binding("Bmi", 22.724403484408533)]),
986
- uses([
987
- proof(
988
- goal(bmi(case, 22.724403484408533)),
989
- by(rule("bmi.pl", clause(42))),
990
- bindings([binding("Bmi", 22.724403484408533), binding("Kg", 72.0), binding("M2", 3.1684000000000001)]),
991
- uses([
992
- proof(
993
- goal(weightKg(case, 72.0)),
994
- by(rule("bmi.pl", clause(35))),
995
- bindings([binding("W", 72.0)]),
996
- uses([
997
- proof(
998
- goal(unitSystem(input, metric)),
999
- by(fact("bmi.pl", clause(32)))
1000
- ),
1001
- proof(
1002
- goal(weight(input, 72.0)),
1003
- by(fact("bmi.pl", clause(33)))
1004
- )
1005
- ])
1006
- ),
1007
- proof(
1008
- goal(heightSquared(case, 3.1684000000000001)),
1009
- by(rule("bmi.pl", clause(41))),
1010
- bindings([binding("M2", 3.1684000000000001), binding("M", 1.78)]),
1011
- uses([
1012
- proof(
1013
- goal(heightM(case, 1.78)),
1014
- by(rule("bmi.pl", clause(36))),
1015
- bindings([binding("M", 1.78), binding("H", 178.0)]),
1016
- uses([
1017
- proof(
1018
- goal(unitSystem(input, metric)),
1019
- by(fact("bmi.pl", clause(32)))
1020
- ),
1021
- proof(
1022
- goal(height(input, 178.0)),
1023
- by(fact("bmi.pl", clause(34)))
1024
- ),
1025
- proof(
1026
- goal(div(178.0, 100.0, 1.78)),
1027
- by(builtin(div, 3))
1028
- )
1029
- ])
1030
- ),
1031
- proof(
1032
- goal(mul(1.78, 1.78, 3.1684000000000001)),
1033
- by(builtin(mul, 3))
1034
- )
1035
- ])
1036
- ),
1037
- proof(
1038
- goal(div(72.0, 3.1684000000000001, 22.724403484408533)),
1039
- by(builtin(div, 3))
1040
- )
1041
- ])
1042
- ),
1043
- proof(
1044
- goal(ge(22.724403484408533, 18.5)),
1045
- by(builtin(ge, 2))
1046
- ),
1047
- proof(
1048
- goal(lt(22.724403484408533, 25.0)),
1049
- by(builtin(lt, 2))
1050
- )
1051
- ])
1052
- )
1053
- ])
1054
- )
1055
- ).
1056
-
1057
20
  categoryRule(reason, "Normal").
1058
- why(
1059
- categoryRule(reason, "Normal"),
1060
- proof(
1061
- goal(categoryRule(reason, "Normal")),
1062
- by(rule("bmi.pl", clause(61))),
1063
- bindings([binding("Category", "Normal")]),
1064
- uses([
1065
- proof(
1066
- goal(category(decision, "Normal")),
1067
- by(rule("bmi.pl", clause(49))),
1068
- bindings([binding("Bmi", 22.724403484408533)]),
1069
- uses([
1070
- proof(
1071
- goal(bmi(case, 22.724403484408533)),
1072
- by(rule("bmi.pl", clause(42))),
1073
- bindings([binding("Bmi", 22.724403484408533), binding("Kg", 72.0), binding("M2", 3.1684000000000001)]),
1074
- uses([
1075
- proof(
1076
- goal(weightKg(case, 72.0)),
1077
- by(rule("bmi.pl", clause(35))),
1078
- bindings([binding("W", 72.0)]),
1079
- uses([
1080
- proof(
1081
- goal(unitSystem(input, metric)),
1082
- by(fact("bmi.pl", clause(32)))
1083
- ),
1084
- proof(
1085
- goal(weight(input, 72.0)),
1086
- by(fact("bmi.pl", clause(33)))
1087
- )
1088
- ])
1089
- ),
1090
- proof(
1091
- goal(heightSquared(case, 3.1684000000000001)),
1092
- by(rule("bmi.pl", clause(41))),
1093
- bindings([binding("M2", 3.1684000000000001), binding("M", 1.78)]),
1094
- uses([
1095
- proof(
1096
- goal(heightM(case, 1.78)),
1097
- by(rule("bmi.pl", clause(36))),
1098
- bindings([binding("M", 1.78), binding("H", 178.0)]),
1099
- uses([
1100
- proof(
1101
- goal(unitSystem(input, metric)),
1102
- by(fact("bmi.pl", clause(32)))
1103
- ),
1104
- proof(
1105
- goal(height(input, 178.0)),
1106
- by(fact("bmi.pl", clause(34)))
1107
- ),
1108
- proof(
1109
- goal(div(178.0, 100.0, 1.78)),
1110
- by(builtin(div, 3))
1111
- )
1112
- ])
1113
- ),
1114
- proof(
1115
- goal(mul(1.78, 1.78, 3.1684000000000001)),
1116
- by(builtin(mul, 3))
1117
- )
1118
- ])
1119
- ),
1120
- proof(
1121
- goal(div(72.0, 3.1684000000000001, 22.724403484408533)),
1122
- by(builtin(div, 3))
1123
- )
1124
- ])
1125
- ),
1126
- proof(
1127
- goal(ge(22.724403484408533, 18.5)),
1128
- by(builtin(ge, 2))
1129
- ),
1130
- proof(
1131
- goal(lt(22.724403484408533, 25.0)),
1132
- by(builtin(lt, 2))
1133
- )
1134
- ])
1135
- )
1136
- ])
1137
- )
1138
- ).
1139
-
1140
21
  unitsExplanation(reason, "Inputs were already metric, so kilograms stay kilograms and centimeters are divided by 100 to obtain meters.").
1141
- why(
1142
- unitsExplanation(reason, "Inputs were already metric, so kilograms stay kilograms and centimeters are divided by 100 to obtain meters."),
1143
- proof(
1144
- goal(unitsExplanation(reason, "Inputs were already metric, so kilograms stay kilograms and centimeters are divided by 100 to obtain meters.")),
1145
- by(rule("bmi.pl", clause(62))),
1146
- bindings([binding("Units", "Inputs were already metric, so kilograms stay kilograms and centimeters are divided by 100 to obtain meters.")]),
1147
- uses([
1148
- proof(
1149
- goal(units(reason, "Inputs were already metric, so kilograms stay kilograms and centimeters are divided by 100 to obtain meters.")),
1150
- by(rule("bmi.pl", clause(37))),
1151
- uses([
1152
- proof(
1153
- goal(unitSystem(input, metric)),
1154
- by(fact("bmi.pl", clause(32)))
1155
- )
1156
- ])
1157
- )
1158
- ])
1159
- )
1160
- ).
1161
-
1162
22
  c1(check, "OK - the input was normalized into positive SI values.").
1163
- why(
1164
- c1(check, "OK - the input was normalized into positive SI values."),
1165
- proof(
1166
- goal(c1(check, "OK - the input was normalized into positive SI values.")),
1167
- by(rule("bmi.pl", clause(63))),
1168
- bindings([binding("Kg", 72.0), binding("M", 1.78)]),
1169
- uses([
1170
- proof(
1171
- goal(weightKg(case, 72.0)),
1172
- by(rule("bmi.pl", clause(35))),
1173
- bindings([binding("W", 72.0)]),
1174
- uses([
1175
- proof(
1176
- goal(unitSystem(input, metric)),
1177
- by(fact("bmi.pl", clause(32)))
1178
- ),
1179
- proof(
1180
- goal(weight(input, 72.0)),
1181
- by(fact("bmi.pl", clause(33)))
1182
- )
1183
- ])
1184
- ),
1185
- proof(
1186
- goal(heightM(case, 1.78)),
1187
- by(rule("bmi.pl", clause(36))),
1188
- bindings([binding("M", 1.78), binding("H", 178.0)]),
1189
- uses([
1190
- proof(
1191
- goal(unitSystem(input, metric)),
1192
- by(fact("bmi.pl", clause(32)))
1193
- ),
1194
- proof(
1195
- goal(height(input, 178.0)),
1196
- by(fact("bmi.pl", clause(34)))
1197
- ),
1198
- proof(
1199
- goal(div(178.0, 100.0, 1.78)),
1200
- by(builtin(div, 3))
1201
- )
1202
- ])
1203
- ),
1204
- proof(
1205
- goal(gt(72.0, 0)),
1206
- by(builtin(gt, 2))
1207
- ),
1208
- proof(
1209
- goal(gt(1.78, 0)),
1210
- by(builtin(gt, 2))
1211
- )
1212
- ])
1213
- )
1214
- ).
1215
-
1216
23
  c2(check, "OK - height squared was reconstructed from the normalized height.").
1217
- why(
1218
- c2(check, "OK - height squared was reconstructed from the normalized height."),
1219
- proof(
1220
- goal(c2(check, "OK - height squared was reconstructed from the normalized height.")),
1221
- by(rule("bmi.pl", clause(64))),
1222
- bindings([binding("M", 1.78), binding("M2", 3.1684000000000001)]),
1223
- uses([
1224
- proof(
1225
- goal(heightM(case, 1.78)),
1226
- by(rule("bmi.pl", clause(36))),
1227
- bindings([binding("M", 1.78), binding("H", 178.0)]),
1228
- uses([
1229
- proof(
1230
- goal(unitSystem(input, metric)),
1231
- by(fact("bmi.pl", clause(32)))
1232
- ),
1233
- proof(
1234
- goal(height(input, 178.0)),
1235
- by(fact("bmi.pl", clause(34)))
1236
- ),
1237
- proof(
1238
- goal(div(178.0, 100.0, 1.78)),
1239
- by(builtin(div, 3))
1240
- )
1241
- ])
1242
- ),
1243
- proof(
1244
- goal(heightSquared(case, 3.1684000000000001)),
1245
- by(rule("bmi.pl", clause(41))),
1246
- bindings([binding("M2", 3.1684000000000001), binding("M", 1.78)]),
1247
- uses([
1248
- proof(
1249
- goal(heightM(case, 1.78)),
1250
- by(rule("bmi.pl", clause(36))),
1251
- bindings([binding("M", 1.78), binding("H", 178.0)]),
1252
- uses([
1253
- proof(
1254
- goal(unitSystem(input, metric)),
1255
- by(fact("bmi.pl", clause(32)))
1256
- ),
1257
- proof(
1258
- goal(height(input, 178.0)),
1259
- by(fact("bmi.pl", clause(34)))
1260
- ),
1261
- proof(
1262
- goal(div(178.0, 100.0, 1.78)),
1263
- by(builtin(div, 3))
1264
- )
1265
- ])
1266
- ),
1267
- proof(
1268
- goal(mul(1.78, 1.78, 3.1684000000000001)),
1269
- by(builtin(mul, 3))
1270
- )
1271
- ])
1272
- ),
1273
- proof(
1274
- goal(mul(1.78, 1.78, 3.1684000000000001)),
1275
- by(builtin(mul, 3))
1276
- )
1277
- ])
1278
- )
1279
- ).
1280
-
1281
24
  c3(check, "OK - the BMI value matches the BMI = kg / m² formula.").
1282
- why(
1283
- c3(check, "OK - the BMI value matches the BMI = kg / m² formula."),
1284
- proof(
1285
- goal(c3(check, "OK - the BMI value matches the BMI = kg / m² formula.")),
1286
- by(rule("bmi.pl", clause(65))),
1287
- bindings([binding("Kg", 72.0), binding("M2", 3.1684000000000001), binding("Bmi", 22.724403484408533)]),
1288
- uses([
1289
- proof(
1290
- goal(weightKg(case, 72.0)),
1291
- by(rule("bmi.pl", clause(35))),
1292
- bindings([binding("W", 72.0)]),
1293
- uses([
1294
- proof(
1295
- goal(unitSystem(input, metric)),
1296
- by(fact("bmi.pl", clause(32)))
1297
- ),
1298
- proof(
1299
- goal(weight(input, 72.0)),
1300
- by(fact("bmi.pl", clause(33)))
1301
- )
1302
- ])
1303
- ),
1304
- proof(
1305
- goal(heightSquared(case, 3.1684000000000001)),
1306
- by(rule("bmi.pl", clause(41))),
1307
- bindings([binding("M2", 3.1684000000000001), binding("M", 1.78)]),
1308
- uses([
1309
- proof(
1310
- goal(heightM(case, 1.78)),
1311
- by(rule("bmi.pl", clause(36))),
1312
- bindings([binding("M", 1.78), binding("H", 178.0)]),
1313
- uses([
1314
- proof(
1315
- goal(unitSystem(input, metric)),
1316
- by(fact("bmi.pl", clause(32)))
1317
- ),
1318
- proof(
1319
- goal(height(input, 178.0)),
1320
- by(fact("bmi.pl", clause(34)))
1321
- ),
1322
- proof(
1323
- goal(div(178.0, 100.0, 1.78)),
1324
- by(builtin(div, 3))
1325
- )
1326
- ])
1327
- ),
1328
- proof(
1329
- goal(mul(1.78, 1.78, 3.1684000000000001)),
1330
- by(builtin(mul, 3))
1331
- )
1332
- ])
1333
- ),
1334
- proof(
1335
- goal(bmi(case, 22.724403484408533)),
1336
- by(rule("bmi.pl", clause(42))),
1337
- bindings([binding("Bmi", 22.724403484408533), binding("Kg", 72.0), binding("M2", 3.1684000000000001)]),
1338
- uses([
1339
- proof(
1340
- goal(weightKg(case, 72.0)),
1341
- by(rule("bmi.pl", clause(35))),
1342
- bindings([binding("W", 72.0)]),
1343
- uses([
1344
- proof(
1345
- goal(unitSystem(input, metric)),
1346
- by(fact("bmi.pl", clause(32)))
1347
- ),
1348
- proof(
1349
- goal(weight(input, 72.0)),
1350
- by(fact("bmi.pl", clause(33)))
1351
- )
1352
- ])
1353
- ),
1354
- proof(
1355
- goal(heightSquared(case, 3.1684000000000001)),
1356
- by(rule("bmi.pl", clause(41))),
1357
- bindings([binding("M2", 3.1684000000000001), binding("M", 1.78)]),
1358
- uses([
1359
- proof(
1360
- goal(heightM(case, 1.78)),
1361
- by(rule("bmi.pl", clause(36))),
1362
- bindings([binding("M", 1.78), binding("H", 178.0)]),
1363
- uses([
1364
- proof(
1365
- goal(unitSystem(input, metric)),
1366
- by(fact("bmi.pl", clause(32)))
1367
- ),
1368
- proof(
1369
- goal(height(input, 178.0)),
1370
- by(fact("bmi.pl", clause(34)))
1371
- ),
1372
- proof(
1373
- goal(div(178.0, 100.0, 1.78)),
1374
- by(builtin(div, 3))
1375
- )
1376
- ])
1377
- ),
1378
- proof(
1379
- goal(mul(1.78, 1.78, 3.1684000000000001)),
1380
- by(builtin(mul, 3))
1381
- )
1382
- ])
1383
- ),
1384
- proof(
1385
- goal(div(72.0, 3.1684000000000001, 22.724403484408533)),
1386
- by(builtin(div, 3))
1387
- )
1388
- ])
1389
- ),
1390
- proof(
1391
- goal(div(72.0, 3.1684000000000001, 22.724403484408533)),
1392
- by(builtin(div, 3))
1393
- )
1394
- ])
1395
- )
1396
- ).
1397
-
1398
25
  c4(check, "OK - a BMI of 18.49 stays below the normal-weight threshold.").
1399
- why(
1400
- c4(check, "OK - a BMI of 18.49 stays below the normal-weight threshold."),
1401
- proof(
1402
- goal(c4(check, "OK - a BMI of 18.49 stays below the normal-weight threshold.")),
1403
- by(rule("bmi.pl", clause(66))),
1404
- uses([
1405
- proof(
1406
- goal(lt(18.49, 18.5)),
1407
- by(builtin(lt, 2))
1408
- )
1409
- ])
1410
- )
1411
- ).
1412
-
1413
26
  c5(check, "OK - the lower boundary is half-open: BMI 18.5 is classified as Normal.").
1414
- why(
1415
- c5(check, "OK - the lower boundary is half-open: BMI 18.5 is classified as Normal."),
1416
- proof(
1417
- goal(c5(check, "OK - the lower boundary is half-open: BMI 18.5 is classified as Normal.")),
1418
- by(rule("bmi.pl", clause(67))),
1419
- uses([
1420
- proof(
1421
- goal(ge(18.5, 18.5)),
1422
- by(builtin(ge, 2))
1423
- ),
1424
- proof(
1425
- goal(lt(18.5, 25.0)),
1426
- by(builtin(lt, 2))
1427
- )
1428
- ])
1429
- )
1430
- ).
1431
-
1432
27
  c6(check, "OK - BMI 25.0 starts the Overweight category.").
1433
- why(
1434
- c6(check, "OK - BMI 25.0 starts the Overweight category."),
1435
- proof(
1436
- goal(c6(check, "OK - BMI 25.0 starts the Overweight category.")),
1437
- by(rule("bmi.pl", clause(68))),
1438
- uses([
1439
- proof(
1440
- goal(ge(25.0, 25.0)),
1441
- by(builtin(ge, 2))
1442
- ),
1443
- proof(
1444
- goal(lt(25.0, 30.0)),
1445
- by(builtin(lt, 2))
1446
- )
1447
- ])
1448
- )
1449
- ).
1450
-
1451
28
  c7(check, "OK - BMI 30.0 starts the Obesity I category.").
1452
- why(
1453
- c7(check, "OK - BMI 30.0 starts the Obesity I category."),
1454
- proof(
1455
- goal(c7(check, "OK - BMI 30.0 starts the Obesity I category.")),
1456
- by(rule("bmi.pl", clause(69))),
1457
- uses([
1458
- proof(
1459
- goal(ge(30.0, 30.0)),
1460
- by(builtin(ge, 2))
1461
- ),
1462
- proof(
1463
- goal(lt(30.0, 35.0)),
1464
- by(builtin(lt, 2))
1465
- )
1466
- ])
1467
- )
1468
- ).
1469
-
1470
29
  c8(check, "OK - classification behavior is monotonic across representative BMI values.").
1471
- why(
1472
- c8(check, "OK - classification behavior is monotonic across representative BMI values."),
1473
- proof(
1474
- goal(c8(check, "OK - classification behavior is monotonic across representative BMI values.")),
1475
- by(rule("bmi.pl", clause(70))),
1476
- uses([
1477
- proof(
1478
- goal(ge(22.0, 18.5)),
1479
- by(builtin(ge, 2))
1480
- ),
1481
- proof(
1482
- goal(lt(22.0, 25.0)),
1483
- by(builtin(lt, 2))
1484
- ),
1485
- proof(
1486
- goal(ge(27.0, 25.0)),
1487
- by(builtin(ge, 2))
1488
- ),
1489
- proof(
1490
- goal(lt(27.0, 30.0)),
1491
- by(builtin(lt, 2))
1492
- ),
1493
- proof(
1494
- goal(ge(41.0, 40.0)),
1495
- by(builtin(ge, 2))
1496
- )
1497
- ])
1498
- )
1499
- ).
1500
-
1501
30
  c9(check, "OK - the healthy-weight band was reconstructed from BMI 18.5 to 24.9 at the same height.").
1502
- why(
1503
- c9(check, "OK - the healthy-weight band was reconstructed from BMI 18.5 to 24.9 at the same height."),
1504
- proof(
1505
- goal(c9(check, "OK - the healthy-weight band was reconstructed from BMI 18.5 to 24.9 at the same height.")),
1506
- by(rule("bmi.pl", clause(71))),
1507
- bindings([binding("M2", 3.1684000000000001), binding("Min", 58.615400000000001), binding("Max", 78.893159999999995)]),
1508
- uses([
1509
- proof(
1510
- goal(heightSquared(case, 3.1684000000000001)),
1511
- by(rule("bmi.pl", clause(41))),
1512
- bindings([binding("M2", 3.1684000000000001), binding("M", 1.78)]),
1513
- uses([
1514
- proof(
1515
- goal(heightM(case, 1.78)),
1516
- by(rule("bmi.pl", clause(36))),
1517
- bindings([binding("M", 1.78), binding("H", 178.0)]),
1518
- uses([
1519
- proof(
1520
- goal(unitSystem(input, metric)),
1521
- by(fact("bmi.pl", clause(32)))
1522
- ),
1523
- proof(
1524
- goal(height(input, 178.0)),
1525
- by(fact("bmi.pl", clause(34)))
1526
- ),
1527
- proof(
1528
- goal(div(178.0, 100.0, 1.78)),
1529
- by(builtin(div, 3))
1530
- )
1531
- ])
1532
- ),
1533
- proof(
1534
- goal(mul(1.78, 1.78, 3.1684000000000001)),
1535
- by(builtin(mul, 3))
1536
- )
1537
- ])
1538
- ),
1539
- proof(
1540
- goal(healthyMinKg(case, 58.615400000000001)),
1541
- by(rule("bmi.pl", clause(44))),
1542
- bindings([binding("HealthyMin", 58.615400000000001), binding("M2", 3.1684000000000001)]),
1543
- uses([
1544
- proof(
1545
- goal(heightSquared(case, 3.1684000000000001)),
1546
- by(rule("bmi.pl", clause(41))),
1547
- bindings([binding("M2", 3.1684000000000001), binding("M", 1.78)]),
1548
- uses([
1549
- proof(
1550
- goal(heightM(case, 1.78)),
1551
- by(rule("bmi.pl", clause(36))),
1552
- bindings([binding("M", 1.78), binding("H", 178.0)]),
1553
- uses([
1554
- proof(
1555
- goal(unitSystem(input, metric)),
1556
- by(fact("bmi.pl", clause(32)))
1557
- ),
1558
- proof(
1559
- goal(height(input, 178.0)),
1560
- by(fact("bmi.pl", clause(34)))
1561
- ),
1562
- proof(
1563
- goal(div(178.0, 100.0, 1.78)),
1564
- by(builtin(div, 3))
1565
- )
1566
- ])
1567
- ),
1568
- proof(
1569
- goal(mul(1.78, 1.78, 3.1684000000000001)),
1570
- by(builtin(mul, 3))
1571
- )
1572
- ])
1573
- ),
1574
- proof(
1575
- goal(mul(18.5, 3.1684000000000001, 58.615400000000001)),
1576
- by(builtin(mul, 3))
1577
- )
1578
- ])
1579
- ),
1580
- proof(
1581
- goal(healthyMaxKg(case, 78.893159999999995)),
1582
- by(rule("bmi.pl", clause(45))),
1583
- bindings([binding("HealthyMax", 78.893159999999995), binding("M2", 3.1684000000000001)]),
1584
- uses([
1585
- proof(
1586
- goal(heightSquared(case, 3.1684000000000001)),
1587
- by(rule("bmi.pl", clause(41))),
1588
- bindings([binding("M2", 3.1684000000000001), binding("M", 1.78)]),
1589
- uses([
1590
- proof(
1591
- goal(heightM(case, 1.78)),
1592
- by(rule("bmi.pl", clause(36))),
1593
- bindings([binding("M", 1.78), binding("H", 178.0)]),
1594
- uses([
1595
- proof(
1596
- goal(unitSystem(input, metric)),
1597
- by(fact("bmi.pl", clause(32)))
1598
- ),
1599
- proof(
1600
- goal(height(input, 178.0)),
1601
- by(fact("bmi.pl", clause(34)))
1602
- ),
1603
- proof(
1604
- goal(div(178.0, 100.0, 1.78)),
1605
- by(builtin(div, 3))
1606
- )
1607
- ])
1608
- ),
1609
- proof(
1610
- goal(mul(1.78, 1.78, 3.1684000000000001)),
1611
- by(builtin(mul, 3))
1612
- )
1613
- ])
1614
- ),
1615
- proof(
1616
- goal(mul(24.9, 3.1684000000000001, 78.893159999999995)),
1617
- by(builtin(mul, 3))
1618
- )
1619
- ])
1620
- ),
1621
- proof(
1622
- goal(mul(18.5, 3.1684000000000001, 58.615400000000001)),
1623
- by(builtin(mul, 3))
1624
- ),
1625
- proof(
1626
- goal(mul(24.9, 3.1684000000000001, 78.893159999999995)),
1627
- by(builtin(mul, 3))
1628
- )
1629
- ])
1630
- )
1631
- ).
1632
-
1633
31
  result(report, bmi(22.72, "Normal")).
1634
- why(
1635
- result(report, bmi(22.72, "Normal")),
1636
- proof(
1637
- goal(result(report, bmi(22.72, "Normal"))),
1638
- by(rule("bmi.pl", clause(72))),
1639
- bindings([binding("Bmi", 22.72), binding("Category", "Normal")]),
1640
- uses([
1641
- proof(
1642
- goal(bmi(answer, 22.72)),
1643
- by(rule("bmi.pl", clause(54))),
1644
- uses([
1645
- proof(
1646
- goal(bmiRoundedInt(case, 2272)),
1647
- by(rule("bmi.pl", clause(43))),
1648
- bindings([binding("BmiRoundedInt", 2272), binding("Bmi", 22.724403484408533), binding("BmiX100", 2272.4403484408535)]),
1649
- uses([
1650
- proof(
1651
- goal(bmi(case, 22.724403484408533)),
1652
- by(rule("bmi.pl", clause(42))),
1653
- bindings([binding("Bmi", 22.724403484408533), binding("Kg", 72.0), binding("M2", 3.1684000000000001)]),
1654
- uses([
1655
- proof(
1656
- goal(weightKg(case, 72.0)),
1657
- by(rule("bmi.pl", clause(35))),
1658
- bindings([binding("W", 72.0)]),
1659
- uses([
1660
- proof(
1661
- goal(unitSystem(input, metric)),
1662
- by(fact("bmi.pl", clause(32)))
1663
- ),
1664
- proof(
1665
- goal(weight(input, 72.0)),
1666
- by(fact("bmi.pl", clause(33)))
1667
- )
1668
- ])
1669
- ),
1670
- proof(
1671
- goal(heightSquared(case, 3.1684000000000001)),
1672
- by(rule("bmi.pl", clause(41))),
1673
- bindings([binding("M2", 3.1684000000000001), binding("M", 1.78)]),
1674
- uses([
1675
- proof(
1676
- goal(heightM(case, 1.78)),
1677
- by(rule("bmi.pl", clause(36))),
1678
- bindings([binding("M", 1.78), binding("H", 178.0)]),
1679
- uses([
1680
- proof(
1681
- goal(unitSystem(input, metric)),
1682
- by(fact("bmi.pl", clause(32)))
1683
- ),
1684
- proof(
1685
- goal(height(input, 178.0)),
1686
- by(fact("bmi.pl", clause(34)))
1687
- ),
1688
- proof(
1689
- goal(div(178.0, 100.0, 1.78)),
1690
- by(builtin(div, 3))
1691
- )
1692
- ])
1693
- ),
1694
- proof(
1695
- goal(mul(1.78, 1.78, 3.1684000000000001)),
1696
- by(builtin(mul, 3))
1697
- )
1698
- ])
1699
- ),
1700
- proof(
1701
- goal(div(72.0, 3.1684000000000001, 22.724403484408533)),
1702
- by(builtin(div, 3))
1703
- )
1704
- ])
1705
- ),
1706
- proof(
1707
- goal(mul(22.724403484408533, 100.0, 2272.4403484408535)),
1708
- by(builtin(mul, 3))
1709
- ),
1710
- proof(
1711
- goal(rounded(2272.4403484408535, 2272)),
1712
- by(builtin(rounded, 2))
1713
- )
1714
- ])
1715
- )
1716
- ])
1717
- ),
1718
- proof(
1719
- goal(category(answer, "Normal")),
1720
- by(rule("bmi.pl", clause(55))),
1721
- bindings([binding("Category", "Normal")]),
1722
- uses([
1723
- proof(
1724
- goal(category(decision, "Normal")),
1725
- by(rule("bmi.pl", clause(49))),
1726
- bindings([binding("Bmi", 22.724403484408533)]),
1727
- uses([
1728
- proof(
1729
- goal(bmi(case, 22.724403484408533)),
1730
- by(rule("bmi.pl", clause(42))),
1731
- bindings([binding("Bmi", 22.724403484408533), binding("Kg", 72.0), binding("M2", 3.1684000000000001)]),
1732
- uses([
1733
- proof(
1734
- goal(weightKg(case, 72.0)),
1735
- by(rule("bmi.pl", clause(35))),
1736
- bindings([binding("W", 72.0)]),
1737
- uses([
1738
- proof(
1739
- goal(unitSystem(input, metric)),
1740
- by(fact("bmi.pl", clause(32)))
1741
- ),
1742
- proof(
1743
- goal(weight(input, 72.0)),
1744
- by(fact("bmi.pl", clause(33)))
1745
- )
1746
- ])
1747
- ),
1748
- proof(
1749
- goal(heightSquared(case, 3.1684000000000001)),
1750
- by(rule("bmi.pl", clause(41))),
1751
- bindings([binding("M2", 3.1684000000000001), binding("M", 1.78)]),
1752
- uses([
1753
- proof(
1754
- goal(heightM(case, 1.78)),
1755
- by(rule("bmi.pl", clause(36))),
1756
- bindings([binding("M", 1.78), binding("H", 178.0)]),
1757
- uses([
1758
- proof(
1759
- goal(unitSystem(input, metric)),
1760
- by(fact("bmi.pl", clause(32)))
1761
- ),
1762
- proof(
1763
- goal(height(input, 178.0)),
1764
- by(fact("bmi.pl", clause(34)))
1765
- ),
1766
- proof(
1767
- goal(div(178.0, 100.0, 1.78)),
1768
- by(builtin(div, 3))
1769
- )
1770
- ])
1771
- ),
1772
- proof(
1773
- goal(mul(1.78, 1.78, 3.1684000000000001)),
1774
- by(builtin(mul, 3))
1775
- )
1776
- ])
1777
- ),
1778
- proof(
1779
- goal(div(72.0, 3.1684000000000001, 22.724403484408533)),
1780
- by(builtin(div, 3))
1781
- )
1782
- ])
1783
- ),
1784
- proof(
1785
- goal(ge(22.724403484408533, 18.5)),
1786
- by(builtin(ge, 2))
1787
- ),
1788
- proof(
1789
- goal(lt(22.724403484408533, 25.0)),
1790
- by(builtin(lt, 2))
1791
- )
1792
- ])
1793
- )
1794
- ])
1795
- )
1796
- ])
1797
- )
1798
- ).
1799
-
1800
32
  healthyWeightRangeKg(report, range(58.6, 78.9)).
1801
- why(
1802
- healthyWeightRangeKg(report, range(58.6, 78.9)),
1803
- proof(
1804
- goal(healthyWeightRangeKg(report, range(58.6, 78.9))),
1805
- by(rule("bmi.pl", clause(73))),
1806
- bindings([binding("Min", 58.6), binding("Max", 78.9)]),
1807
- uses([
1808
- proof(
1809
- goal(healthyMinKg(answer, 58.6)),
1810
- by(rule("bmi.pl", clause(56))),
1811
- uses([
1812
- proof(
1813
- goal(healthyMinKgRoundedInt(case, 586)),
1814
- by(rule("bmi.pl", clause(46))),
1815
- bindings([binding("MinRoundedInt", 586), binding("HealthyMin", 58.615400000000001), binding("MinX10", 586.154)]),
1816
- uses([
1817
- proof(
1818
- goal(healthyMinKg(case, 58.615400000000001)),
1819
- by(rule("bmi.pl", clause(44))),
1820
- bindings([binding("HealthyMin", 58.615400000000001), binding("M2", 3.1684000000000001)]),
1821
- uses([
1822
- proof(
1823
- goal(heightSquared(case, 3.1684000000000001)),
1824
- by(rule("bmi.pl", clause(41))),
1825
- bindings([binding("M2", 3.1684000000000001), binding("M", 1.78)]),
1826
- uses([
1827
- proof(
1828
- goal(heightM(case, 1.78)),
1829
- by(rule("bmi.pl", clause(36))),
1830
- bindings([binding("M", 1.78), binding("H", 178.0)]),
1831
- uses([
1832
- proof(
1833
- goal(unitSystem(input, metric)),
1834
- by(fact("bmi.pl", clause(32)))
1835
- ),
1836
- proof(
1837
- goal(height(input, 178.0)),
1838
- by(fact("bmi.pl", clause(34)))
1839
- ),
1840
- proof(
1841
- goal(div(178.0, 100.0, 1.78)),
1842
- by(builtin(div, 3))
1843
- )
1844
- ])
1845
- ),
1846
- proof(
1847
- goal(mul(1.78, 1.78, 3.1684000000000001)),
1848
- by(builtin(mul, 3))
1849
- )
1850
- ])
1851
- ),
1852
- proof(
1853
- goal(mul(18.5, 3.1684000000000001, 58.615400000000001)),
1854
- by(builtin(mul, 3))
1855
- )
1856
- ])
1857
- ),
1858
- proof(
1859
- goal(mul(58.615400000000001, 10.0, 586.154)),
1860
- by(builtin(mul, 3))
1861
- ),
1862
- proof(
1863
- goal(rounded(586.154, 586)),
1864
- by(builtin(rounded, 2))
1865
- )
1866
- ])
1867
- )
1868
- ])
1869
- ),
1870
- proof(
1871
- goal(healthyMaxKg(answer, 78.9)),
1872
- by(rule("bmi.pl", clause(57))),
1873
- uses([
1874
- proof(
1875
- goal(healthyMaxKgRoundedInt(case, 789)),
1876
- by(rule("bmi.pl", clause(47))),
1877
- bindings([binding("MaxRoundedInt", 789), binding("HealthyMax", 78.893159999999995), binding("MaxX10", 788.93159999999989)]),
1878
- uses([
1879
- proof(
1880
- goal(healthyMaxKg(case, 78.893159999999995)),
1881
- by(rule("bmi.pl", clause(45))),
1882
- bindings([binding("HealthyMax", 78.893159999999995), binding("M2", 3.1684000000000001)]),
1883
- uses([
1884
- proof(
1885
- goal(heightSquared(case, 3.1684000000000001)),
1886
- by(rule("bmi.pl", clause(41))),
1887
- bindings([binding("M2", 3.1684000000000001), binding("M", 1.78)]),
1888
- uses([
1889
- proof(
1890
- goal(heightM(case, 1.78)),
1891
- by(rule("bmi.pl", clause(36))),
1892
- bindings([binding("M", 1.78), binding("H", 178.0)]),
1893
- uses([
1894
- proof(
1895
- goal(unitSystem(input, metric)),
1896
- by(fact("bmi.pl", clause(32)))
1897
- ),
1898
- proof(
1899
- goal(height(input, 178.0)),
1900
- by(fact("bmi.pl", clause(34)))
1901
- ),
1902
- proof(
1903
- goal(div(178.0, 100.0, 1.78)),
1904
- by(builtin(div, 3))
1905
- )
1906
- ])
1907
- ),
1908
- proof(
1909
- goal(mul(1.78, 1.78, 3.1684000000000001)),
1910
- by(builtin(mul, 3))
1911
- )
1912
- ])
1913
- ),
1914
- proof(
1915
- goal(mul(24.9, 3.1684000000000001, 78.893159999999995)),
1916
- by(builtin(mul, 3))
1917
- )
1918
- ])
1919
- ),
1920
- proof(
1921
- goal(mul(78.893159999999995, 10.0, 788.93159999999989)),
1922
- by(builtin(mul, 3))
1923
- ),
1924
- proof(
1925
- goal(rounded(788.93159999999989, 789)),
1926
- by(builtin(rounded, 2))
1927
- )
1928
- ])
1929
- )
1930
- ])
1931
- )
1932
- ])
1933
- )
1934
- ).
1935
-