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,2671 +1,6 @@
1
1
  syndrome(packet1, 5).
2
- why(
3
- syndrome(packet1, 5),
4
- proof(
5
- goal(syndrome(packet1, 5)),
6
- by(rule("hamming-code.pl", clause(20))),
7
- bindings([binding("Code", packet1), binding("Syndrome", 5), binding("S1", 1), binding("S2", 0), binding("S4", 1), binding("WeightedS2", 0), binding("WeightedS4", 4), binding("Partial", 1)]),
8
- uses([
9
- proof(
10
- goal(syndrome_bit1(packet1, 1)),
11
- by(rule("hamming-code.pl", clause(17))),
12
- bindings([binding("Code", packet1), binding("S1", 1), binding("B1", 1), binding("B3", 1), binding("B5", 1), binding("B7", 0)]),
13
- uses([
14
- proof(
15
- goal(received_bit(packet1, 1, 1)),
16
- by(fact("hamming-code.pl", clause(7)))
17
- ),
18
- proof(
19
- goal(received_bit(packet1, 3, 1)),
20
- by(fact("hamming-code.pl", clause(9)))
21
- ),
22
- proof(
23
- goal(received_bit(packet1, 5, 1)),
24
- by(fact("hamming-code.pl", clause(11)))
25
- ),
26
- proof(
27
- goal(received_bit(packet1, 7, 0)),
28
- by(fact("hamming-code.pl", clause(13)))
29
- ),
30
- proof(
31
- goal(parity4(1, 1, 1, 0, 1)),
32
- by(rule("hamming-code.pl", clause(16))),
33
- bindings([binding("A", 1), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 1), binding("AB", 2), binding("ABC", 3), binding("Sum", 3)]),
34
- uses([
35
- proof(
36
- goal(add(1, 1, 2)),
37
- by(builtin(add, 3))
38
- ),
39
- proof(
40
- goal(add(2, 1, 3)),
41
- by(builtin(add, 3))
42
- ),
43
- proof(
44
- goal(add(3, 0, 3)),
45
- by(builtin(add, 3))
46
- ),
47
- proof(
48
- goal(mod(3, 2, 1)),
49
- by(builtin(mod, 3))
50
- )
51
- ])
52
- )
53
- ])
54
- ),
55
- proof(
56
- goal(syndrome_bit2(packet1, 0)),
57
- by(rule("hamming-code.pl", clause(18))),
58
- bindings([binding("Code", packet1), binding("S2", 0), binding("B2", 0), binding("B3", 1), binding("B6", 1), binding("B7", 0)]),
59
- uses([
60
- proof(
61
- goal(received_bit(packet1, 2, 0)),
62
- by(fact("hamming-code.pl", clause(8)))
63
- ),
64
- proof(
65
- goal(received_bit(packet1, 3, 1)),
66
- by(fact("hamming-code.pl", clause(9)))
67
- ),
68
- proof(
69
- goal(received_bit(packet1, 6, 1)),
70
- by(fact("hamming-code.pl", clause(12)))
71
- ),
72
- proof(
73
- goal(received_bit(packet1, 7, 0)),
74
- by(fact("hamming-code.pl", clause(13)))
75
- ),
76
- proof(
77
- goal(parity4(0, 1, 1, 0, 0)),
78
- by(rule("hamming-code.pl", clause(16))),
79
- bindings([binding("A", 0), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 0), binding("AB", 1), binding("ABC", 2), binding("Sum", 2)]),
80
- uses([
81
- proof(
82
- goal(add(0, 1, 1)),
83
- by(builtin(add, 3))
84
- ),
85
- proof(
86
- goal(add(1, 1, 2)),
87
- by(builtin(add, 3))
88
- ),
89
- proof(
90
- goal(add(2, 0, 2)),
91
- by(builtin(add, 3))
92
- ),
93
- proof(
94
- goal(mod(2, 2, 0)),
95
- by(builtin(mod, 3))
96
- )
97
- ])
98
- )
99
- ])
100
- ),
101
- proof(
102
- goal(syndrome_bit4(packet1, 1)),
103
- by(rule("hamming-code.pl", clause(19))),
104
- bindings([binding("Code", packet1), binding("S4", 1), binding("B4", 1), binding("B5", 1), binding("B6", 1), binding("B7", 0)]),
105
- uses([
106
- proof(
107
- goal(received_bit(packet1, 4, 1)),
108
- by(fact("hamming-code.pl", clause(10)))
109
- ),
110
- proof(
111
- goal(received_bit(packet1, 5, 1)),
112
- by(fact("hamming-code.pl", clause(11)))
113
- ),
114
- proof(
115
- goal(received_bit(packet1, 6, 1)),
116
- by(fact("hamming-code.pl", clause(12)))
117
- ),
118
- proof(
119
- goal(received_bit(packet1, 7, 0)),
120
- by(fact("hamming-code.pl", clause(13)))
121
- ),
122
- proof(
123
- goal(parity4(1, 1, 1, 0, 1)),
124
- by(rule("hamming-code.pl", clause(16))),
125
- bindings([binding("A", 1), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 1), binding("AB", 2), binding("ABC", 3), binding("Sum", 3)]),
126
- uses([
127
- proof(
128
- goal(add(1, 1, 2)),
129
- by(builtin(add, 3))
130
- ),
131
- proof(
132
- goal(add(2, 1, 3)),
133
- by(builtin(add, 3))
134
- ),
135
- proof(
136
- goal(add(3, 0, 3)),
137
- by(builtin(add, 3))
138
- ),
139
- proof(
140
- goal(mod(3, 2, 1)),
141
- by(builtin(mod, 3))
142
- )
143
- ])
144
- )
145
- ])
146
- ),
147
- proof(
148
- goal(mul(0, 2, 0)),
149
- by(builtin(mul, 3))
150
- ),
151
- proof(
152
- goal(mul(1, 4, 4)),
153
- by(builtin(mul, 3))
154
- ),
155
- proof(
156
- goal(add(1, 0, 1)),
157
- by(builtin(add, 3))
158
- ),
159
- proof(
160
- goal(add(1, 4, 5)),
161
- by(builtin(add, 3))
162
- )
163
- ])
164
- )
165
- ).
166
-
167
2
  errorBit(packet1, 5).
168
- why(
169
- errorBit(packet1, 5),
170
- proof(
171
- goal(errorBit(packet1, 5)),
172
- by(rule("hamming-code.pl", clause(25))),
173
- bindings([binding("Code", packet1), binding("Position", 5)]),
174
- uses([
175
- proof(
176
- goal(syndrome(packet1, 5)),
177
- by(rule("hamming-code.pl", clause(20))),
178
- bindings([binding("Code", packet1), binding("Syndrome", 5), binding("S1", 1), binding("S2", 0), binding("S4", 1), binding("WeightedS2", 0), binding("WeightedS4", 4), binding("Partial", 1)]),
179
- uses([
180
- proof(
181
- goal(syndrome_bit1(packet1, 1)),
182
- by(rule("hamming-code.pl", clause(17))),
183
- bindings([binding("Code", packet1), binding("S1", 1), binding("B1", 1), binding("B3", 1), binding("B5", 1), binding("B7", 0)]),
184
- uses([
185
- proof(
186
- goal(received_bit(packet1, 1, 1)),
187
- by(fact("hamming-code.pl", clause(7)))
188
- ),
189
- proof(
190
- goal(received_bit(packet1, 3, 1)),
191
- by(fact("hamming-code.pl", clause(9)))
192
- ),
193
- proof(
194
- goal(received_bit(packet1, 5, 1)),
195
- by(fact("hamming-code.pl", clause(11)))
196
- ),
197
- proof(
198
- goal(received_bit(packet1, 7, 0)),
199
- by(fact("hamming-code.pl", clause(13)))
200
- ),
201
- proof(
202
- goal(parity4(1, 1, 1, 0, 1)),
203
- by(rule("hamming-code.pl", clause(16))),
204
- bindings([binding("A", 1), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 1), binding("AB", 2), binding("ABC", 3), binding("Sum", 3)]),
205
- uses([
206
- proof(
207
- goal(add(1, 1, 2)),
208
- by(builtin(add, 3))
209
- ),
210
- proof(
211
- goal(add(2, 1, 3)),
212
- by(builtin(add, 3))
213
- ),
214
- proof(
215
- goal(add(3, 0, 3)),
216
- by(builtin(add, 3))
217
- ),
218
- proof(
219
- goal(mod(3, 2, 1)),
220
- by(builtin(mod, 3))
221
- )
222
- ])
223
- )
224
- ])
225
- ),
226
- proof(
227
- goal(syndrome_bit2(packet1, 0)),
228
- by(rule("hamming-code.pl", clause(18))),
229
- bindings([binding("Code", packet1), binding("S2", 0), binding("B2", 0), binding("B3", 1), binding("B6", 1), binding("B7", 0)]),
230
- uses([
231
- proof(
232
- goal(received_bit(packet1, 2, 0)),
233
- by(fact("hamming-code.pl", clause(8)))
234
- ),
235
- proof(
236
- goal(received_bit(packet1, 3, 1)),
237
- by(fact("hamming-code.pl", clause(9)))
238
- ),
239
- proof(
240
- goal(received_bit(packet1, 6, 1)),
241
- by(fact("hamming-code.pl", clause(12)))
242
- ),
243
- proof(
244
- goal(received_bit(packet1, 7, 0)),
245
- by(fact("hamming-code.pl", clause(13)))
246
- ),
247
- proof(
248
- goal(parity4(0, 1, 1, 0, 0)),
249
- by(rule("hamming-code.pl", clause(16))),
250
- bindings([binding("A", 0), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 0), binding("AB", 1), binding("ABC", 2), binding("Sum", 2)]),
251
- uses([
252
- proof(
253
- goal(add(0, 1, 1)),
254
- by(builtin(add, 3))
255
- ),
256
- proof(
257
- goal(add(1, 1, 2)),
258
- by(builtin(add, 3))
259
- ),
260
- proof(
261
- goal(add(2, 0, 2)),
262
- by(builtin(add, 3))
263
- ),
264
- proof(
265
- goal(mod(2, 2, 0)),
266
- by(builtin(mod, 3))
267
- )
268
- ])
269
- )
270
- ])
271
- ),
272
- proof(
273
- goal(syndrome_bit4(packet1, 1)),
274
- by(rule("hamming-code.pl", clause(19))),
275
- bindings([binding("Code", packet1), binding("S4", 1), binding("B4", 1), binding("B5", 1), binding("B6", 1), binding("B7", 0)]),
276
- uses([
277
- proof(
278
- goal(received_bit(packet1, 4, 1)),
279
- by(fact("hamming-code.pl", clause(10)))
280
- ),
281
- proof(
282
- goal(received_bit(packet1, 5, 1)),
283
- by(fact("hamming-code.pl", clause(11)))
284
- ),
285
- proof(
286
- goal(received_bit(packet1, 6, 1)),
287
- by(fact("hamming-code.pl", clause(12)))
288
- ),
289
- proof(
290
- goal(received_bit(packet1, 7, 0)),
291
- by(fact("hamming-code.pl", clause(13)))
292
- ),
293
- proof(
294
- goal(parity4(1, 1, 1, 0, 1)),
295
- by(rule("hamming-code.pl", clause(16))),
296
- bindings([binding("A", 1), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 1), binding("AB", 2), binding("ABC", 3), binding("Sum", 3)]),
297
- uses([
298
- proof(
299
- goal(add(1, 1, 2)),
300
- by(builtin(add, 3))
301
- ),
302
- proof(
303
- goal(add(2, 1, 3)),
304
- by(builtin(add, 3))
305
- ),
306
- proof(
307
- goal(add(3, 0, 3)),
308
- by(builtin(add, 3))
309
- ),
310
- proof(
311
- goal(mod(3, 2, 1)),
312
- by(builtin(mod, 3))
313
- )
314
- ])
315
- )
316
- ])
317
- ),
318
- proof(
319
- goal(mul(0, 2, 0)),
320
- by(builtin(mul, 3))
321
- ),
322
- proof(
323
- goal(mul(1, 4, 4)),
324
- by(builtin(mul, 3))
325
- ),
326
- proof(
327
- goal(add(1, 0, 1)),
328
- by(builtin(add, 3))
329
- ),
330
- proof(
331
- goal(add(1, 4, 5)),
332
- by(builtin(add, 3))
333
- )
334
- ])
335
- ),
336
- proof(
337
- goal(gt(5, 0)),
338
- by(builtin(gt, 2))
339
- )
340
- ])
341
- )
342
- ).
343
-
344
3
  correctedCodeword(packet1, [1, 0, 1, 1, 0, 1, 0]).
345
- why(
346
- correctedCodeword(packet1, [1, 0, 1, 1, 0, 1, 0]),
347
- proof(
348
- goal(correctedCodeword(packet1, [1, 0, 1, 1, 0, 1, 0])),
349
- by(rule("hamming-code.pl", clause(26))),
350
- bindings([binding("Code", packet1), binding("Codeword", [1, 0, 1, 1, 0, 1, 0])]),
351
- uses([
352
- proof(
353
- goal(corrected_codeword(packet1, [1, 0, 1, 1, 0, 1, 0])),
354
- by(rule("hamming-code.pl", clause(23))),
355
- bindings([binding("Code", packet1), binding("B1", 1), binding("B2", 0), binding("B3", 1), binding("B4", 1), binding("B5", 0), binding("B6", 1), binding("B7", 0)]),
356
- uses([
357
- proof(
358
- goal(corrected_bit(packet1, 1, 1)),
359
- by(rule("hamming-code.pl", clause(22))),
360
- bindings([binding("Code", packet1), binding("Position", 1), binding("Bit", 1), binding("ErrorPosition", 5)]),
361
- uses([
362
- proof(
363
- goal(syndrome(packet1, 5)),
364
- by(rule("hamming-code.pl", clause(20))),
365
- bindings([binding("Code", packet1), binding("Syndrome", 5), binding("S1", 1), binding("S2", 0), binding("S4", 1), binding("WeightedS2", 0), binding("WeightedS4", 4), binding("Partial", 1)]),
366
- uses([
367
- proof(
368
- goal(syndrome_bit1(packet1, 1)),
369
- by(rule("hamming-code.pl", clause(17))),
370
- bindings([binding("Code", packet1), binding("S1", 1), binding("B1", 1), binding("B3", 1), binding("B5", 1), binding("B7", 0)]),
371
- uses([
372
- proof(
373
- goal(received_bit(packet1, 1, 1)),
374
- by(fact("hamming-code.pl", clause(7)))
375
- ),
376
- proof(
377
- goal(received_bit(packet1, 3, 1)),
378
- by(fact("hamming-code.pl", clause(9)))
379
- ),
380
- proof(
381
- goal(received_bit(packet1, 5, 1)),
382
- by(fact("hamming-code.pl", clause(11)))
383
- ),
384
- proof(
385
- goal(received_bit(packet1, 7, 0)),
386
- by(fact("hamming-code.pl", clause(13)))
387
- ),
388
- proof(
389
- goal(parity4(1, 1, 1, 0, 1)),
390
- by(rule("hamming-code.pl", clause(16))),
391
- bindings([binding("A", 1), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 1), binding("AB", 2), binding("ABC", 3), binding("Sum", 3)]),
392
- uses([
393
- proof(
394
- goal(add(1, 1, 2)),
395
- by(builtin(add, 3))
396
- ),
397
- proof(
398
- goal(add(2, 1, 3)),
399
- by(builtin(add, 3))
400
- ),
401
- proof(
402
- goal(add(3, 0, 3)),
403
- by(builtin(add, 3))
404
- ),
405
- proof(
406
- goal(mod(3, 2, 1)),
407
- by(builtin(mod, 3))
408
- )
409
- ])
410
- )
411
- ])
412
- ),
413
- proof(
414
- goal(syndrome_bit2(packet1, 0)),
415
- by(rule("hamming-code.pl", clause(18))),
416
- bindings([binding("Code", packet1), binding("S2", 0), binding("B2", 0), binding("B3", 1), binding("B6", 1), binding("B7", 0)]),
417
- uses([
418
- proof(
419
- goal(received_bit(packet1, 2, 0)),
420
- by(fact("hamming-code.pl", clause(8)))
421
- ),
422
- proof(
423
- goal(received_bit(packet1, 3, 1)),
424
- by(fact("hamming-code.pl", clause(9)))
425
- ),
426
- proof(
427
- goal(received_bit(packet1, 6, 1)),
428
- by(fact("hamming-code.pl", clause(12)))
429
- ),
430
- proof(
431
- goal(received_bit(packet1, 7, 0)),
432
- by(fact("hamming-code.pl", clause(13)))
433
- ),
434
- proof(
435
- goal(parity4(0, 1, 1, 0, 0)),
436
- by(rule("hamming-code.pl", clause(16))),
437
- bindings([binding("A", 0), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 0), binding("AB", 1), binding("ABC", 2), binding("Sum", 2)]),
438
- uses([
439
- proof(
440
- goal(add(0, 1, 1)),
441
- by(builtin(add, 3))
442
- ),
443
- proof(
444
- goal(add(1, 1, 2)),
445
- by(builtin(add, 3))
446
- ),
447
- proof(
448
- goal(add(2, 0, 2)),
449
- by(builtin(add, 3))
450
- ),
451
- proof(
452
- goal(mod(2, 2, 0)),
453
- by(builtin(mod, 3))
454
- )
455
- ])
456
- )
457
- ])
458
- ),
459
- proof(
460
- goal(syndrome_bit4(packet1, 1)),
461
- by(rule("hamming-code.pl", clause(19))),
462
- bindings([binding("Code", packet1), binding("S4", 1), binding("B4", 1), binding("B5", 1), binding("B6", 1), binding("B7", 0)]),
463
- uses([
464
- proof(
465
- goal(received_bit(packet1, 4, 1)),
466
- by(fact("hamming-code.pl", clause(10)))
467
- ),
468
- proof(
469
- goal(received_bit(packet1, 5, 1)),
470
- by(fact("hamming-code.pl", clause(11)))
471
- ),
472
- proof(
473
- goal(received_bit(packet1, 6, 1)),
474
- by(fact("hamming-code.pl", clause(12)))
475
- ),
476
- proof(
477
- goal(received_bit(packet1, 7, 0)),
478
- by(fact("hamming-code.pl", clause(13)))
479
- ),
480
- proof(
481
- goal(parity4(1, 1, 1, 0, 1)),
482
- by(rule("hamming-code.pl", clause(16))),
483
- bindings([binding("A", 1), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 1), binding("AB", 2), binding("ABC", 3), binding("Sum", 3)]),
484
- uses([
485
- proof(
486
- goal(add(1, 1, 2)),
487
- by(builtin(add, 3))
488
- ),
489
- proof(
490
- goal(add(2, 1, 3)),
491
- by(builtin(add, 3))
492
- ),
493
- proof(
494
- goal(add(3, 0, 3)),
495
- by(builtin(add, 3))
496
- ),
497
- proof(
498
- goal(mod(3, 2, 1)),
499
- by(builtin(mod, 3))
500
- )
501
- ])
502
- )
503
- ])
504
- ),
505
- proof(
506
- goal(mul(0, 2, 0)),
507
- by(builtin(mul, 3))
508
- ),
509
- proof(
510
- goal(mul(1, 4, 4)),
511
- by(builtin(mul, 3))
512
- ),
513
- proof(
514
- goal(add(1, 0, 1)),
515
- by(builtin(add, 3))
516
- ),
517
- proof(
518
- goal(add(1, 4, 5)),
519
- by(builtin(add, 3))
520
- )
521
- ])
522
- ),
523
- proof(
524
- goal(neq(1, 5)),
525
- by(builtin(neq, 2))
526
- ),
527
- proof(
528
- goal(received_bit(packet1, 1, 1)),
529
- by(fact("hamming-code.pl", clause(7)))
530
- )
531
- ])
532
- ),
533
- proof(
534
- goal(corrected_bit(packet1, 2, 0)),
535
- by(rule("hamming-code.pl", clause(22))),
536
- bindings([binding("Code", packet1), binding("Position", 2), binding("Bit", 0), binding("ErrorPosition", 5)]),
537
- uses([
538
- proof(
539
- goal(syndrome(packet1, 5)),
540
- by(rule("hamming-code.pl", clause(20))),
541
- bindings([binding("Code", packet1), binding("Syndrome", 5), binding("S1", 1), binding("S2", 0), binding("S4", 1), binding("WeightedS2", 0), binding("WeightedS4", 4), binding("Partial", 1)]),
542
- uses([
543
- proof(
544
- goal(syndrome_bit1(packet1, 1)),
545
- by(rule("hamming-code.pl", clause(17))),
546
- bindings([binding("Code", packet1), binding("S1", 1), binding("B1", 1), binding("B3", 1), binding("B5", 1), binding("B7", 0)]),
547
- uses([
548
- proof(
549
- goal(received_bit(packet1, 1, 1)),
550
- by(fact("hamming-code.pl", clause(7)))
551
- ),
552
- proof(
553
- goal(received_bit(packet1, 3, 1)),
554
- by(fact("hamming-code.pl", clause(9)))
555
- ),
556
- proof(
557
- goal(received_bit(packet1, 5, 1)),
558
- by(fact("hamming-code.pl", clause(11)))
559
- ),
560
- proof(
561
- goal(received_bit(packet1, 7, 0)),
562
- by(fact("hamming-code.pl", clause(13)))
563
- ),
564
- proof(
565
- goal(parity4(1, 1, 1, 0, 1)),
566
- by(rule("hamming-code.pl", clause(16))),
567
- bindings([binding("A", 1), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 1), binding("AB", 2), binding("ABC", 3), binding("Sum", 3)]),
568
- uses([
569
- proof(
570
- goal(add(1, 1, 2)),
571
- by(builtin(add, 3))
572
- ),
573
- proof(
574
- goal(add(2, 1, 3)),
575
- by(builtin(add, 3))
576
- ),
577
- proof(
578
- goal(add(3, 0, 3)),
579
- by(builtin(add, 3))
580
- ),
581
- proof(
582
- goal(mod(3, 2, 1)),
583
- by(builtin(mod, 3))
584
- )
585
- ])
586
- )
587
- ])
588
- ),
589
- proof(
590
- goal(syndrome_bit2(packet1, 0)),
591
- by(rule("hamming-code.pl", clause(18))),
592
- bindings([binding("Code", packet1), binding("S2", 0), binding("B2", 0), binding("B3", 1), binding("B6", 1), binding("B7", 0)]),
593
- uses([
594
- proof(
595
- goal(received_bit(packet1, 2, 0)),
596
- by(fact("hamming-code.pl", clause(8)))
597
- ),
598
- proof(
599
- goal(received_bit(packet1, 3, 1)),
600
- by(fact("hamming-code.pl", clause(9)))
601
- ),
602
- proof(
603
- goal(received_bit(packet1, 6, 1)),
604
- by(fact("hamming-code.pl", clause(12)))
605
- ),
606
- proof(
607
- goal(received_bit(packet1, 7, 0)),
608
- by(fact("hamming-code.pl", clause(13)))
609
- ),
610
- proof(
611
- goal(parity4(0, 1, 1, 0, 0)),
612
- by(rule("hamming-code.pl", clause(16))),
613
- bindings([binding("A", 0), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 0), binding("AB", 1), binding("ABC", 2), binding("Sum", 2)]),
614
- uses([
615
- proof(
616
- goal(add(0, 1, 1)),
617
- by(builtin(add, 3))
618
- ),
619
- proof(
620
- goal(add(1, 1, 2)),
621
- by(builtin(add, 3))
622
- ),
623
- proof(
624
- goal(add(2, 0, 2)),
625
- by(builtin(add, 3))
626
- ),
627
- proof(
628
- goal(mod(2, 2, 0)),
629
- by(builtin(mod, 3))
630
- )
631
- ])
632
- )
633
- ])
634
- ),
635
- proof(
636
- goal(syndrome_bit4(packet1, 1)),
637
- by(rule("hamming-code.pl", clause(19))),
638
- bindings([binding("Code", packet1), binding("S4", 1), binding("B4", 1), binding("B5", 1), binding("B6", 1), binding("B7", 0)]),
639
- uses([
640
- proof(
641
- goal(received_bit(packet1, 4, 1)),
642
- by(fact("hamming-code.pl", clause(10)))
643
- ),
644
- proof(
645
- goal(received_bit(packet1, 5, 1)),
646
- by(fact("hamming-code.pl", clause(11)))
647
- ),
648
- proof(
649
- goal(received_bit(packet1, 6, 1)),
650
- by(fact("hamming-code.pl", clause(12)))
651
- ),
652
- proof(
653
- goal(received_bit(packet1, 7, 0)),
654
- by(fact("hamming-code.pl", clause(13)))
655
- ),
656
- proof(
657
- goal(parity4(1, 1, 1, 0, 1)),
658
- by(rule("hamming-code.pl", clause(16))),
659
- bindings([binding("A", 1), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 1), binding("AB", 2), binding("ABC", 3), binding("Sum", 3)]),
660
- uses([
661
- proof(
662
- goal(add(1, 1, 2)),
663
- by(builtin(add, 3))
664
- ),
665
- proof(
666
- goal(add(2, 1, 3)),
667
- by(builtin(add, 3))
668
- ),
669
- proof(
670
- goal(add(3, 0, 3)),
671
- by(builtin(add, 3))
672
- ),
673
- proof(
674
- goal(mod(3, 2, 1)),
675
- by(builtin(mod, 3))
676
- )
677
- ])
678
- )
679
- ])
680
- ),
681
- proof(
682
- goal(mul(0, 2, 0)),
683
- by(builtin(mul, 3))
684
- ),
685
- proof(
686
- goal(mul(1, 4, 4)),
687
- by(builtin(mul, 3))
688
- ),
689
- proof(
690
- goal(add(1, 0, 1)),
691
- by(builtin(add, 3))
692
- ),
693
- proof(
694
- goal(add(1, 4, 5)),
695
- by(builtin(add, 3))
696
- )
697
- ])
698
- ),
699
- proof(
700
- goal(neq(2, 5)),
701
- by(builtin(neq, 2))
702
- ),
703
- proof(
704
- goal(received_bit(packet1, 2, 0)),
705
- by(fact("hamming-code.pl", clause(8)))
706
- )
707
- ])
708
- ),
709
- proof(
710
- goal(corrected_bit(packet1, 3, 1)),
711
- by(rule("hamming-code.pl", clause(22))),
712
- bindings([binding("Code", packet1), binding("Position", 3), binding("Bit", 1), binding("ErrorPosition", 5)]),
713
- uses([
714
- proof(
715
- goal(syndrome(packet1, 5)),
716
- by(rule("hamming-code.pl", clause(20))),
717
- bindings([binding("Code", packet1), binding("Syndrome", 5), binding("S1", 1), binding("S2", 0), binding("S4", 1), binding("WeightedS2", 0), binding("WeightedS4", 4), binding("Partial", 1)]),
718
- uses([
719
- proof(
720
- goal(syndrome_bit1(packet1, 1)),
721
- by(rule("hamming-code.pl", clause(17))),
722
- bindings([binding("Code", packet1), binding("S1", 1), binding("B1", 1), binding("B3", 1), binding("B5", 1), binding("B7", 0)]),
723
- uses([
724
- proof(
725
- goal(received_bit(packet1, 1, 1)),
726
- by(fact("hamming-code.pl", clause(7)))
727
- ),
728
- proof(
729
- goal(received_bit(packet1, 3, 1)),
730
- by(fact("hamming-code.pl", clause(9)))
731
- ),
732
- proof(
733
- goal(received_bit(packet1, 5, 1)),
734
- by(fact("hamming-code.pl", clause(11)))
735
- ),
736
- proof(
737
- goal(received_bit(packet1, 7, 0)),
738
- by(fact("hamming-code.pl", clause(13)))
739
- ),
740
- proof(
741
- goal(parity4(1, 1, 1, 0, 1)),
742
- by(rule("hamming-code.pl", clause(16))),
743
- bindings([binding("A", 1), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 1), binding("AB", 2), binding("ABC", 3), binding("Sum", 3)]),
744
- uses([
745
- proof(
746
- goal(add(1, 1, 2)),
747
- by(builtin(add, 3))
748
- ),
749
- proof(
750
- goal(add(2, 1, 3)),
751
- by(builtin(add, 3))
752
- ),
753
- proof(
754
- goal(add(3, 0, 3)),
755
- by(builtin(add, 3))
756
- ),
757
- proof(
758
- goal(mod(3, 2, 1)),
759
- by(builtin(mod, 3))
760
- )
761
- ])
762
- )
763
- ])
764
- ),
765
- proof(
766
- goal(syndrome_bit2(packet1, 0)),
767
- by(rule("hamming-code.pl", clause(18))),
768
- bindings([binding("Code", packet1), binding("S2", 0), binding("B2", 0), binding("B3", 1), binding("B6", 1), binding("B7", 0)]),
769
- uses([
770
- proof(
771
- goal(received_bit(packet1, 2, 0)),
772
- by(fact("hamming-code.pl", clause(8)))
773
- ),
774
- proof(
775
- goal(received_bit(packet1, 3, 1)),
776
- by(fact("hamming-code.pl", clause(9)))
777
- ),
778
- proof(
779
- goal(received_bit(packet1, 6, 1)),
780
- by(fact("hamming-code.pl", clause(12)))
781
- ),
782
- proof(
783
- goal(received_bit(packet1, 7, 0)),
784
- by(fact("hamming-code.pl", clause(13)))
785
- ),
786
- proof(
787
- goal(parity4(0, 1, 1, 0, 0)),
788
- by(rule("hamming-code.pl", clause(16))),
789
- bindings([binding("A", 0), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 0), binding("AB", 1), binding("ABC", 2), binding("Sum", 2)]),
790
- uses([
791
- proof(
792
- goal(add(0, 1, 1)),
793
- by(builtin(add, 3))
794
- ),
795
- proof(
796
- goal(add(1, 1, 2)),
797
- by(builtin(add, 3))
798
- ),
799
- proof(
800
- goal(add(2, 0, 2)),
801
- by(builtin(add, 3))
802
- ),
803
- proof(
804
- goal(mod(2, 2, 0)),
805
- by(builtin(mod, 3))
806
- )
807
- ])
808
- )
809
- ])
810
- ),
811
- proof(
812
- goal(syndrome_bit4(packet1, 1)),
813
- by(rule("hamming-code.pl", clause(19))),
814
- bindings([binding("Code", packet1), binding("S4", 1), binding("B4", 1), binding("B5", 1), binding("B6", 1), binding("B7", 0)]),
815
- uses([
816
- proof(
817
- goal(received_bit(packet1, 4, 1)),
818
- by(fact("hamming-code.pl", clause(10)))
819
- ),
820
- proof(
821
- goal(received_bit(packet1, 5, 1)),
822
- by(fact("hamming-code.pl", clause(11)))
823
- ),
824
- proof(
825
- goal(received_bit(packet1, 6, 1)),
826
- by(fact("hamming-code.pl", clause(12)))
827
- ),
828
- proof(
829
- goal(received_bit(packet1, 7, 0)),
830
- by(fact("hamming-code.pl", clause(13)))
831
- ),
832
- proof(
833
- goal(parity4(1, 1, 1, 0, 1)),
834
- by(rule("hamming-code.pl", clause(16))),
835
- bindings([binding("A", 1), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 1), binding("AB", 2), binding("ABC", 3), binding("Sum", 3)]),
836
- uses([
837
- proof(
838
- goal(add(1, 1, 2)),
839
- by(builtin(add, 3))
840
- ),
841
- proof(
842
- goal(add(2, 1, 3)),
843
- by(builtin(add, 3))
844
- ),
845
- proof(
846
- goal(add(3, 0, 3)),
847
- by(builtin(add, 3))
848
- ),
849
- proof(
850
- goal(mod(3, 2, 1)),
851
- by(builtin(mod, 3))
852
- )
853
- ])
854
- )
855
- ])
856
- ),
857
- proof(
858
- goal(mul(0, 2, 0)),
859
- by(builtin(mul, 3))
860
- ),
861
- proof(
862
- goal(mul(1, 4, 4)),
863
- by(builtin(mul, 3))
864
- ),
865
- proof(
866
- goal(add(1, 0, 1)),
867
- by(builtin(add, 3))
868
- ),
869
- proof(
870
- goal(add(1, 4, 5)),
871
- by(builtin(add, 3))
872
- )
873
- ])
874
- ),
875
- proof(
876
- goal(neq(3, 5)),
877
- by(builtin(neq, 2))
878
- ),
879
- proof(
880
- goal(received_bit(packet1, 3, 1)),
881
- by(fact("hamming-code.pl", clause(9)))
882
- )
883
- ])
884
- ),
885
- proof(
886
- goal(corrected_bit(packet1, 4, 1)),
887
- by(rule("hamming-code.pl", clause(22))),
888
- bindings([binding("Code", packet1), binding("Position", 4), binding("Bit", 1), binding("ErrorPosition", 5)]),
889
- uses([
890
- proof(
891
- goal(syndrome(packet1, 5)),
892
- by(rule("hamming-code.pl", clause(20))),
893
- bindings([binding("Code", packet1), binding("Syndrome", 5), binding("S1", 1), binding("S2", 0), binding("S4", 1), binding("WeightedS2", 0), binding("WeightedS4", 4), binding("Partial", 1)]),
894
- uses([
895
- proof(
896
- goal(syndrome_bit1(packet1, 1)),
897
- by(rule("hamming-code.pl", clause(17))),
898
- bindings([binding("Code", packet1), binding("S1", 1), binding("B1", 1), binding("B3", 1), binding("B5", 1), binding("B7", 0)]),
899
- uses([
900
- proof(
901
- goal(received_bit(packet1, 1, 1)),
902
- by(fact("hamming-code.pl", clause(7)))
903
- ),
904
- proof(
905
- goal(received_bit(packet1, 3, 1)),
906
- by(fact("hamming-code.pl", clause(9)))
907
- ),
908
- proof(
909
- goal(received_bit(packet1, 5, 1)),
910
- by(fact("hamming-code.pl", clause(11)))
911
- ),
912
- proof(
913
- goal(received_bit(packet1, 7, 0)),
914
- by(fact("hamming-code.pl", clause(13)))
915
- ),
916
- proof(
917
- goal(parity4(1, 1, 1, 0, 1)),
918
- by(rule("hamming-code.pl", clause(16))),
919
- bindings([binding("A", 1), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 1), binding("AB", 2), binding("ABC", 3), binding("Sum", 3)]),
920
- uses([
921
- proof(
922
- goal(add(1, 1, 2)),
923
- by(builtin(add, 3))
924
- ),
925
- proof(
926
- goal(add(2, 1, 3)),
927
- by(builtin(add, 3))
928
- ),
929
- proof(
930
- goal(add(3, 0, 3)),
931
- by(builtin(add, 3))
932
- ),
933
- proof(
934
- goal(mod(3, 2, 1)),
935
- by(builtin(mod, 3))
936
- )
937
- ])
938
- )
939
- ])
940
- ),
941
- proof(
942
- goal(syndrome_bit2(packet1, 0)),
943
- by(rule("hamming-code.pl", clause(18))),
944
- bindings([binding("Code", packet1), binding("S2", 0), binding("B2", 0), binding("B3", 1), binding("B6", 1), binding("B7", 0)]),
945
- uses([
946
- proof(
947
- goal(received_bit(packet1, 2, 0)),
948
- by(fact("hamming-code.pl", clause(8)))
949
- ),
950
- proof(
951
- goal(received_bit(packet1, 3, 1)),
952
- by(fact("hamming-code.pl", clause(9)))
953
- ),
954
- proof(
955
- goal(received_bit(packet1, 6, 1)),
956
- by(fact("hamming-code.pl", clause(12)))
957
- ),
958
- proof(
959
- goal(received_bit(packet1, 7, 0)),
960
- by(fact("hamming-code.pl", clause(13)))
961
- ),
962
- proof(
963
- goal(parity4(0, 1, 1, 0, 0)),
964
- by(rule("hamming-code.pl", clause(16))),
965
- bindings([binding("A", 0), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 0), binding("AB", 1), binding("ABC", 2), binding("Sum", 2)]),
966
- uses([
967
- proof(
968
- goal(add(0, 1, 1)),
969
- by(builtin(add, 3))
970
- ),
971
- proof(
972
- goal(add(1, 1, 2)),
973
- by(builtin(add, 3))
974
- ),
975
- proof(
976
- goal(add(2, 0, 2)),
977
- by(builtin(add, 3))
978
- ),
979
- proof(
980
- goal(mod(2, 2, 0)),
981
- by(builtin(mod, 3))
982
- )
983
- ])
984
- )
985
- ])
986
- ),
987
- proof(
988
- goal(syndrome_bit4(packet1, 1)),
989
- by(rule("hamming-code.pl", clause(19))),
990
- bindings([binding("Code", packet1), binding("S4", 1), binding("B4", 1), binding("B5", 1), binding("B6", 1), binding("B7", 0)]),
991
- uses([
992
- proof(
993
- goal(received_bit(packet1, 4, 1)),
994
- by(fact("hamming-code.pl", clause(10)))
995
- ),
996
- proof(
997
- goal(received_bit(packet1, 5, 1)),
998
- by(fact("hamming-code.pl", clause(11)))
999
- ),
1000
- proof(
1001
- goal(received_bit(packet1, 6, 1)),
1002
- by(fact("hamming-code.pl", clause(12)))
1003
- ),
1004
- proof(
1005
- goal(received_bit(packet1, 7, 0)),
1006
- by(fact("hamming-code.pl", clause(13)))
1007
- ),
1008
- proof(
1009
- goal(parity4(1, 1, 1, 0, 1)),
1010
- by(rule("hamming-code.pl", clause(16))),
1011
- bindings([binding("A", 1), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 1), binding("AB", 2), binding("ABC", 3), binding("Sum", 3)]),
1012
- uses([
1013
- proof(
1014
- goal(add(1, 1, 2)),
1015
- by(builtin(add, 3))
1016
- ),
1017
- proof(
1018
- goal(add(2, 1, 3)),
1019
- by(builtin(add, 3))
1020
- ),
1021
- proof(
1022
- goal(add(3, 0, 3)),
1023
- by(builtin(add, 3))
1024
- ),
1025
- proof(
1026
- goal(mod(3, 2, 1)),
1027
- by(builtin(mod, 3))
1028
- )
1029
- ])
1030
- )
1031
- ])
1032
- ),
1033
- proof(
1034
- goal(mul(0, 2, 0)),
1035
- by(builtin(mul, 3))
1036
- ),
1037
- proof(
1038
- goal(mul(1, 4, 4)),
1039
- by(builtin(mul, 3))
1040
- ),
1041
- proof(
1042
- goal(add(1, 0, 1)),
1043
- by(builtin(add, 3))
1044
- ),
1045
- proof(
1046
- goal(add(1, 4, 5)),
1047
- by(builtin(add, 3))
1048
- )
1049
- ])
1050
- ),
1051
- proof(
1052
- goal(neq(4, 5)),
1053
- by(builtin(neq, 2))
1054
- ),
1055
- proof(
1056
- goal(received_bit(packet1, 4, 1)),
1057
- by(fact("hamming-code.pl", clause(10)))
1058
- )
1059
- ])
1060
- ),
1061
- proof(
1062
- goal(corrected_bit(packet1, 5, 0)),
1063
- by(rule("hamming-code.pl", clause(21))),
1064
- bindings([binding("Code", packet1), binding("Position", 5), binding("Corrected", 0), binding("Bit", 1)]),
1065
- uses([
1066
- proof(
1067
- goal(syndrome(packet1, 5)),
1068
- by(rule("hamming-code.pl", clause(20))),
1069
- bindings([binding("Code", packet1), binding("Syndrome", 5), binding("S1", 1), binding("S2", 0), binding("S4", 1), binding("WeightedS2", 0), binding("WeightedS4", 4), binding("Partial", 1)]),
1070
- uses([
1071
- proof(
1072
- goal(syndrome_bit1(packet1, 1)),
1073
- by(rule("hamming-code.pl", clause(17))),
1074
- bindings([binding("Code", packet1), binding("S1", 1), binding("B1", 1), binding("B3", 1), binding("B5", 1), binding("B7", 0)]),
1075
- uses([
1076
- proof(
1077
- goal(received_bit(packet1, 1, 1)),
1078
- by(fact("hamming-code.pl", clause(7)))
1079
- ),
1080
- proof(
1081
- goal(received_bit(packet1, 3, 1)),
1082
- by(fact("hamming-code.pl", clause(9)))
1083
- ),
1084
- proof(
1085
- goal(received_bit(packet1, 5, 1)),
1086
- by(fact("hamming-code.pl", clause(11)))
1087
- ),
1088
- proof(
1089
- goal(received_bit(packet1, 7, 0)),
1090
- by(fact("hamming-code.pl", clause(13)))
1091
- ),
1092
- proof(
1093
- goal(parity4(1, 1, 1, 0, 1)),
1094
- by(rule("hamming-code.pl", clause(16))),
1095
- bindings([binding("A", 1), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 1), binding("AB", 2), binding("ABC", 3), binding("Sum", 3)]),
1096
- uses([
1097
- proof(
1098
- goal(add(1, 1, 2)),
1099
- by(builtin(add, 3))
1100
- ),
1101
- proof(
1102
- goal(add(2, 1, 3)),
1103
- by(builtin(add, 3))
1104
- ),
1105
- proof(
1106
- goal(add(3, 0, 3)),
1107
- by(builtin(add, 3))
1108
- ),
1109
- proof(
1110
- goal(mod(3, 2, 1)),
1111
- by(builtin(mod, 3))
1112
- )
1113
- ])
1114
- )
1115
- ])
1116
- ),
1117
- proof(
1118
- goal(syndrome_bit2(packet1, 0)),
1119
- by(rule("hamming-code.pl", clause(18))),
1120
- bindings([binding("Code", packet1), binding("S2", 0), binding("B2", 0), binding("B3", 1), binding("B6", 1), binding("B7", 0)]),
1121
- uses([
1122
- proof(
1123
- goal(received_bit(packet1, 2, 0)),
1124
- by(fact("hamming-code.pl", clause(8)))
1125
- ),
1126
- proof(
1127
- goal(received_bit(packet1, 3, 1)),
1128
- by(fact("hamming-code.pl", clause(9)))
1129
- ),
1130
- proof(
1131
- goal(received_bit(packet1, 6, 1)),
1132
- by(fact("hamming-code.pl", clause(12)))
1133
- ),
1134
- proof(
1135
- goal(received_bit(packet1, 7, 0)),
1136
- by(fact("hamming-code.pl", clause(13)))
1137
- ),
1138
- proof(
1139
- goal(parity4(0, 1, 1, 0, 0)),
1140
- by(rule("hamming-code.pl", clause(16))),
1141
- bindings([binding("A", 0), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 0), binding("AB", 1), binding("ABC", 2), binding("Sum", 2)]),
1142
- uses([
1143
- proof(
1144
- goal(add(0, 1, 1)),
1145
- by(builtin(add, 3))
1146
- ),
1147
- proof(
1148
- goal(add(1, 1, 2)),
1149
- by(builtin(add, 3))
1150
- ),
1151
- proof(
1152
- goal(add(2, 0, 2)),
1153
- by(builtin(add, 3))
1154
- ),
1155
- proof(
1156
- goal(mod(2, 2, 0)),
1157
- by(builtin(mod, 3))
1158
- )
1159
- ])
1160
- )
1161
- ])
1162
- ),
1163
- proof(
1164
- goal(syndrome_bit4(packet1, 1)),
1165
- by(rule("hamming-code.pl", clause(19))),
1166
- bindings([binding("Code", packet1), binding("S4", 1), binding("B4", 1), binding("B5", 1), binding("B6", 1), binding("B7", 0)]),
1167
- uses([
1168
- proof(
1169
- goal(received_bit(packet1, 4, 1)),
1170
- by(fact("hamming-code.pl", clause(10)))
1171
- ),
1172
- proof(
1173
- goal(received_bit(packet1, 5, 1)),
1174
- by(fact("hamming-code.pl", clause(11)))
1175
- ),
1176
- proof(
1177
- goal(received_bit(packet1, 6, 1)),
1178
- by(fact("hamming-code.pl", clause(12)))
1179
- ),
1180
- proof(
1181
- goal(received_bit(packet1, 7, 0)),
1182
- by(fact("hamming-code.pl", clause(13)))
1183
- ),
1184
- proof(
1185
- goal(parity4(1, 1, 1, 0, 1)),
1186
- by(rule("hamming-code.pl", clause(16))),
1187
- bindings([binding("A", 1), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 1), binding("AB", 2), binding("ABC", 3), binding("Sum", 3)]),
1188
- uses([
1189
- proof(
1190
- goal(add(1, 1, 2)),
1191
- by(builtin(add, 3))
1192
- ),
1193
- proof(
1194
- goal(add(2, 1, 3)),
1195
- by(builtin(add, 3))
1196
- ),
1197
- proof(
1198
- goal(add(3, 0, 3)),
1199
- by(builtin(add, 3))
1200
- ),
1201
- proof(
1202
- goal(mod(3, 2, 1)),
1203
- by(builtin(mod, 3))
1204
- )
1205
- ])
1206
- )
1207
- ])
1208
- ),
1209
- proof(
1210
- goal(mul(0, 2, 0)),
1211
- by(builtin(mul, 3))
1212
- ),
1213
- proof(
1214
- goal(mul(1, 4, 4)),
1215
- by(builtin(mul, 3))
1216
- ),
1217
- proof(
1218
- goal(add(1, 0, 1)),
1219
- by(builtin(add, 3))
1220
- ),
1221
- proof(
1222
- goal(add(1, 4, 5)),
1223
- by(builtin(add, 3))
1224
- )
1225
- ])
1226
- ),
1227
- proof(
1228
- goal(received_bit(packet1, 5, 1)),
1229
- by(fact("hamming-code.pl", clause(11)))
1230
- ),
1231
- proof(
1232
- goal(flip(1, 0)),
1233
- by(fact("hamming-code.pl", clause(15)))
1234
- )
1235
- ])
1236
- ),
1237
- proof(
1238
- goal(corrected_bit(packet1, 6, 1)),
1239
- by(rule("hamming-code.pl", clause(22))),
1240
- bindings([binding("Code", packet1), binding("Position", 6), binding("Bit", 1), binding("ErrorPosition", 5)]),
1241
- uses([
1242
- proof(
1243
- goal(syndrome(packet1, 5)),
1244
- by(rule("hamming-code.pl", clause(20))),
1245
- bindings([binding("Code", packet1), binding("Syndrome", 5), binding("S1", 1), binding("S2", 0), binding("S4", 1), binding("WeightedS2", 0), binding("WeightedS4", 4), binding("Partial", 1)]),
1246
- uses([
1247
- proof(
1248
- goal(syndrome_bit1(packet1, 1)),
1249
- by(rule("hamming-code.pl", clause(17))),
1250
- bindings([binding("Code", packet1), binding("S1", 1), binding("B1", 1), binding("B3", 1), binding("B5", 1), binding("B7", 0)]),
1251
- uses([
1252
- proof(
1253
- goal(received_bit(packet1, 1, 1)),
1254
- by(fact("hamming-code.pl", clause(7)))
1255
- ),
1256
- proof(
1257
- goal(received_bit(packet1, 3, 1)),
1258
- by(fact("hamming-code.pl", clause(9)))
1259
- ),
1260
- proof(
1261
- goal(received_bit(packet1, 5, 1)),
1262
- by(fact("hamming-code.pl", clause(11)))
1263
- ),
1264
- proof(
1265
- goal(received_bit(packet1, 7, 0)),
1266
- by(fact("hamming-code.pl", clause(13)))
1267
- ),
1268
- proof(
1269
- goal(parity4(1, 1, 1, 0, 1)),
1270
- by(rule("hamming-code.pl", clause(16))),
1271
- bindings([binding("A", 1), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 1), binding("AB", 2), binding("ABC", 3), binding("Sum", 3)]),
1272
- uses([
1273
- proof(
1274
- goal(add(1, 1, 2)),
1275
- by(builtin(add, 3))
1276
- ),
1277
- proof(
1278
- goal(add(2, 1, 3)),
1279
- by(builtin(add, 3))
1280
- ),
1281
- proof(
1282
- goal(add(3, 0, 3)),
1283
- by(builtin(add, 3))
1284
- ),
1285
- proof(
1286
- goal(mod(3, 2, 1)),
1287
- by(builtin(mod, 3))
1288
- )
1289
- ])
1290
- )
1291
- ])
1292
- ),
1293
- proof(
1294
- goal(syndrome_bit2(packet1, 0)),
1295
- by(rule("hamming-code.pl", clause(18))),
1296
- bindings([binding("Code", packet1), binding("S2", 0), binding("B2", 0), binding("B3", 1), binding("B6", 1), binding("B7", 0)]),
1297
- uses([
1298
- proof(
1299
- goal(received_bit(packet1, 2, 0)),
1300
- by(fact("hamming-code.pl", clause(8)))
1301
- ),
1302
- proof(
1303
- goal(received_bit(packet1, 3, 1)),
1304
- by(fact("hamming-code.pl", clause(9)))
1305
- ),
1306
- proof(
1307
- goal(received_bit(packet1, 6, 1)),
1308
- by(fact("hamming-code.pl", clause(12)))
1309
- ),
1310
- proof(
1311
- goal(received_bit(packet1, 7, 0)),
1312
- by(fact("hamming-code.pl", clause(13)))
1313
- ),
1314
- proof(
1315
- goal(parity4(0, 1, 1, 0, 0)),
1316
- by(rule("hamming-code.pl", clause(16))),
1317
- bindings([binding("A", 0), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 0), binding("AB", 1), binding("ABC", 2), binding("Sum", 2)]),
1318
- uses([
1319
- proof(
1320
- goal(add(0, 1, 1)),
1321
- by(builtin(add, 3))
1322
- ),
1323
- proof(
1324
- goal(add(1, 1, 2)),
1325
- by(builtin(add, 3))
1326
- ),
1327
- proof(
1328
- goal(add(2, 0, 2)),
1329
- by(builtin(add, 3))
1330
- ),
1331
- proof(
1332
- goal(mod(2, 2, 0)),
1333
- by(builtin(mod, 3))
1334
- )
1335
- ])
1336
- )
1337
- ])
1338
- ),
1339
- proof(
1340
- goal(syndrome_bit4(packet1, 1)),
1341
- by(rule("hamming-code.pl", clause(19))),
1342
- bindings([binding("Code", packet1), binding("S4", 1), binding("B4", 1), binding("B5", 1), binding("B6", 1), binding("B7", 0)]),
1343
- uses([
1344
- proof(
1345
- goal(received_bit(packet1, 4, 1)),
1346
- by(fact("hamming-code.pl", clause(10)))
1347
- ),
1348
- proof(
1349
- goal(received_bit(packet1, 5, 1)),
1350
- by(fact("hamming-code.pl", clause(11)))
1351
- ),
1352
- proof(
1353
- goal(received_bit(packet1, 6, 1)),
1354
- by(fact("hamming-code.pl", clause(12)))
1355
- ),
1356
- proof(
1357
- goal(received_bit(packet1, 7, 0)),
1358
- by(fact("hamming-code.pl", clause(13)))
1359
- ),
1360
- proof(
1361
- goal(parity4(1, 1, 1, 0, 1)),
1362
- by(rule("hamming-code.pl", clause(16))),
1363
- bindings([binding("A", 1), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 1), binding("AB", 2), binding("ABC", 3), binding("Sum", 3)]),
1364
- uses([
1365
- proof(
1366
- goal(add(1, 1, 2)),
1367
- by(builtin(add, 3))
1368
- ),
1369
- proof(
1370
- goal(add(2, 1, 3)),
1371
- by(builtin(add, 3))
1372
- ),
1373
- proof(
1374
- goal(add(3, 0, 3)),
1375
- by(builtin(add, 3))
1376
- ),
1377
- proof(
1378
- goal(mod(3, 2, 1)),
1379
- by(builtin(mod, 3))
1380
- )
1381
- ])
1382
- )
1383
- ])
1384
- ),
1385
- proof(
1386
- goal(mul(0, 2, 0)),
1387
- by(builtin(mul, 3))
1388
- ),
1389
- proof(
1390
- goal(mul(1, 4, 4)),
1391
- by(builtin(mul, 3))
1392
- ),
1393
- proof(
1394
- goal(add(1, 0, 1)),
1395
- by(builtin(add, 3))
1396
- ),
1397
- proof(
1398
- goal(add(1, 4, 5)),
1399
- by(builtin(add, 3))
1400
- )
1401
- ])
1402
- ),
1403
- proof(
1404
- goal(neq(6, 5)),
1405
- by(builtin(neq, 2))
1406
- ),
1407
- proof(
1408
- goal(received_bit(packet1, 6, 1)),
1409
- by(fact("hamming-code.pl", clause(12)))
1410
- )
1411
- ])
1412
- ),
1413
- proof(
1414
- goal(corrected_bit(packet1, 7, 0)),
1415
- by(rule("hamming-code.pl", clause(22))),
1416
- bindings([binding("Code", packet1), binding("Position", 7), binding("Bit", 0), binding("ErrorPosition", 5)]),
1417
- uses([
1418
- proof(
1419
- goal(syndrome(packet1, 5)),
1420
- by(rule("hamming-code.pl", clause(20))),
1421
- bindings([binding("Code", packet1), binding("Syndrome", 5), binding("S1", 1), binding("S2", 0), binding("S4", 1), binding("WeightedS2", 0), binding("WeightedS4", 4), binding("Partial", 1)]),
1422
- uses([
1423
- proof(
1424
- goal(syndrome_bit1(packet1, 1)),
1425
- by(rule("hamming-code.pl", clause(17))),
1426
- bindings([binding("Code", packet1), binding("S1", 1), binding("B1", 1), binding("B3", 1), binding("B5", 1), binding("B7", 0)]),
1427
- uses([
1428
- proof(
1429
- goal(received_bit(packet1, 1, 1)),
1430
- by(fact("hamming-code.pl", clause(7)))
1431
- ),
1432
- proof(
1433
- goal(received_bit(packet1, 3, 1)),
1434
- by(fact("hamming-code.pl", clause(9)))
1435
- ),
1436
- proof(
1437
- goal(received_bit(packet1, 5, 1)),
1438
- by(fact("hamming-code.pl", clause(11)))
1439
- ),
1440
- proof(
1441
- goal(received_bit(packet1, 7, 0)),
1442
- by(fact("hamming-code.pl", clause(13)))
1443
- ),
1444
- proof(
1445
- goal(parity4(1, 1, 1, 0, 1)),
1446
- by(rule("hamming-code.pl", clause(16))),
1447
- bindings([binding("A", 1), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 1), binding("AB", 2), binding("ABC", 3), binding("Sum", 3)]),
1448
- uses([
1449
- proof(
1450
- goal(add(1, 1, 2)),
1451
- by(builtin(add, 3))
1452
- ),
1453
- proof(
1454
- goal(add(2, 1, 3)),
1455
- by(builtin(add, 3))
1456
- ),
1457
- proof(
1458
- goal(add(3, 0, 3)),
1459
- by(builtin(add, 3))
1460
- ),
1461
- proof(
1462
- goal(mod(3, 2, 1)),
1463
- by(builtin(mod, 3))
1464
- )
1465
- ])
1466
- )
1467
- ])
1468
- ),
1469
- proof(
1470
- goal(syndrome_bit2(packet1, 0)),
1471
- by(rule("hamming-code.pl", clause(18))),
1472
- bindings([binding("Code", packet1), binding("S2", 0), binding("B2", 0), binding("B3", 1), binding("B6", 1), binding("B7", 0)]),
1473
- uses([
1474
- proof(
1475
- goal(received_bit(packet1, 2, 0)),
1476
- by(fact("hamming-code.pl", clause(8)))
1477
- ),
1478
- proof(
1479
- goal(received_bit(packet1, 3, 1)),
1480
- by(fact("hamming-code.pl", clause(9)))
1481
- ),
1482
- proof(
1483
- goal(received_bit(packet1, 6, 1)),
1484
- by(fact("hamming-code.pl", clause(12)))
1485
- ),
1486
- proof(
1487
- goal(received_bit(packet1, 7, 0)),
1488
- by(fact("hamming-code.pl", clause(13)))
1489
- ),
1490
- proof(
1491
- goal(parity4(0, 1, 1, 0, 0)),
1492
- by(rule("hamming-code.pl", clause(16))),
1493
- bindings([binding("A", 0), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 0), binding("AB", 1), binding("ABC", 2), binding("Sum", 2)]),
1494
- uses([
1495
- proof(
1496
- goal(add(0, 1, 1)),
1497
- by(builtin(add, 3))
1498
- ),
1499
- proof(
1500
- goal(add(1, 1, 2)),
1501
- by(builtin(add, 3))
1502
- ),
1503
- proof(
1504
- goal(add(2, 0, 2)),
1505
- by(builtin(add, 3))
1506
- ),
1507
- proof(
1508
- goal(mod(2, 2, 0)),
1509
- by(builtin(mod, 3))
1510
- )
1511
- ])
1512
- )
1513
- ])
1514
- ),
1515
- proof(
1516
- goal(syndrome_bit4(packet1, 1)),
1517
- by(rule("hamming-code.pl", clause(19))),
1518
- bindings([binding("Code", packet1), binding("S4", 1), binding("B4", 1), binding("B5", 1), binding("B6", 1), binding("B7", 0)]),
1519
- uses([
1520
- proof(
1521
- goal(received_bit(packet1, 4, 1)),
1522
- by(fact("hamming-code.pl", clause(10)))
1523
- ),
1524
- proof(
1525
- goal(received_bit(packet1, 5, 1)),
1526
- by(fact("hamming-code.pl", clause(11)))
1527
- ),
1528
- proof(
1529
- goal(received_bit(packet1, 6, 1)),
1530
- by(fact("hamming-code.pl", clause(12)))
1531
- ),
1532
- proof(
1533
- goal(received_bit(packet1, 7, 0)),
1534
- by(fact("hamming-code.pl", clause(13)))
1535
- ),
1536
- proof(
1537
- goal(parity4(1, 1, 1, 0, 1)),
1538
- by(rule("hamming-code.pl", clause(16))),
1539
- bindings([binding("A", 1), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 1), binding("AB", 2), binding("ABC", 3), binding("Sum", 3)]),
1540
- uses([
1541
- proof(
1542
- goal(add(1, 1, 2)),
1543
- by(builtin(add, 3))
1544
- ),
1545
- proof(
1546
- goal(add(2, 1, 3)),
1547
- by(builtin(add, 3))
1548
- ),
1549
- proof(
1550
- goal(add(3, 0, 3)),
1551
- by(builtin(add, 3))
1552
- ),
1553
- proof(
1554
- goal(mod(3, 2, 1)),
1555
- by(builtin(mod, 3))
1556
- )
1557
- ])
1558
- )
1559
- ])
1560
- ),
1561
- proof(
1562
- goal(mul(0, 2, 0)),
1563
- by(builtin(mul, 3))
1564
- ),
1565
- proof(
1566
- goal(mul(1, 4, 4)),
1567
- by(builtin(mul, 3))
1568
- ),
1569
- proof(
1570
- goal(add(1, 0, 1)),
1571
- by(builtin(add, 3))
1572
- ),
1573
- proof(
1574
- goal(add(1, 4, 5)),
1575
- by(builtin(add, 3))
1576
- )
1577
- ])
1578
- ),
1579
- proof(
1580
- goal(neq(7, 5)),
1581
- by(builtin(neq, 2))
1582
- ),
1583
- proof(
1584
- goal(received_bit(packet1, 7, 0)),
1585
- by(fact("hamming-code.pl", clause(13)))
1586
- )
1587
- ])
1588
- )
1589
- ])
1590
- )
1591
- ])
1592
- )
1593
- ).
1594
-
1595
4
  decodedPayload(packet1, [1, 0, 1, 0]).
1596
- why(
1597
- decodedPayload(packet1, [1, 0, 1, 0]),
1598
- proof(
1599
- goal(decodedPayload(packet1, [1, 0, 1, 0])),
1600
- by(rule("hamming-code.pl", clause(27))),
1601
- bindings([binding("Code", packet1), binding("Payload", [1, 0, 1, 0])]),
1602
- uses([
1603
- proof(
1604
- goal(decoded_payload(packet1, [1, 0, 1, 0])),
1605
- by(rule("hamming-code.pl", clause(24))),
1606
- bindings([binding("Code", packet1), binding("D1", 1), binding("D2", 0), binding("D3", 1), binding("D4", 0)]),
1607
- uses([
1608
- proof(
1609
- goal(corrected_bit(packet1, 3, 1)),
1610
- by(rule("hamming-code.pl", clause(22))),
1611
- bindings([binding("Code", packet1), binding("Position", 3), binding("Bit", 1), binding("ErrorPosition", 5)]),
1612
- uses([
1613
- proof(
1614
- goal(syndrome(packet1, 5)),
1615
- by(rule("hamming-code.pl", clause(20))),
1616
- bindings([binding("Code", packet1), binding("Syndrome", 5), binding("S1", 1), binding("S2", 0), binding("S4", 1), binding("WeightedS2", 0), binding("WeightedS4", 4), binding("Partial", 1)]),
1617
- uses([
1618
- proof(
1619
- goal(syndrome_bit1(packet1, 1)),
1620
- by(rule("hamming-code.pl", clause(17))),
1621
- bindings([binding("Code", packet1), binding("S1", 1), binding("B1", 1), binding("B3", 1), binding("B5", 1), binding("B7", 0)]),
1622
- uses([
1623
- proof(
1624
- goal(received_bit(packet1, 1, 1)),
1625
- by(fact("hamming-code.pl", clause(7)))
1626
- ),
1627
- proof(
1628
- goal(received_bit(packet1, 3, 1)),
1629
- by(fact("hamming-code.pl", clause(9)))
1630
- ),
1631
- proof(
1632
- goal(received_bit(packet1, 5, 1)),
1633
- by(fact("hamming-code.pl", clause(11)))
1634
- ),
1635
- proof(
1636
- goal(received_bit(packet1, 7, 0)),
1637
- by(fact("hamming-code.pl", clause(13)))
1638
- ),
1639
- proof(
1640
- goal(parity4(1, 1, 1, 0, 1)),
1641
- by(rule("hamming-code.pl", clause(16))),
1642
- bindings([binding("A", 1), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 1), binding("AB", 2), binding("ABC", 3), binding("Sum", 3)]),
1643
- uses([
1644
- proof(
1645
- goal(add(1, 1, 2)),
1646
- by(builtin(add, 3))
1647
- ),
1648
- proof(
1649
- goal(add(2, 1, 3)),
1650
- by(builtin(add, 3))
1651
- ),
1652
- proof(
1653
- goal(add(3, 0, 3)),
1654
- by(builtin(add, 3))
1655
- ),
1656
- proof(
1657
- goal(mod(3, 2, 1)),
1658
- by(builtin(mod, 3))
1659
- )
1660
- ])
1661
- )
1662
- ])
1663
- ),
1664
- proof(
1665
- goal(syndrome_bit2(packet1, 0)),
1666
- by(rule("hamming-code.pl", clause(18))),
1667
- bindings([binding("Code", packet1), binding("S2", 0), binding("B2", 0), binding("B3", 1), binding("B6", 1), binding("B7", 0)]),
1668
- uses([
1669
- proof(
1670
- goal(received_bit(packet1, 2, 0)),
1671
- by(fact("hamming-code.pl", clause(8)))
1672
- ),
1673
- proof(
1674
- goal(received_bit(packet1, 3, 1)),
1675
- by(fact("hamming-code.pl", clause(9)))
1676
- ),
1677
- proof(
1678
- goal(received_bit(packet1, 6, 1)),
1679
- by(fact("hamming-code.pl", clause(12)))
1680
- ),
1681
- proof(
1682
- goal(received_bit(packet1, 7, 0)),
1683
- by(fact("hamming-code.pl", clause(13)))
1684
- ),
1685
- proof(
1686
- goal(parity4(0, 1, 1, 0, 0)),
1687
- by(rule("hamming-code.pl", clause(16))),
1688
- bindings([binding("A", 0), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 0), binding("AB", 1), binding("ABC", 2), binding("Sum", 2)]),
1689
- uses([
1690
- proof(
1691
- goal(add(0, 1, 1)),
1692
- by(builtin(add, 3))
1693
- ),
1694
- proof(
1695
- goal(add(1, 1, 2)),
1696
- by(builtin(add, 3))
1697
- ),
1698
- proof(
1699
- goal(add(2, 0, 2)),
1700
- by(builtin(add, 3))
1701
- ),
1702
- proof(
1703
- goal(mod(2, 2, 0)),
1704
- by(builtin(mod, 3))
1705
- )
1706
- ])
1707
- )
1708
- ])
1709
- ),
1710
- proof(
1711
- goal(syndrome_bit4(packet1, 1)),
1712
- by(rule("hamming-code.pl", clause(19))),
1713
- bindings([binding("Code", packet1), binding("S4", 1), binding("B4", 1), binding("B5", 1), binding("B6", 1), binding("B7", 0)]),
1714
- uses([
1715
- proof(
1716
- goal(received_bit(packet1, 4, 1)),
1717
- by(fact("hamming-code.pl", clause(10)))
1718
- ),
1719
- proof(
1720
- goal(received_bit(packet1, 5, 1)),
1721
- by(fact("hamming-code.pl", clause(11)))
1722
- ),
1723
- proof(
1724
- goal(received_bit(packet1, 6, 1)),
1725
- by(fact("hamming-code.pl", clause(12)))
1726
- ),
1727
- proof(
1728
- goal(received_bit(packet1, 7, 0)),
1729
- by(fact("hamming-code.pl", clause(13)))
1730
- ),
1731
- proof(
1732
- goal(parity4(1, 1, 1, 0, 1)),
1733
- by(rule("hamming-code.pl", clause(16))),
1734
- bindings([binding("A", 1), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 1), binding("AB", 2), binding("ABC", 3), binding("Sum", 3)]),
1735
- uses([
1736
- proof(
1737
- goal(add(1, 1, 2)),
1738
- by(builtin(add, 3))
1739
- ),
1740
- proof(
1741
- goal(add(2, 1, 3)),
1742
- by(builtin(add, 3))
1743
- ),
1744
- proof(
1745
- goal(add(3, 0, 3)),
1746
- by(builtin(add, 3))
1747
- ),
1748
- proof(
1749
- goal(mod(3, 2, 1)),
1750
- by(builtin(mod, 3))
1751
- )
1752
- ])
1753
- )
1754
- ])
1755
- ),
1756
- proof(
1757
- goal(mul(0, 2, 0)),
1758
- by(builtin(mul, 3))
1759
- ),
1760
- proof(
1761
- goal(mul(1, 4, 4)),
1762
- by(builtin(mul, 3))
1763
- ),
1764
- proof(
1765
- goal(add(1, 0, 1)),
1766
- by(builtin(add, 3))
1767
- ),
1768
- proof(
1769
- goal(add(1, 4, 5)),
1770
- by(builtin(add, 3))
1771
- )
1772
- ])
1773
- ),
1774
- proof(
1775
- goal(neq(3, 5)),
1776
- by(builtin(neq, 2))
1777
- ),
1778
- proof(
1779
- goal(received_bit(packet1, 3, 1)),
1780
- by(fact("hamming-code.pl", clause(9)))
1781
- )
1782
- ])
1783
- ),
1784
- proof(
1785
- goal(corrected_bit(packet1, 5, 0)),
1786
- by(rule("hamming-code.pl", clause(21))),
1787
- bindings([binding("Code", packet1), binding("Position", 5), binding("Corrected", 0), binding("Bit", 1)]),
1788
- uses([
1789
- proof(
1790
- goal(syndrome(packet1, 5)),
1791
- by(rule("hamming-code.pl", clause(20))),
1792
- bindings([binding("Code", packet1), binding("Syndrome", 5), binding("S1", 1), binding("S2", 0), binding("S4", 1), binding("WeightedS2", 0), binding("WeightedS4", 4), binding("Partial", 1)]),
1793
- uses([
1794
- proof(
1795
- goal(syndrome_bit1(packet1, 1)),
1796
- by(rule("hamming-code.pl", clause(17))),
1797
- bindings([binding("Code", packet1), binding("S1", 1), binding("B1", 1), binding("B3", 1), binding("B5", 1), binding("B7", 0)]),
1798
- uses([
1799
- proof(
1800
- goal(received_bit(packet1, 1, 1)),
1801
- by(fact("hamming-code.pl", clause(7)))
1802
- ),
1803
- proof(
1804
- goal(received_bit(packet1, 3, 1)),
1805
- by(fact("hamming-code.pl", clause(9)))
1806
- ),
1807
- proof(
1808
- goal(received_bit(packet1, 5, 1)),
1809
- by(fact("hamming-code.pl", clause(11)))
1810
- ),
1811
- proof(
1812
- goal(received_bit(packet1, 7, 0)),
1813
- by(fact("hamming-code.pl", clause(13)))
1814
- ),
1815
- proof(
1816
- goal(parity4(1, 1, 1, 0, 1)),
1817
- by(rule("hamming-code.pl", clause(16))),
1818
- bindings([binding("A", 1), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 1), binding("AB", 2), binding("ABC", 3), binding("Sum", 3)]),
1819
- uses([
1820
- proof(
1821
- goal(add(1, 1, 2)),
1822
- by(builtin(add, 3))
1823
- ),
1824
- proof(
1825
- goal(add(2, 1, 3)),
1826
- by(builtin(add, 3))
1827
- ),
1828
- proof(
1829
- goal(add(3, 0, 3)),
1830
- by(builtin(add, 3))
1831
- ),
1832
- proof(
1833
- goal(mod(3, 2, 1)),
1834
- by(builtin(mod, 3))
1835
- )
1836
- ])
1837
- )
1838
- ])
1839
- ),
1840
- proof(
1841
- goal(syndrome_bit2(packet1, 0)),
1842
- by(rule("hamming-code.pl", clause(18))),
1843
- bindings([binding("Code", packet1), binding("S2", 0), binding("B2", 0), binding("B3", 1), binding("B6", 1), binding("B7", 0)]),
1844
- uses([
1845
- proof(
1846
- goal(received_bit(packet1, 2, 0)),
1847
- by(fact("hamming-code.pl", clause(8)))
1848
- ),
1849
- proof(
1850
- goal(received_bit(packet1, 3, 1)),
1851
- by(fact("hamming-code.pl", clause(9)))
1852
- ),
1853
- proof(
1854
- goal(received_bit(packet1, 6, 1)),
1855
- by(fact("hamming-code.pl", clause(12)))
1856
- ),
1857
- proof(
1858
- goal(received_bit(packet1, 7, 0)),
1859
- by(fact("hamming-code.pl", clause(13)))
1860
- ),
1861
- proof(
1862
- goal(parity4(0, 1, 1, 0, 0)),
1863
- by(rule("hamming-code.pl", clause(16))),
1864
- bindings([binding("A", 0), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 0), binding("AB", 1), binding("ABC", 2), binding("Sum", 2)]),
1865
- uses([
1866
- proof(
1867
- goal(add(0, 1, 1)),
1868
- by(builtin(add, 3))
1869
- ),
1870
- proof(
1871
- goal(add(1, 1, 2)),
1872
- by(builtin(add, 3))
1873
- ),
1874
- proof(
1875
- goal(add(2, 0, 2)),
1876
- by(builtin(add, 3))
1877
- ),
1878
- proof(
1879
- goal(mod(2, 2, 0)),
1880
- by(builtin(mod, 3))
1881
- )
1882
- ])
1883
- )
1884
- ])
1885
- ),
1886
- proof(
1887
- goal(syndrome_bit4(packet1, 1)),
1888
- by(rule("hamming-code.pl", clause(19))),
1889
- bindings([binding("Code", packet1), binding("S4", 1), binding("B4", 1), binding("B5", 1), binding("B6", 1), binding("B7", 0)]),
1890
- uses([
1891
- proof(
1892
- goal(received_bit(packet1, 4, 1)),
1893
- by(fact("hamming-code.pl", clause(10)))
1894
- ),
1895
- proof(
1896
- goal(received_bit(packet1, 5, 1)),
1897
- by(fact("hamming-code.pl", clause(11)))
1898
- ),
1899
- proof(
1900
- goal(received_bit(packet1, 6, 1)),
1901
- by(fact("hamming-code.pl", clause(12)))
1902
- ),
1903
- proof(
1904
- goal(received_bit(packet1, 7, 0)),
1905
- by(fact("hamming-code.pl", clause(13)))
1906
- ),
1907
- proof(
1908
- goal(parity4(1, 1, 1, 0, 1)),
1909
- by(rule("hamming-code.pl", clause(16))),
1910
- bindings([binding("A", 1), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 1), binding("AB", 2), binding("ABC", 3), binding("Sum", 3)]),
1911
- uses([
1912
- proof(
1913
- goal(add(1, 1, 2)),
1914
- by(builtin(add, 3))
1915
- ),
1916
- proof(
1917
- goal(add(2, 1, 3)),
1918
- by(builtin(add, 3))
1919
- ),
1920
- proof(
1921
- goal(add(3, 0, 3)),
1922
- by(builtin(add, 3))
1923
- ),
1924
- proof(
1925
- goal(mod(3, 2, 1)),
1926
- by(builtin(mod, 3))
1927
- )
1928
- ])
1929
- )
1930
- ])
1931
- ),
1932
- proof(
1933
- goal(mul(0, 2, 0)),
1934
- by(builtin(mul, 3))
1935
- ),
1936
- proof(
1937
- goal(mul(1, 4, 4)),
1938
- by(builtin(mul, 3))
1939
- ),
1940
- proof(
1941
- goal(add(1, 0, 1)),
1942
- by(builtin(add, 3))
1943
- ),
1944
- proof(
1945
- goal(add(1, 4, 5)),
1946
- by(builtin(add, 3))
1947
- )
1948
- ])
1949
- ),
1950
- proof(
1951
- goal(received_bit(packet1, 5, 1)),
1952
- by(fact("hamming-code.pl", clause(11)))
1953
- ),
1954
- proof(
1955
- goal(flip(1, 0)),
1956
- by(fact("hamming-code.pl", clause(15)))
1957
- )
1958
- ])
1959
- ),
1960
- proof(
1961
- goal(corrected_bit(packet1, 6, 1)),
1962
- by(rule("hamming-code.pl", clause(22))),
1963
- bindings([binding("Code", packet1), binding("Position", 6), binding("Bit", 1), binding("ErrorPosition", 5)]),
1964
- uses([
1965
- proof(
1966
- goal(syndrome(packet1, 5)),
1967
- by(rule("hamming-code.pl", clause(20))),
1968
- bindings([binding("Code", packet1), binding("Syndrome", 5), binding("S1", 1), binding("S2", 0), binding("S4", 1), binding("WeightedS2", 0), binding("WeightedS4", 4), binding("Partial", 1)]),
1969
- uses([
1970
- proof(
1971
- goal(syndrome_bit1(packet1, 1)),
1972
- by(rule("hamming-code.pl", clause(17))),
1973
- bindings([binding("Code", packet1), binding("S1", 1), binding("B1", 1), binding("B3", 1), binding("B5", 1), binding("B7", 0)]),
1974
- uses([
1975
- proof(
1976
- goal(received_bit(packet1, 1, 1)),
1977
- by(fact("hamming-code.pl", clause(7)))
1978
- ),
1979
- proof(
1980
- goal(received_bit(packet1, 3, 1)),
1981
- by(fact("hamming-code.pl", clause(9)))
1982
- ),
1983
- proof(
1984
- goal(received_bit(packet1, 5, 1)),
1985
- by(fact("hamming-code.pl", clause(11)))
1986
- ),
1987
- proof(
1988
- goal(received_bit(packet1, 7, 0)),
1989
- by(fact("hamming-code.pl", clause(13)))
1990
- ),
1991
- proof(
1992
- goal(parity4(1, 1, 1, 0, 1)),
1993
- by(rule("hamming-code.pl", clause(16))),
1994
- bindings([binding("A", 1), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 1), binding("AB", 2), binding("ABC", 3), binding("Sum", 3)]),
1995
- uses([
1996
- proof(
1997
- goal(add(1, 1, 2)),
1998
- by(builtin(add, 3))
1999
- ),
2000
- proof(
2001
- goal(add(2, 1, 3)),
2002
- by(builtin(add, 3))
2003
- ),
2004
- proof(
2005
- goal(add(3, 0, 3)),
2006
- by(builtin(add, 3))
2007
- ),
2008
- proof(
2009
- goal(mod(3, 2, 1)),
2010
- by(builtin(mod, 3))
2011
- )
2012
- ])
2013
- )
2014
- ])
2015
- ),
2016
- proof(
2017
- goal(syndrome_bit2(packet1, 0)),
2018
- by(rule("hamming-code.pl", clause(18))),
2019
- bindings([binding("Code", packet1), binding("S2", 0), binding("B2", 0), binding("B3", 1), binding("B6", 1), binding("B7", 0)]),
2020
- uses([
2021
- proof(
2022
- goal(received_bit(packet1, 2, 0)),
2023
- by(fact("hamming-code.pl", clause(8)))
2024
- ),
2025
- proof(
2026
- goal(received_bit(packet1, 3, 1)),
2027
- by(fact("hamming-code.pl", clause(9)))
2028
- ),
2029
- proof(
2030
- goal(received_bit(packet1, 6, 1)),
2031
- by(fact("hamming-code.pl", clause(12)))
2032
- ),
2033
- proof(
2034
- goal(received_bit(packet1, 7, 0)),
2035
- by(fact("hamming-code.pl", clause(13)))
2036
- ),
2037
- proof(
2038
- goal(parity4(0, 1, 1, 0, 0)),
2039
- by(rule("hamming-code.pl", clause(16))),
2040
- bindings([binding("A", 0), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 0), binding("AB", 1), binding("ABC", 2), binding("Sum", 2)]),
2041
- uses([
2042
- proof(
2043
- goal(add(0, 1, 1)),
2044
- by(builtin(add, 3))
2045
- ),
2046
- proof(
2047
- goal(add(1, 1, 2)),
2048
- by(builtin(add, 3))
2049
- ),
2050
- proof(
2051
- goal(add(2, 0, 2)),
2052
- by(builtin(add, 3))
2053
- ),
2054
- proof(
2055
- goal(mod(2, 2, 0)),
2056
- by(builtin(mod, 3))
2057
- )
2058
- ])
2059
- )
2060
- ])
2061
- ),
2062
- proof(
2063
- goal(syndrome_bit4(packet1, 1)),
2064
- by(rule("hamming-code.pl", clause(19))),
2065
- bindings([binding("Code", packet1), binding("S4", 1), binding("B4", 1), binding("B5", 1), binding("B6", 1), binding("B7", 0)]),
2066
- uses([
2067
- proof(
2068
- goal(received_bit(packet1, 4, 1)),
2069
- by(fact("hamming-code.pl", clause(10)))
2070
- ),
2071
- proof(
2072
- goal(received_bit(packet1, 5, 1)),
2073
- by(fact("hamming-code.pl", clause(11)))
2074
- ),
2075
- proof(
2076
- goal(received_bit(packet1, 6, 1)),
2077
- by(fact("hamming-code.pl", clause(12)))
2078
- ),
2079
- proof(
2080
- goal(received_bit(packet1, 7, 0)),
2081
- by(fact("hamming-code.pl", clause(13)))
2082
- ),
2083
- proof(
2084
- goal(parity4(1, 1, 1, 0, 1)),
2085
- by(rule("hamming-code.pl", clause(16))),
2086
- bindings([binding("A", 1), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 1), binding("AB", 2), binding("ABC", 3), binding("Sum", 3)]),
2087
- uses([
2088
- proof(
2089
- goal(add(1, 1, 2)),
2090
- by(builtin(add, 3))
2091
- ),
2092
- proof(
2093
- goal(add(2, 1, 3)),
2094
- by(builtin(add, 3))
2095
- ),
2096
- proof(
2097
- goal(add(3, 0, 3)),
2098
- by(builtin(add, 3))
2099
- ),
2100
- proof(
2101
- goal(mod(3, 2, 1)),
2102
- by(builtin(mod, 3))
2103
- )
2104
- ])
2105
- )
2106
- ])
2107
- ),
2108
- proof(
2109
- goal(mul(0, 2, 0)),
2110
- by(builtin(mul, 3))
2111
- ),
2112
- proof(
2113
- goal(mul(1, 4, 4)),
2114
- by(builtin(mul, 3))
2115
- ),
2116
- proof(
2117
- goal(add(1, 0, 1)),
2118
- by(builtin(add, 3))
2119
- ),
2120
- proof(
2121
- goal(add(1, 4, 5)),
2122
- by(builtin(add, 3))
2123
- )
2124
- ])
2125
- ),
2126
- proof(
2127
- goal(neq(6, 5)),
2128
- by(builtin(neq, 2))
2129
- ),
2130
- proof(
2131
- goal(received_bit(packet1, 6, 1)),
2132
- by(fact("hamming-code.pl", clause(12)))
2133
- )
2134
- ])
2135
- ),
2136
- proof(
2137
- goal(corrected_bit(packet1, 7, 0)),
2138
- by(rule("hamming-code.pl", clause(22))),
2139
- bindings([binding("Code", packet1), binding("Position", 7), binding("Bit", 0), binding("ErrorPosition", 5)]),
2140
- uses([
2141
- proof(
2142
- goal(syndrome(packet1, 5)),
2143
- by(rule("hamming-code.pl", clause(20))),
2144
- bindings([binding("Code", packet1), binding("Syndrome", 5), binding("S1", 1), binding("S2", 0), binding("S4", 1), binding("WeightedS2", 0), binding("WeightedS4", 4), binding("Partial", 1)]),
2145
- uses([
2146
- proof(
2147
- goal(syndrome_bit1(packet1, 1)),
2148
- by(rule("hamming-code.pl", clause(17))),
2149
- bindings([binding("Code", packet1), binding("S1", 1), binding("B1", 1), binding("B3", 1), binding("B5", 1), binding("B7", 0)]),
2150
- uses([
2151
- proof(
2152
- goal(received_bit(packet1, 1, 1)),
2153
- by(fact("hamming-code.pl", clause(7)))
2154
- ),
2155
- proof(
2156
- goal(received_bit(packet1, 3, 1)),
2157
- by(fact("hamming-code.pl", clause(9)))
2158
- ),
2159
- proof(
2160
- goal(received_bit(packet1, 5, 1)),
2161
- by(fact("hamming-code.pl", clause(11)))
2162
- ),
2163
- proof(
2164
- goal(received_bit(packet1, 7, 0)),
2165
- by(fact("hamming-code.pl", clause(13)))
2166
- ),
2167
- proof(
2168
- goal(parity4(1, 1, 1, 0, 1)),
2169
- by(rule("hamming-code.pl", clause(16))),
2170
- bindings([binding("A", 1), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 1), binding("AB", 2), binding("ABC", 3), binding("Sum", 3)]),
2171
- uses([
2172
- proof(
2173
- goal(add(1, 1, 2)),
2174
- by(builtin(add, 3))
2175
- ),
2176
- proof(
2177
- goal(add(2, 1, 3)),
2178
- by(builtin(add, 3))
2179
- ),
2180
- proof(
2181
- goal(add(3, 0, 3)),
2182
- by(builtin(add, 3))
2183
- ),
2184
- proof(
2185
- goal(mod(3, 2, 1)),
2186
- by(builtin(mod, 3))
2187
- )
2188
- ])
2189
- )
2190
- ])
2191
- ),
2192
- proof(
2193
- goal(syndrome_bit2(packet1, 0)),
2194
- by(rule("hamming-code.pl", clause(18))),
2195
- bindings([binding("Code", packet1), binding("S2", 0), binding("B2", 0), binding("B3", 1), binding("B6", 1), binding("B7", 0)]),
2196
- uses([
2197
- proof(
2198
- goal(received_bit(packet1, 2, 0)),
2199
- by(fact("hamming-code.pl", clause(8)))
2200
- ),
2201
- proof(
2202
- goal(received_bit(packet1, 3, 1)),
2203
- by(fact("hamming-code.pl", clause(9)))
2204
- ),
2205
- proof(
2206
- goal(received_bit(packet1, 6, 1)),
2207
- by(fact("hamming-code.pl", clause(12)))
2208
- ),
2209
- proof(
2210
- goal(received_bit(packet1, 7, 0)),
2211
- by(fact("hamming-code.pl", clause(13)))
2212
- ),
2213
- proof(
2214
- goal(parity4(0, 1, 1, 0, 0)),
2215
- by(rule("hamming-code.pl", clause(16))),
2216
- bindings([binding("A", 0), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 0), binding("AB", 1), binding("ABC", 2), binding("Sum", 2)]),
2217
- uses([
2218
- proof(
2219
- goal(add(0, 1, 1)),
2220
- by(builtin(add, 3))
2221
- ),
2222
- proof(
2223
- goal(add(1, 1, 2)),
2224
- by(builtin(add, 3))
2225
- ),
2226
- proof(
2227
- goal(add(2, 0, 2)),
2228
- by(builtin(add, 3))
2229
- ),
2230
- proof(
2231
- goal(mod(2, 2, 0)),
2232
- by(builtin(mod, 3))
2233
- )
2234
- ])
2235
- )
2236
- ])
2237
- ),
2238
- proof(
2239
- goal(syndrome_bit4(packet1, 1)),
2240
- by(rule("hamming-code.pl", clause(19))),
2241
- bindings([binding("Code", packet1), binding("S4", 1), binding("B4", 1), binding("B5", 1), binding("B6", 1), binding("B7", 0)]),
2242
- uses([
2243
- proof(
2244
- goal(received_bit(packet1, 4, 1)),
2245
- by(fact("hamming-code.pl", clause(10)))
2246
- ),
2247
- proof(
2248
- goal(received_bit(packet1, 5, 1)),
2249
- by(fact("hamming-code.pl", clause(11)))
2250
- ),
2251
- proof(
2252
- goal(received_bit(packet1, 6, 1)),
2253
- by(fact("hamming-code.pl", clause(12)))
2254
- ),
2255
- proof(
2256
- goal(received_bit(packet1, 7, 0)),
2257
- by(fact("hamming-code.pl", clause(13)))
2258
- ),
2259
- proof(
2260
- goal(parity4(1, 1, 1, 0, 1)),
2261
- by(rule("hamming-code.pl", clause(16))),
2262
- bindings([binding("A", 1), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 1), binding("AB", 2), binding("ABC", 3), binding("Sum", 3)]),
2263
- uses([
2264
- proof(
2265
- goal(add(1, 1, 2)),
2266
- by(builtin(add, 3))
2267
- ),
2268
- proof(
2269
- goal(add(2, 1, 3)),
2270
- by(builtin(add, 3))
2271
- ),
2272
- proof(
2273
- goal(add(3, 0, 3)),
2274
- by(builtin(add, 3))
2275
- ),
2276
- proof(
2277
- goal(mod(3, 2, 1)),
2278
- by(builtin(mod, 3))
2279
- )
2280
- ])
2281
- )
2282
- ])
2283
- ),
2284
- proof(
2285
- goal(mul(0, 2, 0)),
2286
- by(builtin(mul, 3))
2287
- ),
2288
- proof(
2289
- goal(mul(1, 4, 4)),
2290
- by(builtin(mul, 3))
2291
- ),
2292
- proof(
2293
- goal(add(1, 0, 1)),
2294
- by(builtin(add, 3))
2295
- ),
2296
- proof(
2297
- goal(add(1, 4, 5)),
2298
- by(builtin(add, 3))
2299
- )
2300
- ])
2301
- ),
2302
- proof(
2303
- goal(neq(7, 5)),
2304
- by(builtin(neq, 2))
2305
- ),
2306
- proof(
2307
- goal(received_bit(packet1, 7, 0)),
2308
- by(fact("hamming-code.pl", clause(13)))
2309
- )
2310
- ])
2311
- )
2312
- ])
2313
- )
2314
- ])
2315
- )
2316
- ).
2317
-
2318
5
  status(packet1, single_bit_corrected).
2319
- why(
2320
- status(packet1, single_bit_corrected),
2321
- proof(
2322
- goal(status(packet1, single_bit_corrected)),
2323
- by(rule("hamming-code.pl", clause(28))),
2324
- bindings([binding("Code", packet1), binding("Position", 5)]),
2325
- uses([
2326
- proof(
2327
- goal(syndrome(packet1, 5)),
2328
- by(rule("hamming-code.pl", clause(20))),
2329
- bindings([binding("Code", packet1), binding("Syndrome", 5), binding("S1", 1), binding("S2", 0), binding("S4", 1), binding("WeightedS2", 0), binding("WeightedS4", 4), binding("Partial", 1)]),
2330
- uses([
2331
- proof(
2332
- goal(syndrome_bit1(packet1, 1)),
2333
- by(rule("hamming-code.pl", clause(17))),
2334
- bindings([binding("Code", packet1), binding("S1", 1), binding("B1", 1), binding("B3", 1), binding("B5", 1), binding("B7", 0)]),
2335
- uses([
2336
- proof(
2337
- goal(received_bit(packet1, 1, 1)),
2338
- by(fact("hamming-code.pl", clause(7)))
2339
- ),
2340
- proof(
2341
- goal(received_bit(packet1, 3, 1)),
2342
- by(fact("hamming-code.pl", clause(9)))
2343
- ),
2344
- proof(
2345
- goal(received_bit(packet1, 5, 1)),
2346
- by(fact("hamming-code.pl", clause(11)))
2347
- ),
2348
- proof(
2349
- goal(received_bit(packet1, 7, 0)),
2350
- by(fact("hamming-code.pl", clause(13)))
2351
- ),
2352
- proof(
2353
- goal(parity4(1, 1, 1, 0, 1)),
2354
- by(rule("hamming-code.pl", clause(16))),
2355
- bindings([binding("A", 1), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 1), binding("AB", 2), binding("ABC", 3), binding("Sum", 3)]),
2356
- uses([
2357
- proof(
2358
- goal(add(1, 1, 2)),
2359
- by(builtin(add, 3))
2360
- ),
2361
- proof(
2362
- goal(add(2, 1, 3)),
2363
- by(builtin(add, 3))
2364
- ),
2365
- proof(
2366
- goal(add(3, 0, 3)),
2367
- by(builtin(add, 3))
2368
- ),
2369
- proof(
2370
- goal(mod(3, 2, 1)),
2371
- by(builtin(mod, 3))
2372
- )
2373
- ])
2374
- )
2375
- ])
2376
- ),
2377
- proof(
2378
- goal(syndrome_bit2(packet1, 0)),
2379
- by(rule("hamming-code.pl", clause(18))),
2380
- bindings([binding("Code", packet1), binding("S2", 0), binding("B2", 0), binding("B3", 1), binding("B6", 1), binding("B7", 0)]),
2381
- uses([
2382
- proof(
2383
- goal(received_bit(packet1, 2, 0)),
2384
- by(fact("hamming-code.pl", clause(8)))
2385
- ),
2386
- proof(
2387
- goal(received_bit(packet1, 3, 1)),
2388
- by(fact("hamming-code.pl", clause(9)))
2389
- ),
2390
- proof(
2391
- goal(received_bit(packet1, 6, 1)),
2392
- by(fact("hamming-code.pl", clause(12)))
2393
- ),
2394
- proof(
2395
- goal(received_bit(packet1, 7, 0)),
2396
- by(fact("hamming-code.pl", clause(13)))
2397
- ),
2398
- proof(
2399
- goal(parity4(0, 1, 1, 0, 0)),
2400
- by(rule("hamming-code.pl", clause(16))),
2401
- bindings([binding("A", 0), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 0), binding("AB", 1), binding("ABC", 2), binding("Sum", 2)]),
2402
- uses([
2403
- proof(
2404
- goal(add(0, 1, 1)),
2405
- by(builtin(add, 3))
2406
- ),
2407
- proof(
2408
- goal(add(1, 1, 2)),
2409
- by(builtin(add, 3))
2410
- ),
2411
- proof(
2412
- goal(add(2, 0, 2)),
2413
- by(builtin(add, 3))
2414
- ),
2415
- proof(
2416
- goal(mod(2, 2, 0)),
2417
- by(builtin(mod, 3))
2418
- )
2419
- ])
2420
- )
2421
- ])
2422
- ),
2423
- proof(
2424
- goal(syndrome_bit4(packet1, 1)),
2425
- by(rule("hamming-code.pl", clause(19))),
2426
- bindings([binding("Code", packet1), binding("S4", 1), binding("B4", 1), binding("B5", 1), binding("B6", 1), binding("B7", 0)]),
2427
- uses([
2428
- proof(
2429
- goal(received_bit(packet1, 4, 1)),
2430
- by(fact("hamming-code.pl", clause(10)))
2431
- ),
2432
- proof(
2433
- goal(received_bit(packet1, 5, 1)),
2434
- by(fact("hamming-code.pl", clause(11)))
2435
- ),
2436
- proof(
2437
- goal(received_bit(packet1, 6, 1)),
2438
- by(fact("hamming-code.pl", clause(12)))
2439
- ),
2440
- proof(
2441
- goal(received_bit(packet1, 7, 0)),
2442
- by(fact("hamming-code.pl", clause(13)))
2443
- ),
2444
- proof(
2445
- goal(parity4(1, 1, 1, 0, 1)),
2446
- by(rule("hamming-code.pl", clause(16))),
2447
- bindings([binding("A", 1), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 1), binding("AB", 2), binding("ABC", 3), binding("Sum", 3)]),
2448
- uses([
2449
- proof(
2450
- goal(add(1, 1, 2)),
2451
- by(builtin(add, 3))
2452
- ),
2453
- proof(
2454
- goal(add(2, 1, 3)),
2455
- by(builtin(add, 3))
2456
- ),
2457
- proof(
2458
- goal(add(3, 0, 3)),
2459
- by(builtin(add, 3))
2460
- ),
2461
- proof(
2462
- goal(mod(3, 2, 1)),
2463
- by(builtin(mod, 3))
2464
- )
2465
- ])
2466
- )
2467
- ])
2468
- ),
2469
- proof(
2470
- goal(mul(0, 2, 0)),
2471
- by(builtin(mul, 3))
2472
- ),
2473
- proof(
2474
- goal(mul(1, 4, 4)),
2475
- by(builtin(mul, 3))
2476
- ),
2477
- proof(
2478
- goal(add(1, 0, 1)),
2479
- by(builtin(add, 3))
2480
- ),
2481
- proof(
2482
- goal(add(1, 4, 5)),
2483
- by(builtin(add, 3))
2484
- )
2485
- ])
2486
- ),
2487
- proof(
2488
- goal(gt(5, 0)),
2489
- by(builtin(gt, 2))
2490
- )
2491
- ])
2492
- )
2493
- ).
2494
-
2495
6
  reason(packet1, "Hamming syndrome identifies the flipped bit position").
2496
- why(
2497
- reason(packet1, "Hamming syndrome identifies the flipped bit position"),
2498
- proof(
2499
- goal(reason(packet1, "Hamming syndrome identifies the flipped bit position")),
2500
- by(rule("hamming-code.pl", clause(29))),
2501
- bindings([binding("Code", packet1), binding("Position", 5)]),
2502
- uses([
2503
- proof(
2504
- goal(syndrome(packet1, 5)),
2505
- by(rule("hamming-code.pl", clause(20))),
2506
- bindings([binding("Code", packet1), binding("Syndrome", 5), binding("S1", 1), binding("S2", 0), binding("S4", 1), binding("WeightedS2", 0), binding("WeightedS4", 4), binding("Partial", 1)]),
2507
- uses([
2508
- proof(
2509
- goal(syndrome_bit1(packet1, 1)),
2510
- by(rule("hamming-code.pl", clause(17))),
2511
- bindings([binding("Code", packet1), binding("S1", 1), binding("B1", 1), binding("B3", 1), binding("B5", 1), binding("B7", 0)]),
2512
- uses([
2513
- proof(
2514
- goal(received_bit(packet1, 1, 1)),
2515
- by(fact("hamming-code.pl", clause(7)))
2516
- ),
2517
- proof(
2518
- goal(received_bit(packet1, 3, 1)),
2519
- by(fact("hamming-code.pl", clause(9)))
2520
- ),
2521
- proof(
2522
- goal(received_bit(packet1, 5, 1)),
2523
- by(fact("hamming-code.pl", clause(11)))
2524
- ),
2525
- proof(
2526
- goal(received_bit(packet1, 7, 0)),
2527
- by(fact("hamming-code.pl", clause(13)))
2528
- ),
2529
- proof(
2530
- goal(parity4(1, 1, 1, 0, 1)),
2531
- by(rule("hamming-code.pl", clause(16))),
2532
- bindings([binding("A", 1), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 1), binding("AB", 2), binding("ABC", 3), binding("Sum", 3)]),
2533
- uses([
2534
- proof(
2535
- goal(add(1, 1, 2)),
2536
- by(builtin(add, 3))
2537
- ),
2538
- proof(
2539
- goal(add(2, 1, 3)),
2540
- by(builtin(add, 3))
2541
- ),
2542
- proof(
2543
- goal(add(3, 0, 3)),
2544
- by(builtin(add, 3))
2545
- ),
2546
- proof(
2547
- goal(mod(3, 2, 1)),
2548
- by(builtin(mod, 3))
2549
- )
2550
- ])
2551
- )
2552
- ])
2553
- ),
2554
- proof(
2555
- goal(syndrome_bit2(packet1, 0)),
2556
- by(rule("hamming-code.pl", clause(18))),
2557
- bindings([binding("Code", packet1), binding("S2", 0), binding("B2", 0), binding("B3", 1), binding("B6", 1), binding("B7", 0)]),
2558
- uses([
2559
- proof(
2560
- goal(received_bit(packet1, 2, 0)),
2561
- by(fact("hamming-code.pl", clause(8)))
2562
- ),
2563
- proof(
2564
- goal(received_bit(packet1, 3, 1)),
2565
- by(fact("hamming-code.pl", clause(9)))
2566
- ),
2567
- proof(
2568
- goal(received_bit(packet1, 6, 1)),
2569
- by(fact("hamming-code.pl", clause(12)))
2570
- ),
2571
- proof(
2572
- goal(received_bit(packet1, 7, 0)),
2573
- by(fact("hamming-code.pl", clause(13)))
2574
- ),
2575
- proof(
2576
- goal(parity4(0, 1, 1, 0, 0)),
2577
- by(rule("hamming-code.pl", clause(16))),
2578
- bindings([binding("A", 0), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 0), binding("AB", 1), binding("ABC", 2), binding("Sum", 2)]),
2579
- uses([
2580
- proof(
2581
- goal(add(0, 1, 1)),
2582
- by(builtin(add, 3))
2583
- ),
2584
- proof(
2585
- goal(add(1, 1, 2)),
2586
- by(builtin(add, 3))
2587
- ),
2588
- proof(
2589
- goal(add(2, 0, 2)),
2590
- by(builtin(add, 3))
2591
- ),
2592
- proof(
2593
- goal(mod(2, 2, 0)),
2594
- by(builtin(mod, 3))
2595
- )
2596
- ])
2597
- )
2598
- ])
2599
- ),
2600
- proof(
2601
- goal(syndrome_bit4(packet1, 1)),
2602
- by(rule("hamming-code.pl", clause(19))),
2603
- bindings([binding("Code", packet1), binding("S4", 1), binding("B4", 1), binding("B5", 1), binding("B6", 1), binding("B7", 0)]),
2604
- uses([
2605
- proof(
2606
- goal(received_bit(packet1, 4, 1)),
2607
- by(fact("hamming-code.pl", clause(10)))
2608
- ),
2609
- proof(
2610
- goal(received_bit(packet1, 5, 1)),
2611
- by(fact("hamming-code.pl", clause(11)))
2612
- ),
2613
- proof(
2614
- goal(received_bit(packet1, 6, 1)),
2615
- by(fact("hamming-code.pl", clause(12)))
2616
- ),
2617
- proof(
2618
- goal(received_bit(packet1, 7, 0)),
2619
- by(fact("hamming-code.pl", clause(13)))
2620
- ),
2621
- proof(
2622
- goal(parity4(1, 1, 1, 0, 1)),
2623
- by(rule("hamming-code.pl", clause(16))),
2624
- bindings([binding("A", 1), binding("B", 1), binding("C", 1), binding("D", 0), binding("Parity", 1), binding("AB", 2), binding("ABC", 3), binding("Sum", 3)]),
2625
- uses([
2626
- proof(
2627
- goal(add(1, 1, 2)),
2628
- by(builtin(add, 3))
2629
- ),
2630
- proof(
2631
- goal(add(2, 1, 3)),
2632
- by(builtin(add, 3))
2633
- ),
2634
- proof(
2635
- goal(add(3, 0, 3)),
2636
- by(builtin(add, 3))
2637
- ),
2638
- proof(
2639
- goal(mod(3, 2, 1)),
2640
- by(builtin(mod, 3))
2641
- )
2642
- ])
2643
- )
2644
- ])
2645
- ),
2646
- proof(
2647
- goal(mul(0, 2, 0)),
2648
- by(builtin(mul, 3))
2649
- ),
2650
- proof(
2651
- goal(mul(1, 4, 4)),
2652
- by(builtin(mul, 3))
2653
- ),
2654
- proof(
2655
- goal(add(1, 0, 1)),
2656
- by(builtin(add, 3))
2657
- ),
2658
- proof(
2659
- goal(add(1, 4, 5)),
2660
- by(builtin(add, 3))
2661
- )
2662
- ])
2663
- ),
2664
- proof(
2665
- goal(gt(5, 0)),
2666
- by(builtin(gt, 2))
2667
- )
2668
- ])
2669
- )
2670
- ).
2671
-