eyelang 1.3.9 → 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 (213) 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/package.json +1 -1
  208. package/playground-worker.mjs +4 -4
  209. package/playground.html +15 -15
  210. package/src/cli.js +9 -9
  211. package/src/index.js +3 -2
  212. package/test/run-examples.js +38 -8
  213. package/test/run-regression.js +29 -37
@@ -1,1070 +1,6 @@
1
1
  pow([2, 10], 1024).
2
- why(
3
- pow([2, 10], 1024),
4
- proof(
5
- goal(pow([2, 10], 1024)),
6
- by(rule("fastpow.pl", clause(14))),
7
- bindings([binding("Value", 1024)]),
8
- uses([
9
- proof(
10
- goal(pow(2, 10, 1024)),
11
- by(builtin(pow, 3))
12
- )
13
- ])
14
- )
15
- ).
16
-
17
2
  powSlow([2, 10], 1024).
18
- why(
19
- powSlow([2, 10], 1024),
20
- proof(
21
- goal(powSlow([2, 10], 1024)),
22
- by(rule("fastpow.pl", clause(15))),
23
- bindings([binding("Value", 1024)]),
24
- uses([
25
- proof(
26
- goal(pow(2, 10, 1024)),
27
- by(builtin(pow, 3))
28
- )
29
- ])
30
- )
31
- ).
32
-
33
3
  powMod1e6([2, 10000], 709376).
34
- why(
35
- powMod1e6([2, 10000], 709376),
36
- proof(
37
- goal(powMod1e6([2, 10000], 709376)),
38
- by(rule("fastpow.pl", clause(16))),
39
- bindings([binding("Value", 709376)]),
40
- uses([
41
- proof(
42
- goal(pow_mod(2, 10000, 1000000, 709376)),
43
- by(rule("fastpow.pl", clause(10))),
44
- bindings([binding("Base", 2), binding("Exp", 10000), binding("Mod", 1000000), binding("Value", 709376), binding("Half", 5000), binding("HalfValue", 909376), binding("Square", 826964709376)]),
45
- uses([
46
- proof(
47
- goal(gt(10000, 0)),
48
- by(builtin(gt, 2))
49
- ),
50
- proof(
51
- goal(mod(10000, 2, 0)),
52
- by(builtin(mod, 3))
53
- ),
54
- proof(
55
- goal(div(10000, 2, 5000)),
56
- by(builtin(div, 3))
57
- ),
58
- proof(
59
- goal(pow_mod(2, 5000, 1000000, 909376)),
60
- by(rule("fastpow.pl", clause(10))),
61
- bindings([binding("Base", 2), binding("Exp", 5000), binding("Mod", 1000000), binding("Value", 909376), binding("Half", 2500), binding("HalfValue", 509376), binding("Square", 259463909376)]),
62
- uses([
63
- proof(
64
- goal(gt(5000, 0)),
65
- by(builtin(gt, 2))
66
- ),
67
- proof(
68
- goal(mod(5000, 2, 0)),
69
- by(builtin(mod, 3))
70
- ),
71
- proof(
72
- goal(div(5000, 2, 2500)),
73
- by(builtin(div, 3))
74
- ),
75
- proof(
76
- goal(pow_mod(2, 2500, 1000000, 509376)),
77
- by(rule("fastpow.pl", clause(10))),
78
- bindings([binding("Base", 2), binding("Exp", 2500), binding("Mod", 1000000), binding("Value", 509376), binding("Half", 1250), binding("HalfValue", 690624), binding("Square", 476961509376)]),
79
- uses([
80
- proof(
81
- goal(gt(2500, 0)),
82
- by(builtin(gt, 2))
83
- ),
84
- proof(
85
- goal(mod(2500, 2, 0)),
86
- by(builtin(mod, 3))
87
- ),
88
- proof(
89
- goal(div(2500, 2, 1250)),
90
- by(builtin(div, 3))
91
- ),
92
- proof(
93
- goal(pow_mod(2, 1250, 1000000, 690624)),
94
- by(rule("fastpow.pl", clause(10))),
95
- bindings([binding("Base", 2), binding("Exp", 1250), binding("Mod", 1000000), binding("Value", 690624), binding("Half", 625), binding("HalfValue", 386432), binding("Square", 149329690624)]),
96
- uses([
97
- proof(
98
- goal(gt(1250, 0)),
99
- by(builtin(gt, 2))
100
- ),
101
- proof(
102
- goal(mod(1250, 2, 0)),
103
- by(builtin(mod, 3))
104
- ),
105
- proof(
106
- goal(div(1250, 2, 625)),
107
- by(builtin(div, 3))
108
- ),
109
- proof(
110
- goal(pow_mod(2, 625, 1000000, 386432)),
111
- by(rule("fastpow.pl", clause(11))),
112
- bindings([binding("Base", 2), binding("Exp", 625), binding("Mod", 1000000), binding("Value", 386432), binding("EvenExp", 624), binding("EvenValue", 193216), binding("Product", 386432)]),
113
- uses([
114
- proof(
115
- goal(gt(625, 0)),
116
- by(builtin(gt, 2))
117
- ),
118
- proof(
119
- goal(mod(625, 2, 1)),
120
- by(builtin(mod, 3))
121
- ),
122
- proof(
123
- goal(sub(625, 1, 624)),
124
- by(builtin(sub, 3))
125
- ),
126
- proof(
127
- goal(pow_mod(2, 624, 1000000, 193216)),
128
- by(rule("fastpow.pl", clause(10))),
129
- bindings([binding("Base", 2), binding("Exp", 624), binding("Mod", 1000000), binding("Value", 193216), binding("Half", 312), binding("HalfValue", 652096), binding("Square", 425229193216)]),
130
- uses([
131
- proof(
132
- goal(gt(624, 0)),
133
- by(builtin(gt, 2))
134
- ),
135
- proof(
136
- goal(mod(624, 2, 0)),
137
- by(builtin(mod, 3))
138
- ),
139
- proof(
140
- goal(div(624, 2, 312)),
141
- by(builtin(div, 3))
142
- ),
143
- proof(
144
- goal(pow_mod(2, 312, 1000000, 652096)),
145
- by(rule("fastpow.pl", clause(10))),
146
- bindings([binding("Base", 2), binding("Exp", 312), binding("Mod", 1000000), binding("Value", 652096), binding("Half", 156), binding("HalfValue", 783936), binding("Square", 614555652096)]),
147
- uses([
148
- proof(
149
- goal(gt(312, 0)),
150
- by(builtin(gt, 2))
151
- ),
152
- proof(
153
- goal(mod(312, 2, 0)),
154
- by(builtin(mod, 3))
155
- ),
156
- proof(
157
- goal(div(312, 2, 156)),
158
- by(builtin(div, 3))
159
- ),
160
- proof(
161
- goal(pow_mod(2, 156, 1000000, 783936)),
162
- by(rule("fastpow.pl", clause(10))),
163
- bindings([binding("Base", 2), binding("Exp", 156), binding("Mod", 1000000), binding("Value", 783936), binding("Half", 78), binding("HalfValue", 676544), binding("Square", 457711783936)]),
164
- uses([
165
- proof(
166
- goal(gt(156, 0)),
167
- by(builtin(gt, 2))
168
- ),
169
- proof(
170
- goal(mod(156, 2, 0)),
171
- by(builtin(mod, 3))
172
- ),
173
- proof(
174
- goal(div(156, 2, 78)),
175
- by(builtin(div, 3))
176
- ),
177
- proof(
178
- goal(pow_mod(2, 78, 1000000, 676544)),
179
- by(rule("fastpow.pl", clause(10))),
180
- bindings([binding("Base", 2), binding("Exp", 78), binding("Mod", 1000000), binding("Value", 676544), binding("Half", 39), binding("HalfValue", 813888), binding("Square", 662413676544)]),
181
- uses([
182
- proof(
183
- goal(gt(78, 0)),
184
- by(builtin(gt, 2))
185
- ),
186
- proof(
187
- goal(mod(78, 2, 0)),
188
- by(builtin(mod, 3))
189
- ),
190
- proof(
191
- goal(div(78, 2, 39)),
192
- by(builtin(div, 3))
193
- ),
194
- proof(
195
- goal(pow_mod(2, 39, 1000000, 813888)),
196
- by(rule("fastpow.pl", clause(11))),
197
- bindings([binding("Base", 2), binding("Exp", 39), binding("Mod", 1000000), binding("Value", 813888), binding("EvenExp", 38), binding("EvenValue", 906944), binding("Product", 1813888)]),
198
- uses([
199
- proof(
200
- goal(gt(39, 0)),
201
- by(builtin(gt, 2))
202
- ),
203
- proof(
204
- goal(mod(39, 2, 1)),
205
- by(builtin(mod, 3))
206
- ),
207
- proof(
208
- goal(sub(39, 1, 38)),
209
- by(builtin(sub, 3))
210
- ),
211
- proof(
212
- goal(pow_mod(2, 38, 1000000, 906944)),
213
- by(rule("fastpow.pl", clause(10))),
214
- bindings([binding("Base", 2), binding("Exp", 38), binding("Mod", 1000000), binding("Value", 906944), binding("Half", 19), binding("HalfValue", 524288), binding("Square", 274877906944)]),
215
- uses([
216
- proof(
217
- goal(gt(38, 0)),
218
- by(builtin(gt, 2))
219
- ),
220
- proof(
221
- goal(mod(38, 2, 0)),
222
- by(builtin(mod, 3))
223
- ),
224
- proof(
225
- goal(div(38, 2, 19)),
226
- by(builtin(div, 3))
227
- ),
228
- proof(
229
- goal(pow_mod(2, 19, 1000000, 524288)),
230
- by(rule("fastpow.pl", clause(11))),
231
- bindings([binding("Base", 2), binding("Exp", 19), binding("Mod", 1000000), binding("Value", 524288), binding("EvenExp", 18), binding("EvenValue", 262144), binding("Product", 524288)]),
232
- uses([
233
- proof(
234
- goal(gt(19, 0)),
235
- by(builtin(gt, 2))
236
- ),
237
- proof(
238
- goal(mod(19, 2, 1)),
239
- by(builtin(mod, 3))
240
- ),
241
- proof(
242
- goal(sub(19, 1, 18)),
243
- by(builtin(sub, 3))
244
- ),
245
- proof(
246
- goal(pow_mod(2, 18, 1000000, 262144)),
247
- by(rule("fastpow.pl", clause(10))),
248
- bindings([binding("Base", 2), binding("Exp", 18), binding("Mod", 1000000), binding("Value", 262144), binding("Half", 9), binding("HalfValue", 512), binding("Square", 262144)]),
249
- uses([
250
- proof(
251
- goal(gt(18, 0)),
252
- by(builtin(gt, 2))
253
- ),
254
- proof(
255
- goal(mod(18, 2, 0)),
256
- by(builtin(mod, 3))
257
- ),
258
- proof(
259
- goal(div(18, 2, 9)),
260
- by(builtin(div, 3))
261
- ),
262
- proof(
263
- goal(pow_mod(2, 9, 1000000, 512)),
264
- by(rule("fastpow.pl", clause(11))),
265
- bindings([binding("Base", 2), binding("Exp", 9), binding("Mod", 1000000), binding("Value", 512), binding("EvenExp", 8), binding("EvenValue", 256), binding("Product", 512)]),
266
- uses([
267
- proof(
268
- goal(gt(9, 0)),
269
- by(builtin(gt, 2))
270
- ),
271
- proof(
272
- goal(mod(9, 2, 1)),
273
- by(builtin(mod, 3))
274
- ),
275
- proof(
276
- goal(sub(9, 1, 8)),
277
- by(builtin(sub, 3))
278
- ),
279
- proof(
280
- goal(pow_mod(2, 8, 1000000, 256)),
281
- by(rule("fastpow.pl", clause(10))),
282
- bindings([binding("Base", 2), binding("Exp", 8), binding("Mod", 1000000), binding("Value", 256), binding("Half", 4), binding("HalfValue", 16), binding("Square", 256)]),
283
- uses([
284
- proof(
285
- goal(gt(8, 0)),
286
- by(builtin(gt, 2))
287
- ),
288
- proof(
289
- goal(mod(8, 2, 0)),
290
- by(builtin(mod, 3))
291
- ),
292
- proof(
293
- goal(div(8, 2, 4)),
294
- by(builtin(div, 3))
295
- ),
296
- proof(
297
- goal(pow_mod(2, 4, 1000000, 16)),
298
- by(rule("fastpow.pl", clause(10))),
299
- bindings([binding("Base", 2), binding("Exp", 4), binding("Mod", 1000000), binding("Value", 16), binding("Half", 2), binding("HalfValue", 4), binding("Square", 16)]),
300
- uses([
301
- proof(
302
- goal(gt(4, 0)),
303
- by(builtin(gt, 2))
304
- ),
305
- proof(
306
- goal(mod(4, 2, 0)),
307
- by(builtin(mod, 3))
308
- ),
309
- proof(
310
- goal(div(4, 2, 2)),
311
- by(builtin(div, 3))
312
- ),
313
- proof(
314
- goal(pow_mod(2, 2, 1000000, 4)),
315
- by(rule("fastpow.pl", clause(10))),
316
- bindings([binding("Base", 2), binding("Exp", 2), binding("Mod", 1000000), binding("Value", 4), binding("Half", 1), binding("HalfValue", 2), binding("Square", 4)]),
317
- uses([
318
- proof(
319
- goal(gt(2, 0)),
320
- by(builtin(gt, 2))
321
- ),
322
- proof(
323
- goal(mod(2, 2, 0)),
324
- by(builtin(mod, 3))
325
- ),
326
- proof(
327
- goal(div(2, 2, 1)),
328
- by(builtin(div, 3))
329
- ),
330
- proof(
331
- goal(pow_mod(2, 1, 1000000, 2)),
332
- by(rule("fastpow.pl", clause(11))),
333
- bindings([binding("Base", 2), binding("Exp", 1), binding("Mod", 1000000), binding("Value", 2), binding("EvenExp", 0), binding("EvenValue", 1), binding("Product", 2)]),
334
- uses([
335
- proof(
336
- goal(gt(1, 0)),
337
- by(builtin(gt, 2))
338
- ),
339
- proof(
340
- goal(mod(1, 2, 1)),
341
- by(builtin(mod, 3))
342
- ),
343
- proof(
344
- goal(sub(1, 1, 0)),
345
- by(builtin(sub, 3))
346
- ),
347
- proof(
348
- goal(pow_mod(2, 0, 1000000, 1)),
349
- by(fact("fastpow.pl", clause(9))),
350
- bindings([binding("_Base", 2), binding("_Mod", 1000000)])
351
- ),
352
- proof(
353
- goal(mul(2, 1, 2)),
354
- by(builtin(mul, 3))
355
- ),
356
- proof(
357
- goal(mod(2, 1000000, 2)),
358
- by(builtin(mod, 3))
359
- )
360
- ])
361
- ),
362
- proof(
363
- goal(mul(2, 2, 4)),
364
- by(builtin(mul, 3))
365
- ),
366
- proof(
367
- goal(mod(4, 1000000, 4)),
368
- by(builtin(mod, 3))
369
- )
370
- ])
371
- ),
372
- proof(
373
- goal(mul(4, 4, 16)),
374
- by(builtin(mul, 3))
375
- ),
376
- proof(
377
- goal(mod(16, 1000000, 16)),
378
- by(builtin(mod, 3))
379
- )
380
- ])
381
- ),
382
- proof(
383
- goal(mul(16, 16, 256)),
384
- by(builtin(mul, 3))
385
- ),
386
- proof(
387
- goal(mod(256, 1000000, 256)),
388
- by(builtin(mod, 3))
389
- )
390
- ])
391
- ),
392
- proof(
393
- goal(mul(2, 256, 512)),
394
- by(builtin(mul, 3))
395
- ),
396
- proof(
397
- goal(mod(512, 1000000, 512)),
398
- by(builtin(mod, 3))
399
- )
400
- ])
401
- ),
402
- proof(
403
- goal(mul(512, 512, 262144)),
404
- by(builtin(mul, 3))
405
- ),
406
- proof(
407
- goal(mod(262144, 1000000, 262144)),
408
- by(builtin(mod, 3))
409
- )
410
- ])
411
- ),
412
- proof(
413
- goal(mul(2, 262144, 524288)),
414
- by(builtin(mul, 3))
415
- ),
416
- proof(
417
- goal(mod(524288, 1000000, 524288)),
418
- by(builtin(mod, 3))
419
- )
420
- ])
421
- ),
422
- proof(
423
- goal(mul(524288, 524288, 274877906944)),
424
- by(builtin(mul, 3))
425
- ),
426
- proof(
427
- goal(mod(274877906944, 1000000, 906944)),
428
- by(builtin(mod, 3))
429
- )
430
- ])
431
- ),
432
- proof(
433
- goal(mul(2, 906944, 1813888)),
434
- by(builtin(mul, 3))
435
- ),
436
- proof(
437
- goal(mod(1813888, 1000000, 813888)),
438
- by(builtin(mod, 3))
439
- )
440
- ])
441
- ),
442
- proof(
443
- goal(mul(813888, 813888, 662413676544)),
444
- by(builtin(mul, 3))
445
- ),
446
- proof(
447
- goal(mod(662413676544, 1000000, 676544)),
448
- by(builtin(mod, 3))
449
- )
450
- ])
451
- ),
452
- proof(
453
- goal(mul(676544, 676544, 457711783936)),
454
- by(builtin(mul, 3))
455
- ),
456
- proof(
457
- goal(mod(457711783936, 1000000, 783936)),
458
- by(builtin(mod, 3))
459
- )
460
- ])
461
- ),
462
- proof(
463
- goal(mul(783936, 783936, 614555652096)),
464
- by(builtin(mul, 3))
465
- ),
466
- proof(
467
- goal(mod(614555652096, 1000000, 652096)),
468
- by(builtin(mod, 3))
469
- )
470
- ])
471
- ),
472
- proof(
473
- goal(mul(652096, 652096, 425229193216)),
474
- by(builtin(mul, 3))
475
- ),
476
- proof(
477
- goal(mod(425229193216, 1000000, 193216)),
478
- by(builtin(mod, 3))
479
- )
480
- ])
481
- ),
482
- proof(
483
- goal(mul(2, 193216, 386432)),
484
- by(builtin(mul, 3))
485
- ),
486
- proof(
487
- goal(mod(386432, 1000000, 386432)),
488
- by(builtin(mod, 3))
489
- )
490
- ])
491
- ),
492
- proof(
493
- goal(mul(386432, 386432, 149329690624)),
494
- by(builtin(mul, 3))
495
- ),
496
- proof(
497
- goal(mod(149329690624, 1000000, 690624)),
498
- by(builtin(mod, 3))
499
- )
500
- ])
501
- ),
502
- proof(
503
- goal(mul(690624, 690624, 476961509376)),
504
- by(builtin(mul, 3))
505
- ),
506
- proof(
507
- goal(mod(476961509376, 1000000, 509376)),
508
- by(builtin(mod, 3))
509
- )
510
- ])
511
- ),
512
- proof(
513
- goal(mul(509376, 509376, 259463909376)),
514
- by(builtin(mul, 3))
515
- ),
516
- proof(
517
- goal(mod(259463909376, 1000000, 909376)),
518
- by(builtin(mod, 3))
519
- )
520
- ])
521
- ),
522
- proof(
523
- goal(mul(909376, 909376, 826964709376)),
524
- by(builtin(mul, 3))
525
- ),
526
- proof(
527
- goal(mod(826964709376, 1000000, 709376)),
528
- by(builtin(mod, 3))
529
- )
530
- ])
531
- )
532
- ])
533
- )
534
- ).
535
-
536
4
  powMod1e6([3, 10000], 200001).
537
- why(
538
- powMod1e6([3, 10000], 200001),
539
- proof(
540
- goal(powMod1e6([3, 10000], 200001)),
541
- by(rule("fastpow.pl", clause(17))),
542
- bindings([binding("Value", 200001)]),
543
- uses([
544
- proof(
545
- goal(pow_mod(3, 10000, 1000000, 200001)),
546
- by(rule("fastpow.pl", clause(10))),
547
- bindings([binding("Base", 3), binding("Exp", 10000), binding("Mod", 1000000), binding("Value", 200001), binding("Half", 5000), binding("HalfValue", 100001), binding("Square", 10000200001)]),
548
- uses([
549
- proof(
550
- goal(gt(10000, 0)),
551
- by(builtin(gt, 2))
552
- ),
553
- proof(
554
- goal(mod(10000, 2, 0)),
555
- by(builtin(mod, 3))
556
- ),
557
- proof(
558
- goal(div(10000, 2, 5000)),
559
- by(builtin(div, 3))
560
- ),
561
- proof(
562
- goal(pow_mod(3, 5000, 1000000, 100001)),
563
- by(rule("fastpow.pl", clause(10))),
564
- bindings([binding("Base", 3), binding("Exp", 5000), binding("Mod", 1000000), binding("Value", 100001), binding("Half", 2500), binding("HalfValue", 50001), binding("Square", 2500100001)]),
565
- uses([
566
- proof(
567
- goal(gt(5000, 0)),
568
- by(builtin(gt, 2))
569
- ),
570
- proof(
571
- goal(mod(5000, 2, 0)),
572
- by(builtin(mod, 3))
573
- ),
574
- proof(
575
- goal(div(5000, 2, 2500)),
576
- by(builtin(div, 3))
577
- ),
578
- proof(
579
- goal(pow_mod(3, 2500, 1000000, 50001)),
580
- by(rule("fastpow.pl", clause(10))),
581
- bindings([binding("Base", 3), binding("Exp", 2500), binding("Mod", 1000000), binding("Value", 50001), binding("Half", 1250), binding("HalfValue", 506249), binding("Square", 256288050001)]),
582
- uses([
583
- proof(
584
- goal(gt(2500, 0)),
585
- by(builtin(gt, 2))
586
- ),
587
- proof(
588
- goal(mod(2500, 2, 0)),
589
- by(builtin(mod, 3))
590
- ),
591
- proof(
592
- goal(div(2500, 2, 1250)),
593
- by(builtin(div, 3))
594
- ),
595
- proof(
596
- goal(pow_mod(3, 1250, 1000000, 506249)),
597
- by(rule("fastpow.pl", clause(10))),
598
- bindings([binding("Base", 3), binding("Exp", 1250), binding("Mod", 1000000), binding("Value", 506249), binding("Half", 625), binding("HalfValue", 85443), binding("Square", 7300506249)]),
599
- uses([
600
- proof(
601
- goal(gt(1250, 0)),
602
- by(builtin(gt, 2))
603
- ),
604
- proof(
605
- goal(mod(1250, 2, 0)),
606
- by(builtin(mod, 3))
607
- ),
608
- proof(
609
- goal(div(1250, 2, 625)),
610
- by(builtin(div, 3))
611
- ),
612
- proof(
613
- goal(pow_mod(3, 625, 1000000, 85443)),
614
- by(rule("fastpow.pl", clause(11))),
615
- bindings([binding("Base", 3), binding("Exp", 625), binding("Mod", 1000000), binding("Value", 85443), binding("EvenExp", 624), binding("EvenValue", 28481), binding("Product", 85443)]),
616
- uses([
617
- proof(
618
- goal(gt(625, 0)),
619
- by(builtin(gt, 2))
620
- ),
621
- proof(
622
- goal(mod(625, 2, 1)),
623
- by(builtin(mod, 3))
624
- ),
625
- proof(
626
- goal(sub(625, 1, 624)),
627
- by(builtin(sub, 3))
628
- ),
629
- proof(
630
- goal(pow_mod(3, 624, 1000000, 28481)),
631
- by(rule("fastpow.pl", clause(10))),
632
- bindings([binding("Base", 3), binding("Exp", 624), binding("Mod", 1000000), binding("Value", 28481), binding("Half", 312), binding("HalfValue", 137441), binding("Square", 18890028481)]),
633
- uses([
634
- proof(
635
- goal(gt(624, 0)),
636
- by(builtin(gt, 2))
637
- ),
638
- proof(
639
- goal(mod(624, 2, 0)),
640
- by(builtin(mod, 3))
641
- ),
642
- proof(
643
- goal(div(624, 2, 312)),
644
- by(builtin(div, 3))
645
- ),
646
- proof(
647
- goal(pow_mod(3, 312, 1000000, 137441)),
648
- by(rule("fastpow.pl", clause(10))),
649
- bindings([binding("Base", 3), binding("Exp", 312), binding("Mod", 1000000), binding("Value", 137441), binding("Half", 156), binding("HalfValue", 473521), binding("Square", 224222137441)]),
650
- uses([
651
- proof(
652
- goal(gt(312, 0)),
653
- by(builtin(gt, 2))
654
- ),
655
- proof(
656
- goal(mod(312, 2, 0)),
657
- by(builtin(mod, 3))
658
- ),
659
- proof(
660
- goal(div(312, 2, 156)),
661
- by(builtin(div, 3))
662
- ),
663
- proof(
664
- goal(pow_mod(3, 156, 1000000, 473521)),
665
- by(rule("fastpow.pl", clause(10))),
666
- bindings([binding("Base", 3), binding("Exp", 156), binding("Mod", 1000000), binding("Value", 473521), binding("Half", 78), binding("HalfValue", 255289), binding("Square", 65172473521)]),
667
- uses([
668
- proof(
669
- goal(gt(156, 0)),
670
- by(builtin(gt, 2))
671
- ),
672
- proof(
673
- goal(mod(156, 2, 0)),
674
- by(builtin(mod, 3))
675
- ),
676
- proof(
677
- goal(div(156, 2, 78)),
678
- by(builtin(div, 3))
679
- ),
680
- proof(
681
- goal(pow_mod(3, 78, 1000000, 255289)),
682
- by(rule("fastpow.pl", clause(10))),
683
- bindings([binding("Base", 3), binding("Exp", 78), binding("Mod", 1000000), binding("Value", 255289), binding("Half", 39), binding("HalfValue", 976267), binding("Square", 953097255289)]),
684
- uses([
685
- proof(
686
- goal(gt(78, 0)),
687
- by(builtin(gt, 2))
688
- ),
689
- proof(
690
- goal(mod(78, 2, 0)),
691
- by(builtin(mod, 3))
692
- ),
693
- proof(
694
- goal(div(78, 2, 39)),
695
- by(builtin(div, 3))
696
- ),
697
- proof(
698
- goal(pow_mod(3, 39, 1000000, 976267)),
699
- by(rule("fastpow.pl", clause(11))),
700
- bindings([binding("Base", 3), binding("Exp", 39), binding("Mod", 1000000), binding("Value", 976267), binding("EvenExp", 38), binding("EvenValue", 992089), binding("Product", 2976267)]),
701
- uses([
702
- proof(
703
- goal(gt(39, 0)),
704
- by(builtin(gt, 2))
705
- ),
706
- proof(
707
- goal(mod(39, 2, 1)),
708
- by(builtin(mod, 3))
709
- ),
710
- proof(
711
- goal(sub(39, 1, 38)),
712
- by(builtin(sub, 3))
713
- ),
714
- proof(
715
- goal(pow_mod(3, 38, 1000000, 992089)),
716
- by(rule("fastpow.pl", clause(10))),
717
- bindings([binding("Base", 3), binding("Exp", 38), binding("Mod", 1000000), binding("Value", 992089), binding("Half", 19), binding("HalfValue", 261467), binding("Square", 68364992089)]),
718
- uses([
719
- proof(
720
- goal(gt(38, 0)),
721
- by(builtin(gt, 2))
722
- ),
723
- proof(
724
- goal(mod(38, 2, 0)),
725
- by(builtin(mod, 3))
726
- ),
727
- proof(
728
- goal(div(38, 2, 19)),
729
- by(builtin(div, 3))
730
- ),
731
- proof(
732
- goal(pow_mod(3, 19, 1000000, 261467)),
733
- by(rule("fastpow.pl", clause(11))),
734
- bindings([binding("Base", 3), binding("Exp", 19), binding("Mod", 1000000), binding("Value", 261467), binding("EvenExp", 18), binding("EvenValue", 420489), binding("Product", 1261467)]),
735
- uses([
736
- proof(
737
- goal(gt(19, 0)),
738
- by(builtin(gt, 2))
739
- ),
740
- proof(
741
- goal(mod(19, 2, 1)),
742
- by(builtin(mod, 3))
743
- ),
744
- proof(
745
- goal(sub(19, 1, 18)),
746
- by(builtin(sub, 3))
747
- ),
748
- proof(
749
- goal(pow_mod(3, 18, 1000000, 420489)),
750
- by(rule("fastpow.pl", clause(10))),
751
- bindings([binding("Base", 3), binding("Exp", 18), binding("Mod", 1000000), binding("Value", 420489), binding("Half", 9), binding("HalfValue", 19683), binding("Square", 387420489)]),
752
- uses([
753
- proof(
754
- goal(gt(18, 0)),
755
- by(builtin(gt, 2))
756
- ),
757
- proof(
758
- goal(mod(18, 2, 0)),
759
- by(builtin(mod, 3))
760
- ),
761
- proof(
762
- goal(div(18, 2, 9)),
763
- by(builtin(div, 3))
764
- ),
765
- proof(
766
- goal(pow_mod(3, 9, 1000000, 19683)),
767
- by(rule("fastpow.pl", clause(11))),
768
- bindings([binding("Base", 3), binding("Exp", 9), binding("Mod", 1000000), binding("Value", 19683), binding("EvenExp", 8), binding("EvenValue", 6561), binding("Product", 19683)]),
769
- uses([
770
- proof(
771
- goal(gt(9, 0)),
772
- by(builtin(gt, 2))
773
- ),
774
- proof(
775
- goal(mod(9, 2, 1)),
776
- by(builtin(mod, 3))
777
- ),
778
- proof(
779
- goal(sub(9, 1, 8)),
780
- by(builtin(sub, 3))
781
- ),
782
- proof(
783
- goal(pow_mod(3, 8, 1000000, 6561)),
784
- by(rule("fastpow.pl", clause(10))),
785
- bindings([binding("Base", 3), binding("Exp", 8), binding("Mod", 1000000), binding("Value", 6561), binding("Half", 4), binding("HalfValue", 81), binding("Square", 6561)]),
786
- uses([
787
- proof(
788
- goal(gt(8, 0)),
789
- by(builtin(gt, 2))
790
- ),
791
- proof(
792
- goal(mod(8, 2, 0)),
793
- by(builtin(mod, 3))
794
- ),
795
- proof(
796
- goal(div(8, 2, 4)),
797
- by(builtin(div, 3))
798
- ),
799
- proof(
800
- goal(pow_mod(3, 4, 1000000, 81)),
801
- by(rule("fastpow.pl", clause(10))),
802
- bindings([binding("Base", 3), binding("Exp", 4), binding("Mod", 1000000), binding("Value", 81), binding("Half", 2), binding("HalfValue", 9), binding("Square", 81)]),
803
- uses([
804
- proof(
805
- goal(gt(4, 0)),
806
- by(builtin(gt, 2))
807
- ),
808
- proof(
809
- goal(mod(4, 2, 0)),
810
- by(builtin(mod, 3))
811
- ),
812
- proof(
813
- goal(div(4, 2, 2)),
814
- by(builtin(div, 3))
815
- ),
816
- proof(
817
- goal(pow_mod(3, 2, 1000000, 9)),
818
- by(rule("fastpow.pl", clause(10))),
819
- bindings([binding("Base", 3), binding("Exp", 2), binding("Mod", 1000000), binding("Value", 9), binding("Half", 1), binding("HalfValue", 3), binding("Square", 9)]),
820
- uses([
821
- proof(
822
- goal(gt(2, 0)),
823
- by(builtin(gt, 2))
824
- ),
825
- proof(
826
- goal(mod(2, 2, 0)),
827
- by(builtin(mod, 3))
828
- ),
829
- proof(
830
- goal(div(2, 2, 1)),
831
- by(builtin(div, 3))
832
- ),
833
- proof(
834
- goal(pow_mod(3, 1, 1000000, 3)),
835
- by(rule("fastpow.pl", clause(11))),
836
- bindings([binding("Base", 3), binding("Exp", 1), binding("Mod", 1000000), binding("Value", 3), binding("EvenExp", 0), binding("EvenValue", 1), binding("Product", 3)]),
837
- uses([
838
- proof(
839
- goal(gt(1, 0)),
840
- by(builtin(gt, 2))
841
- ),
842
- proof(
843
- goal(mod(1, 2, 1)),
844
- by(builtin(mod, 3))
845
- ),
846
- proof(
847
- goal(sub(1, 1, 0)),
848
- by(builtin(sub, 3))
849
- ),
850
- proof(
851
- goal(pow_mod(3, 0, 1000000, 1)),
852
- by(fact("fastpow.pl", clause(9))),
853
- bindings([binding("_Base", 3), binding("_Mod", 1000000)])
854
- ),
855
- proof(
856
- goal(mul(3, 1, 3)),
857
- by(builtin(mul, 3))
858
- ),
859
- proof(
860
- goal(mod(3, 1000000, 3)),
861
- by(builtin(mod, 3))
862
- )
863
- ])
864
- ),
865
- proof(
866
- goal(mul(3, 3, 9)),
867
- by(builtin(mul, 3))
868
- ),
869
- proof(
870
- goal(mod(9, 1000000, 9)),
871
- by(builtin(mod, 3))
872
- )
873
- ])
874
- ),
875
- proof(
876
- goal(mul(9, 9, 81)),
877
- by(builtin(mul, 3))
878
- ),
879
- proof(
880
- goal(mod(81, 1000000, 81)),
881
- by(builtin(mod, 3))
882
- )
883
- ])
884
- ),
885
- proof(
886
- goal(mul(81, 81, 6561)),
887
- by(builtin(mul, 3))
888
- ),
889
- proof(
890
- goal(mod(6561, 1000000, 6561)),
891
- by(builtin(mod, 3))
892
- )
893
- ])
894
- ),
895
- proof(
896
- goal(mul(3, 6561, 19683)),
897
- by(builtin(mul, 3))
898
- ),
899
- proof(
900
- goal(mod(19683, 1000000, 19683)),
901
- by(builtin(mod, 3))
902
- )
903
- ])
904
- ),
905
- proof(
906
- goal(mul(19683, 19683, 387420489)),
907
- by(builtin(mul, 3))
908
- ),
909
- proof(
910
- goal(mod(387420489, 1000000, 420489)),
911
- by(builtin(mod, 3))
912
- )
913
- ])
914
- ),
915
- proof(
916
- goal(mul(3, 420489, 1261467)),
917
- by(builtin(mul, 3))
918
- ),
919
- proof(
920
- goal(mod(1261467, 1000000, 261467)),
921
- by(builtin(mod, 3))
922
- )
923
- ])
924
- ),
925
- proof(
926
- goal(mul(261467, 261467, 68364992089)),
927
- by(builtin(mul, 3))
928
- ),
929
- proof(
930
- goal(mod(68364992089, 1000000, 992089)),
931
- by(builtin(mod, 3))
932
- )
933
- ])
934
- ),
935
- proof(
936
- goal(mul(3, 992089, 2976267)),
937
- by(builtin(mul, 3))
938
- ),
939
- proof(
940
- goal(mod(2976267, 1000000, 976267)),
941
- by(builtin(mod, 3))
942
- )
943
- ])
944
- ),
945
- proof(
946
- goal(mul(976267, 976267, 953097255289)),
947
- by(builtin(mul, 3))
948
- ),
949
- proof(
950
- goal(mod(953097255289, 1000000, 255289)),
951
- by(builtin(mod, 3))
952
- )
953
- ])
954
- ),
955
- proof(
956
- goal(mul(255289, 255289, 65172473521)),
957
- by(builtin(mul, 3))
958
- ),
959
- proof(
960
- goal(mod(65172473521, 1000000, 473521)),
961
- by(builtin(mod, 3))
962
- )
963
- ])
964
- ),
965
- proof(
966
- goal(mul(473521, 473521, 224222137441)),
967
- by(builtin(mul, 3))
968
- ),
969
- proof(
970
- goal(mod(224222137441, 1000000, 137441)),
971
- by(builtin(mod, 3))
972
- )
973
- ])
974
- ),
975
- proof(
976
- goal(mul(137441, 137441, 18890028481)),
977
- by(builtin(mul, 3))
978
- ),
979
- proof(
980
- goal(mod(18890028481, 1000000, 28481)),
981
- by(builtin(mod, 3))
982
- )
983
- ])
984
- ),
985
- proof(
986
- goal(mul(3, 28481, 85443)),
987
- by(builtin(mul, 3))
988
- ),
989
- proof(
990
- goal(mod(85443, 1000000, 85443)),
991
- by(builtin(mod, 3))
992
- )
993
- ])
994
- ),
995
- proof(
996
- goal(mul(85443, 85443, 7300506249)),
997
- by(builtin(mul, 3))
998
- ),
999
- proof(
1000
- goal(mod(7300506249, 1000000, 506249)),
1001
- by(builtin(mod, 3))
1002
- )
1003
- ])
1004
- ),
1005
- proof(
1006
- goal(mul(506249, 506249, 256288050001)),
1007
- by(builtin(mul, 3))
1008
- ),
1009
- proof(
1010
- goal(mod(256288050001, 1000000, 50001)),
1011
- by(builtin(mod, 3))
1012
- )
1013
- ])
1014
- ),
1015
- proof(
1016
- goal(mul(50001, 50001, 2500100001)),
1017
- by(builtin(mul, 3))
1018
- ),
1019
- proof(
1020
- goal(mod(2500100001, 1000000, 100001)),
1021
- by(builtin(mod, 3))
1022
- )
1023
- ])
1024
- ),
1025
- proof(
1026
- goal(mul(100001, 100001, 10000200001)),
1027
- by(builtin(mul, 3))
1028
- ),
1029
- proof(
1030
- goal(mod(10000200001, 1000000, 200001)),
1031
- by(builtin(mod, 3))
1032
- )
1033
- ])
1034
- )
1035
- ])
1036
- )
1037
- ).
1038
-
1039
5
  tower([2, 4], 65536).
1040
- why(
1041
- tower([2, 4], 65536),
1042
- proof(
1043
- goal(tower([2, 4], 65536)),
1044
- by(rule("fastpow.pl", clause(18))),
1045
- bindings([binding("Value", 65536)]),
1046
- uses([
1047
- proof(
1048
- goal(tower(2, 4, 65536)),
1049
- by(fact("fastpow.pl", clause(12)))
1050
- )
1051
- ])
1052
- )
1053
- ).
1054
-
1055
6
  towerMod1e6([2, 5], 156736).
1056
- why(
1057
- towerMod1e6([2, 5], 156736),
1058
- proof(
1059
- goal(towerMod1e6([2, 5], 156736)),
1060
- by(rule("fastpow.pl", clause(19))),
1061
- bindings([binding("Value", 156736)]),
1062
- uses([
1063
- proof(
1064
- goal(tower_mod(2, 5, 1000000, 156736)),
1065
- by(fact("fastpow.pl", clause(13)))
1066
- )
1067
- ])
1068
- )
1069
- ).
1070
-