eyelang 4.0.6 → 4.0.8

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 (75) hide show
  1. package/README.md +4 -0
  2. package/bin/eyelang.js +1 -1
  3. package/conformance-report.md +3 -3
  4. package/docs/guide.md +12 -11
  5. package/docs/language-reference.md +22 -16
  6. package/examples/abstract-interpretation.pl +0 -1
  7. package/examples/bayes-therapy.pl +1 -4
  8. package/examples/binomial-vandermonde.pl +1 -2
  9. package/examples/catalan-convolution.pl +1 -2
  10. package/examples/chart-parser.pl +1 -2
  11. package/examples/collatz-1000.pl +1 -2
  12. package/examples/continued-fraction-sqrt2.pl +1 -2
  13. package/examples/critical-path-schedule.pl +0 -2
  14. package/examples/dijkstra-risk-path.pl +0 -1
  15. package/examples/drone-corridor-planner.pl +0 -1
  16. package/examples/equality-saturation.pl +0 -2
  17. package/examples/family-cousins.pl +0 -3
  18. package/examples/fibonacci.pl +0 -1
  19. package/examples/gd-step-certified.pl +0 -7
  20. package/examples/gps.pl +0 -2
  21. package/examples/hamiltonian-path.pl +0 -1
  22. package/examples/hanoi.pl +0 -1
  23. package/examples/integer-partitions.pl +0 -1
  24. package/examples/intuitionistic-logic-kripke.pl +0 -2
  25. package/examples/knuth-bendix-completion.pl +0 -1
  26. package/examples/language.pl +1 -2
  27. package/examples/matrix-chain-order.pl +1 -2
  28. package/examples/modular-exponentiation.pl +0 -1
  29. package/examples/monkey-bananas.pl +0 -1
  30. package/examples/n-queens-8.pl +0 -1
  31. package/examples/output/chart-parser.pl +1 -1
  32. package/examples/partial-evaluator.pl +0 -1
  33. package/examples/peano-calculus.pl +0 -3
  34. package/examples/pell-equation.pl +1 -2
  35. package/examples/pointer-analysis.pl +0 -2
  36. package/examples/prime-range.pl +0 -1
  37. package/examples/proof/chart-parser.pl +91 -77
  38. package/examples/proof/hanoi.pl +16 -16
  39. package/examples/proof/intuitionistic-logic-kripke.pl +16 -16
  40. package/examples/route-planning.pl +0 -1
  41. package/examples/stirling-bell-numbers.pl +0 -4
  42. package/examples/totient-summatory.pl +1 -3
  43. package/examples/truth-maintenance-system.pl +0 -1
  44. package/examples/type-inference.pl +0 -1
  45. package/examples/web-names.pl +0 -1
  46. package/examples/weighted-interval-scheduling.pl +2 -3
  47. package/examples/wolf-goat-cabbage.pl +0 -1
  48. package/index.d.ts +1 -0
  49. package/package.json +1 -1
  50. package/src/explain.js +3 -1
  51. package/src/program.js +88 -9
  52. package/src/solver.js +95 -46
  53. package/test/conformance/cases/{table/038_table_declaration.pl → automatic-tabling/038_automatic_tabling.pl} +1 -2
  54. package/test/conformance/cases/{table/102_table_declaration.pl → automatic-tabling/102_recursive_inference.pl} +1 -2
  55. package/test/conformance/cases/{table/tabled_left_recursion_path.pl → automatic-tabling/automatic_left_recursion_path.pl} +0 -1
  56. package/test/conformance/cases/{table/table_does_not_change_answers.pl → automatic-tabling/automatic_tabling_preserves_answers.pl} +1 -2
  57. package/test/conformance/cases/{table/extra_table_bound_cycle.pl → automatic-tabling/extra_automatic_bound_cycle.pl} +0 -1
  58. package/test/conformance/cases/{table/extra_table_open_call_fallback.pl → automatic-tabling/extra_automatic_open_call_fallback.pl} +0 -1
  59. package/test/conformance/cases/rules/transitive_rule_three_edges.pl +0 -1
  60. package/test/conformance/expected/{table/tabled_left_recursion_path.pl → automatic-tabling/automatic_left_recursion_path.pl} +1 -0
  61. package/test/conformance/expected-proofs/proofs/{table_recursive.pl → automatic_recursive.pl} +8 -8
  62. package/test/conformance/expected-proofs/proofs/{extra_table_path_bound.pl → extra_automatic_path_bound.pl} +8 -8
  63. package/test/conformance/proofs/proofs/{table_recursive.pl → automatic_recursive.pl} +1 -2
  64. package/test/conformance/proofs/proofs/{extra_table_path_bound.pl → extra_automatic_path_bound.pl} +0 -1
  65. package/test/conformance/warnings/negation/{extra_stratified_negation_with_table_quiet.pl → extra_stratified_negation_with_recursion_quiet.pl} +0 -1
  66. package/test/run-regression.mjs +52 -11
  67. package/test/conformance/cases/declarations/table_is_also_fact.pl +0 -4
  68. package/test/conformance/expected/declarations/table_is_also_fact.pl +0 -1
  69. /package/test/conformance/expected/{table/038_table_declaration.pl → automatic-tabling/038_automatic_tabling.pl} +0 -0
  70. /package/test/conformance/expected/{table/102_table_declaration.pl → automatic-tabling/102_recursive_inference.pl} +0 -0
  71. /package/test/conformance/expected/{table/table_does_not_change_answers.pl → automatic-tabling/automatic_tabling_preserves_answers.pl} +0 -0
  72. /package/test/conformance/expected/{table/extra_table_bound_cycle.pl → automatic-tabling/extra_automatic_bound_cycle.pl} +0 -0
  73. /package/test/conformance/expected/{table/extra_table_open_call_fallback.pl → automatic-tabling/extra_automatic_open_call_fallback.pl} +0 -0
  74. /package/test/conformance/expected-warnings/negation/{extra_stratified_negation_with_table_quiet.pl → extra_stratified_negation_with_recursion_quiet.pl} +0 -0
  75. /package/test/conformance/expected-warnings/negation/{extra_stratified_negation_with_table_quiet.txt → extra_stratified_negation_with_recursion_quiet.txt} +0 -0
@@ -3,43 +3,43 @@ why(
3
3
  chart_parser_answer(parsed, command),
4
4
  proof(
5
5
  goal(chart_parser_answer(parsed, command)),
6
- by(rule("chart-parser.pl", clause(33))),
6
+ by(rule("chart-parser.pl", clause(32))),
7
7
  bindings([binding("Sentence", command), binding("Length", 5)]),
8
8
  uses([
9
9
  proof(
10
10
  goal(sentence(command, 5)),
11
- by(fact("chart-parser.pl", clause(3)))
11
+ by(fact("chart-parser.pl", clause(2)))
12
12
  ),
13
13
  proof(
14
14
  goal(span(command, s, 0, 5)),
15
- by(rule("chart-parser.pl", clause(32))),
15
+ by(rule("chart-parser.pl", clause(31))),
16
16
  bindings([binding("Sentence", command), binding("Category", s), binding("Start", 0), binding("End", 5), binding("Left", np), binding("Right", vp), binding("Middle", 2)]),
17
17
  uses([
18
18
  proof(
19
19
  goal(rule(s, np, vp)),
20
- by(fact("chart-parser.pl", clause(25)))
20
+ by(fact("chart-parser.pl", clause(24)))
21
21
  ),
22
22
  proof(
23
23
  goal(span(command, np, 0, 2)),
24
- by(rule("chart-parser.pl", clause(32))),
24
+ by(rule("chart-parser.pl", clause(31))),
25
25
  bindings([binding("Sentence", command), binding("Category", np), binding("Start", 0), binding("End", 2), binding("Left", det), binding("Right", noun), binding("Middle", 1)]),
26
26
  uses([
27
27
  proof(
28
28
  goal(rule(np, det, noun)),
29
- by(fact("chart-parser.pl", clause(26)))
29
+ by(fact("chart-parser.pl", clause(25)))
30
30
  ),
31
31
  proof(
32
32
  goal(span(command, det, 0, 1)),
33
- by(rule("chart-parser.pl", clause(31))),
33
+ by(rule("chart-parser.pl", clause(30))),
34
34
  bindings([binding("Sentence", command), binding("Category", det), binding("Start", 0), binding("End", 1), binding("Token", the)]),
35
35
  uses([
36
36
  proof(
37
37
  goal(word(command, 0, the)),
38
- by(fact("chart-parser.pl", clause(5)))
38
+ by(fact("chart-parser.pl", clause(4)))
39
39
  ),
40
40
  proof(
41
41
  goal(terminal(det, the)),
42
- by(fact("chart-parser.pl", clause(18)))
42
+ by(fact("chart-parser.pl", clause(17)))
43
43
  ),
44
44
  proof(
45
45
  goal(add(0, 1, 1)),
@@ -49,16 +49,16 @@ why(
49
49
  ),
50
50
  proof(
51
51
  goal(span(command, noun, 1, 2)),
52
- by(rule("chart-parser.pl", clause(31))),
52
+ by(rule("chart-parser.pl", clause(30))),
53
53
  bindings([binding("Sentence", command), binding("Category", noun), binding("Start", 1), binding("End", 2), binding("Token", robot)]),
54
54
  uses([
55
55
  proof(
56
56
  goal(word(command, 1, robot)),
57
- by(fact("chart-parser.pl", clause(6)))
57
+ by(fact("chart-parser.pl", clause(5)))
58
58
  ),
59
59
  proof(
60
60
  goal(terminal(noun, robot)),
61
- by(fact("chart-parser.pl", clause(19)))
61
+ by(fact("chart-parser.pl", clause(18)))
62
62
  ),
63
63
  proof(
64
64
  goal(add(1, 1, 2)),
@@ -70,25 +70,25 @@ why(
70
70
  ),
71
71
  proof(
72
72
  goal(span(command, vp, 2, 5)),
73
- by(rule("chart-parser.pl", clause(32))),
73
+ by(rule("chart-parser.pl", clause(31))),
74
74
  bindings([binding("Sentence", command), binding("Category", vp), binding("Start", 2), binding("End", 5), binding("Left", verb), binding("Right", np), binding("Middle", 3)]),
75
75
  uses([
76
76
  proof(
77
77
  goal(rule(vp, verb, np)),
78
- by(fact("chart-parser.pl", clause(28)))
78
+ by(fact("chart-parser.pl", clause(27)))
79
79
  ),
80
80
  proof(
81
81
  goal(span(command, verb, 2, 3)),
82
- by(rule("chart-parser.pl", clause(31))),
82
+ by(rule("chart-parser.pl", clause(30))),
83
83
  bindings([binding("Sentence", command), binding("Category", verb), binding("Start", 2), binding("End", 3), binding("Token", moves)]),
84
84
  uses([
85
85
  proof(
86
86
  goal(word(command, 2, moves)),
87
- by(fact("chart-parser.pl", clause(7)))
87
+ by(fact("chart-parser.pl", clause(6)))
88
88
  ),
89
89
  proof(
90
90
  goal(terminal(verb, moves)),
91
- by(fact("chart-parser.pl", clause(22)))
91
+ by(fact("chart-parser.pl", clause(21)))
92
92
  ),
93
93
  proof(
94
94
  goal(add(2, 1, 3)),
@@ -98,25 +98,25 @@ why(
98
98
  ),
99
99
  proof(
100
100
  goal(span(command, np, 3, 5)),
101
- by(rule("chart-parser.pl", clause(32))),
101
+ by(rule("chart-parser.pl", clause(31))),
102
102
  bindings([binding("Sentence", command), binding("Category", np), binding("Start", 3), binding("End", 5), binding("Left", det), binding("Right", noun), binding("Middle", 4)]),
103
103
  uses([
104
104
  proof(
105
105
  goal(rule(np, det, noun)),
106
- by(fact("chart-parser.pl", clause(26)))
106
+ by(fact("chart-parser.pl", clause(25)))
107
107
  ),
108
108
  proof(
109
109
  goal(span(command, det, 3, 4)),
110
- by(rule("chart-parser.pl", clause(31))),
110
+ by(rule("chart-parser.pl", clause(30))),
111
111
  bindings([binding("Sentence", command), binding("Category", det), binding("Start", 3), binding("End", 4), binding("Token", the)]),
112
112
  uses([
113
113
  proof(
114
114
  goal(word(command, 3, the)),
115
- by(fact("chart-parser.pl", clause(8)))
115
+ by(fact("chart-parser.pl", clause(7)))
116
116
  ),
117
117
  proof(
118
118
  goal(terminal(det, the)),
119
- by(fact("chart-parser.pl", clause(18)))
119
+ by(fact("chart-parser.pl", clause(17)))
120
120
  ),
121
121
  proof(
122
122
  goal(add(3, 1, 4)),
@@ -126,16 +126,16 @@ why(
126
126
  ),
127
127
  proof(
128
128
  goal(span(command, noun, 4, 5)),
129
- by(rule("chart-parser.pl", clause(31))),
129
+ by(rule("chart-parser.pl", clause(30))),
130
130
  bindings([binding("Sentence", command), binding("Category", noun), binding("Start", 4), binding("End", 5), binding("Token", box)]),
131
131
  uses([
132
132
  proof(
133
133
  goal(word(command, 4, box)),
134
- by(fact("chart-parser.pl", clause(9)))
134
+ by(fact("chart-parser.pl", clause(8)))
135
135
  ),
136
136
  proof(
137
137
  goal(terminal(noun, box)),
138
- by(fact("chart-parser.pl", clause(20)))
138
+ by(fact("chart-parser.pl", clause(19)))
139
139
  ),
140
140
  proof(
141
141
  goal(add(4, 1, 5)),
@@ -158,43 +158,43 @@ why(
158
158
  chart_parser_answer(parsed, ambiguous_pp),
159
159
  proof(
160
160
  goal(chart_parser_answer(parsed, ambiguous_pp)),
161
- by(rule("chart-parser.pl", clause(33))),
161
+ by(rule("chart-parser.pl", clause(32))),
162
162
  bindings([binding("Sentence", ambiguous_pp), binding("Length", 8)]),
163
163
  uses([
164
164
  proof(
165
165
  goal(sentence(ambiguous_pp, 8)),
166
- by(fact("chart-parser.pl", clause(4)))
166
+ by(fact("chart-parser.pl", clause(3)))
167
167
  ),
168
168
  proof(
169
169
  goal(span(ambiguous_pp, s, 0, 8)),
170
- by(rule("chart-parser.pl", clause(32))),
170
+ by(rule("chart-parser.pl", clause(31))),
171
171
  bindings([binding("Sentence", ambiguous_pp), binding("Category", s), binding("Start", 0), binding("End", 8), binding("Left", np), binding("Right", vp), binding("Middle", 2)]),
172
172
  uses([
173
173
  proof(
174
174
  goal(rule(s, np, vp)),
175
- by(fact("chart-parser.pl", clause(25)))
175
+ by(fact("chart-parser.pl", clause(24)))
176
176
  ),
177
177
  proof(
178
178
  goal(span(ambiguous_pp, np, 0, 2)),
179
- by(rule("chart-parser.pl", clause(32))),
179
+ by(rule("chart-parser.pl", clause(31))),
180
180
  bindings([binding("Sentence", ambiguous_pp), binding("Category", np), binding("Start", 0), binding("End", 2), binding("Left", det), binding("Right", noun), binding("Middle", 1)]),
181
181
  uses([
182
182
  proof(
183
183
  goal(rule(np, det, noun)),
184
- by(fact("chart-parser.pl", clause(26)))
184
+ by(fact("chart-parser.pl", clause(25)))
185
185
  ),
186
186
  proof(
187
187
  goal(span(ambiguous_pp, det, 0, 1)),
188
- by(rule("chart-parser.pl", clause(31))),
188
+ by(rule("chart-parser.pl", clause(30))),
189
189
  bindings([binding("Sentence", ambiguous_pp), binding("Category", det), binding("Start", 0), binding("End", 1), binding("Token", the)]),
190
190
  uses([
191
191
  proof(
192
192
  goal(word(ambiguous_pp, 0, the)),
193
- by(fact("chart-parser.pl", clause(10)))
193
+ by(fact("chart-parser.pl", clause(9)))
194
194
  ),
195
195
  proof(
196
196
  goal(terminal(det, the)),
197
- by(fact("chart-parser.pl", clause(18)))
197
+ by(fact("chart-parser.pl", clause(17)))
198
198
  ),
199
199
  proof(
200
200
  goal(add(0, 1, 1)),
@@ -204,16 +204,16 @@ why(
204
204
  ),
205
205
  proof(
206
206
  goal(span(ambiguous_pp, noun, 1, 2)),
207
- by(rule("chart-parser.pl", clause(31))),
207
+ by(rule("chart-parser.pl", clause(30))),
208
208
  bindings([binding("Sentence", ambiguous_pp), binding("Category", noun), binding("Start", 1), binding("End", 2), binding("Token", robot)]),
209
209
  uses([
210
210
  proof(
211
211
  goal(word(ambiguous_pp, 1, robot)),
212
- by(fact("chart-parser.pl", clause(11)))
212
+ by(fact("chart-parser.pl", clause(10)))
213
213
  ),
214
214
  proof(
215
215
  goal(terminal(noun, robot)),
216
- by(fact("chart-parser.pl", clause(19)))
216
+ by(fact("chart-parser.pl", clause(18)))
217
217
  ),
218
218
  proof(
219
219
  goal(add(1, 1, 2)),
@@ -225,25 +225,25 @@ why(
225
225
  ),
226
226
  proof(
227
227
  goal(span(ambiguous_pp, vp, 2, 8)),
228
- by(rule("chart-parser.pl", clause(32))),
228
+ by(rule("chart-parser.pl", clause(31))),
229
229
  bindings([binding("Sentence", ambiguous_pp), binding("Category", vp), binding("Start", 2), binding("End", 8), binding("Left", verb), binding("Right", np), binding("Middle", 3)]),
230
230
  uses([
231
231
  proof(
232
232
  goal(rule(vp, verb, np)),
233
- by(fact("chart-parser.pl", clause(28)))
233
+ by(fact("chart-parser.pl", clause(27)))
234
234
  ),
235
235
  proof(
236
236
  goal(span(ambiguous_pp, verb, 2, 3)),
237
- by(rule("chart-parser.pl", clause(31))),
237
+ by(rule("chart-parser.pl", clause(30))),
238
238
  bindings([binding("Sentence", ambiguous_pp), binding("Category", verb), binding("Start", 2), binding("End", 3), binding("Token", sees)]),
239
239
  uses([
240
240
  proof(
241
241
  goal(word(ambiguous_pp, 2, sees)),
242
- by(fact("chart-parser.pl", clause(12)))
242
+ by(fact("chart-parser.pl", clause(11)))
243
243
  ),
244
244
  proof(
245
245
  goal(terminal(verb, sees)),
246
- by(fact("chart-parser.pl", clause(23)))
246
+ by(fact("chart-parser.pl", clause(22)))
247
247
  ),
248
248
  proof(
249
249
  goal(add(2, 1, 3)),
@@ -253,34 +253,34 @@ why(
253
253
  ),
254
254
  proof(
255
255
  goal(span(ambiguous_pp, np, 3, 8)),
256
- by(rule("chart-parser.pl", clause(32))),
256
+ by(rule("chart-parser.pl", clause(31))),
257
257
  bindings([binding("Sentence", ambiguous_pp), binding("Category", np), binding("Start", 3), binding("End", 8), binding("Left", np), binding("Right", pp), binding("Middle", 5)]),
258
258
  uses([
259
259
  proof(
260
260
  goal(rule(np, np, pp)),
261
- by(fact("chart-parser.pl", clause(27)))
261
+ by(fact("chart-parser.pl", clause(26)))
262
262
  ),
263
263
  proof(
264
264
  goal(span(ambiguous_pp, np, 3, 5)),
265
- by(rule("chart-parser.pl", clause(32))),
265
+ by(rule("chart-parser.pl", clause(31))),
266
266
  bindings([binding("Sentence", ambiguous_pp), binding("Category", np), binding("Start", 3), binding("End", 5), binding("Left", det), binding("Right", noun), binding("Middle", 4)]),
267
267
  uses([
268
268
  proof(
269
269
  goal(rule(np, det, noun)),
270
- by(fact("chart-parser.pl", clause(26)))
270
+ by(fact("chart-parser.pl", clause(25)))
271
271
  ),
272
272
  proof(
273
273
  goal(span(ambiguous_pp, det, 3, 4)),
274
- by(rule("chart-parser.pl", clause(31))),
274
+ by(rule("chart-parser.pl", clause(30))),
275
275
  bindings([binding("Sentence", ambiguous_pp), binding("Category", det), binding("Start", 3), binding("End", 4), binding("Token", the)]),
276
276
  uses([
277
277
  proof(
278
278
  goal(word(ambiguous_pp, 3, the)),
279
- by(fact("chart-parser.pl", clause(13)))
279
+ by(fact("chart-parser.pl", clause(12)))
280
280
  ),
281
281
  proof(
282
282
  goal(terminal(det, the)),
283
- by(fact("chart-parser.pl", clause(18)))
283
+ by(fact("chart-parser.pl", clause(17)))
284
284
  ),
285
285
  proof(
286
286
  goal(add(3, 1, 4)),
@@ -290,16 +290,16 @@ why(
290
290
  ),
291
291
  proof(
292
292
  goal(span(ambiguous_pp, noun, 4, 5)),
293
- by(rule("chart-parser.pl", clause(31))),
293
+ by(rule("chart-parser.pl", clause(30))),
294
294
  bindings([binding("Sentence", ambiguous_pp), binding("Category", noun), binding("Start", 4), binding("End", 5), binding("Token", box)]),
295
295
  uses([
296
296
  proof(
297
297
  goal(word(ambiguous_pp, 4, box)),
298
- by(fact("chart-parser.pl", clause(14)))
298
+ by(fact("chart-parser.pl", clause(13)))
299
299
  ),
300
300
  proof(
301
301
  goal(terminal(noun, box)),
302
- by(fact("chart-parser.pl", clause(20)))
302
+ by(fact("chart-parser.pl", clause(19)))
303
303
  ),
304
304
  proof(
305
305
  goal(add(4, 1, 5)),
@@ -311,25 +311,25 @@ why(
311
311
  ),
312
312
  proof(
313
313
  goal(span(ambiguous_pp, pp, 5, 8)),
314
- by(rule("chart-parser.pl", clause(32))),
314
+ by(rule("chart-parser.pl", clause(31))),
315
315
  bindings([binding("Sentence", ambiguous_pp), binding("Category", pp), binding("Start", 5), binding("End", 8), binding("Left", prep), binding("Right", np), binding("Middle", 6)]),
316
316
  uses([
317
317
  proof(
318
318
  goal(rule(pp, prep, np)),
319
- by(fact("chart-parser.pl", clause(30)))
319
+ by(fact("chart-parser.pl", clause(29)))
320
320
  ),
321
321
  proof(
322
322
  goal(span(ambiguous_pp, prep, 5, 6)),
323
- by(rule("chart-parser.pl", clause(31))),
323
+ by(rule("chart-parser.pl", clause(30))),
324
324
  bindings([binding("Sentence", ambiguous_pp), binding("Category", prep), binding("Start", 5), binding("End", 6), binding("Token", with)]),
325
325
  uses([
326
326
  proof(
327
327
  goal(word(ambiguous_pp, 5, with)),
328
- by(fact("chart-parser.pl", clause(15)))
328
+ by(fact("chart-parser.pl", clause(14)))
329
329
  ),
330
330
  proof(
331
331
  goal(terminal(prep, with)),
332
- by(fact("chart-parser.pl", clause(24)))
332
+ by(fact("chart-parser.pl", clause(23)))
333
333
  ),
334
334
  proof(
335
335
  goal(add(5, 1, 6)),
@@ -339,25 +339,25 @@ why(
339
339
  ),
340
340
  proof(
341
341
  goal(span(ambiguous_pp, np, 6, 8)),
342
- by(rule("chart-parser.pl", clause(32))),
342
+ by(rule("chart-parser.pl", clause(31))),
343
343
  bindings([binding("Sentence", ambiguous_pp), binding("Category", np), binding("Start", 6), binding("End", 8), binding("Left", det), binding("Right", noun), binding("Middle", 7)]),
344
344
  uses([
345
345
  proof(
346
346
  goal(rule(np, det, noun)),
347
- by(fact("chart-parser.pl", clause(26)))
347
+ by(fact("chart-parser.pl", clause(25)))
348
348
  ),
349
349
  proof(
350
350
  goal(span(ambiguous_pp, det, 6, 7)),
351
- by(rule("chart-parser.pl", clause(31))),
351
+ by(rule("chart-parser.pl", clause(30))),
352
352
  bindings([binding("Sentence", ambiguous_pp), binding("Category", det), binding("Start", 6), binding("End", 7), binding("Token", the)]),
353
353
  uses([
354
354
  proof(
355
355
  goal(word(ambiguous_pp, 6, the)),
356
- by(fact("chart-parser.pl", clause(16)))
356
+ by(fact("chart-parser.pl", clause(15)))
357
357
  ),
358
358
  proof(
359
359
  goal(terminal(det, the)),
360
- by(fact("chart-parser.pl", clause(18)))
360
+ by(fact("chart-parser.pl", clause(17)))
361
361
  ),
362
362
  proof(
363
363
  goal(add(6, 1, 7)),
@@ -367,16 +367,16 @@ why(
367
367
  ),
368
368
  proof(
369
369
  goal(span(ambiguous_pp, noun, 7, 8)),
370
- by(rule("chart-parser.pl", clause(31))),
370
+ by(rule("chart-parser.pl", clause(30))),
371
371
  bindings([binding("Sentence", ambiguous_pp), binding("Category", noun), binding("Start", 7), binding("End", 8), binding("Token", telescope)]),
372
372
  uses([
373
373
  proof(
374
374
  goal(word(ambiguous_pp, 7, telescope)),
375
- by(fact("chart-parser.pl", clause(17)))
375
+ by(fact("chart-parser.pl", clause(16)))
376
376
  ),
377
377
  proof(
378
378
  goal(terminal(noun, telescope)),
379
- by(fact("chart-parser.pl", clause(21)))
379
+ by(fact("chart-parser.pl", clause(20)))
380
380
  ),
381
381
  proof(
382
382
  goal(add(7, 1, 8)),
@@ -403,12 +403,12 @@ why(
403
403
  chart_parser_answer(parse_count, count(command, 1)),
404
404
  proof(
405
405
  goal(chart_parser_answer(parse_count, count(command, 1))),
406
- by(rule("chart-parser.pl", clause(34))),
406
+ by(rule("chart-parser.pl", clause(33))),
407
407
  bindings([binding("Sentence", command), binding("Count", 1), binding("Length", 5)]),
408
408
  uses([
409
409
  proof(
410
410
  goal(sentence(command, 5)),
411
- by(fact("chart-parser.pl", clause(3)))
411
+ by(fact("chart-parser.pl", clause(2)))
412
412
  ),
413
413
  proof(
414
414
  goal(countall(span(command, s, 0, 5), 1)),
@@ -421,7 +421,21 @@ why(
421
421
  chart_parser_answer(parse_count, count(ambiguous_pp, 1)).
422
422
  why(
423
423
  chart_parser_answer(parse_count, count(ambiguous_pp, 1)),
424
- no_proof
424
+ proof(
425
+ goal(chart_parser_answer(parse_count, count(ambiguous_pp, 1))),
426
+ by(rule("chart-parser.pl", clause(33))),
427
+ bindings([binding("Sentence", ambiguous_pp), binding("Count", 1), binding("Length", 8)]),
428
+ uses([
429
+ proof(
430
+ goal(sentence(ambiguous_pp, 8)),
431
+ by(fact("chart-parser.pl", clause(3)))
432
+ ),
433
+ proof(
434
+ goal(countall(span(ambiguous_pp, s, 0, 8), 1)),
435
+ by(builtin(countall, 2))
436
+ )
437
+ ])
438
+ )
425
439
  ).
426
440
 
427
441
  chart_parser_answer(noun_phrase_count, count(command, 2)).
@@ -429,12 +443,12 @@ why(
429
443
  chart_parser_answer(noun_phrase_count, count(command, 2)),
430
444
  proof(
431
445
  goal(chart_parser_answer(noun_phrase_count, count(command, 2))),
432
- by(rule("chart-parser.pl", clause(35))),
446
+ by(rule("chart-parser.pl", clause(34))),
433
447
  bindings([binding("Sentence", command), binding("Count", 2), binding("Length", 5)]),
434
448
  uses([
435
449
  proof(
436
450
  goal(sentence(command, 5)),
437
- by(fact("chart-parser.pl", clause(3)))
451
+ by(fact("chart-parser.pl", clause(2)))
438
452
  ),
439
453
  proof(
440
454
  goal(countall(span(command, np, _start, _end), 2)),
@@ -448,20 +462,20 @@ why(
448
462
  )
449
463
  ).
450
464
 
451
- chart_parser_answer(noun_phrase_count, count(ambiguous_pp, 3)).
465
+ chart_parser_answer(noun_phrase_count, count(ambiguous_pp, 4)).
452
466
  why(
453
- chart_parser_answer(noun_phrase_count, count(ambiguous_pp, 3)),
467
+ chart_parser_answer(noun_phrase_count, count(ambiguous_pp, 4)),
454
468
  proof(
455
- goal(chart_parser_answer(noun_phrase_count, count(ambiguous_pp, 3))),
456
- by(rule("chart-parser.pl", clause(35))),
457
- bindings([binding("Sentence", ambiguous_pp), binding("Count", 3), binding("Length", 8)]),
469
+ goal(chart_parser_answer(noun_phrase_count, count(ambiguous_pp, 4))),
470
+ by(rule("chart-parser.pl", clause(34))),
471
+ bindings([binding("Sentence", ambiguous_pp), binding("Count", 4), binding("Length", 8)]),
458
472
  uses([
459
473
  proof(
460
474
  goal(sentence(ambiguous_pp, 8)),
461
- by(fact("chart-parser.pl", clause(4)))
475
+ by(fact("chart-parser.pl", clause(3)))
462
476
  ),
463
477
  proof(
464
- goal(countall(span(ambiguous_pp, np, _start, _end), 3)),
478
+ goal(countall(span(ambiguous_pp, np, _start, _end), 4)),
465
479
  by(builtin(countall, 2))
466
480
  ),
467
481
  proof(
@@ -3,12 +3,12 @@ why(
3
3
  answer(3, [[left, right], [left, center], [right, center], [left, right], [center, left], [center, right], [left, right]]),
4
4
  proof(
5
5
  goal(answer(3, [[left, right], [left, center], [right, center], [left, right], [center, left], [center, right], [left, right]])),
6
- by(rule("hanoi.pl", clause(5))),
6
+ by(rule("hanoi.pl", clause(4))),
7
7
  bindings([binding("Moves", [[left, right], [left, center], [right, center], [left, right], [center, left], [center, right], [left, right]])]),
8
8
  uses([
9
9
  proof(
10
10
  goal(hanoi(3, left, right, center, [[left, right], [left, center], [right, center], [left, right], [center, left], [center, right], [left, right]])),
11
- by(rule("hanoi.pl", clause(4))),
11
+ by(rule("hanoi.pl", clause(3))),
12
12
  bindings([binding("N", 3), binding("From", left), binding("To", right), binding("Via", center), binding("Moves", [[left, right], [left, center], [right, center], [left, right], [center, left], [center, right], [left, right]]), binding("N1", 2), binding("Before", [[left, right], [left, center], [right, center]]), binding("After", [[center, left], [center, right], [left, right]])]),
13
13
  uses([
14
14
  proof(
@@ -21,7 +21,7 @@ why(
21
21
  ),
22
22
  proof(
23
23
  goal(hanoi(2, left, center, right, [[left, right], [left, center], [right, center]])),
24
- by(rule("hanoi.pl", clause(4))),
24
+ by(rule("hanoi.pl", clause(3))),
25
25
  bindings([binding("N", 2), binding("From", left), binding("To", center), binding("Via", right), binding("Moves", [[left, right], [left, center], [right, center]]), binding("N1", 1), binding("Before", [[left, right]]), binding("After", [[right, center]])]),
26
26
  uses([
27
27
  proof(
@@ -34,7 +34,7 @@ why(
34
34
  ),
35
35
  proof(
36
36
  goal(hanoi(1, left, right, center, [[left, right]])),
37
- by(rule("hanoi.pl", clause(4))),
37
+ by(rule("hanoi.pl", clause(3))),
38
38
  bindings([binding("N", 1), binding("From", left), binding("To", right), binding("Via", center), binding("Moves", [[left, right]]), binding("N1", 0), binding("Before", []), binding("After", [])]),
39
39
  uses([
40
40
  proof(
@@ -47,12 +47,12 @@ why(
47
47
  ),
48
48
  proof(
49
49
  goal(hanoi(0, left, center, right, [])),
50
- by(fact("hanoi.pl", clause(3))),
50
+ by(fact("hanoi.pl", clause(2))),
51
51
  bindings([binding("_from", left), binding("_to", center), binding("_via", right)])
52
52
  ),
53
53
  proof(
54
54
  goal(hanoi(0, center, right, left, [])),
55
- by(fact("hanoi.pl", clause(3))),
55
+ by(fact("hanoi.pl", clause(2))),
56
56
  bindings([binding("_from", center), binding("_to", right), binding("_via", left)])
57
57
  ),
58
58
  proof(
@@ -63,7 +63,7 @@ why(
63
63
  ),
64
64
  proof(
65
65
  goal(hanoi(1, right, center, left, [[right, center]])),
66
- by(rule("hanoi.pl", clause(4))),
66
+ by(rule("hanoi.pl", clause(3))),
67
67
  bindings([binding("N", 1), binding("From", right), binding("To", center), binding("Via", left), binding("Moves", [[right, center]]), binding("N1", 0), binding("Before", []), binding("After", [])]),
68
68
  uses([
69
69
  proof(
@@ -76,12 +76,12 @@ why(
76
76
  ),
77
77
  proof(
78
78
  goal(hanoi(0, right, left, center, [])),
79
- by(fact("hanoi.pl", clause(3))),
79
+ by(fact("hanoi.pl", clause(2))),
80
80
  bindings([binding("_from", right), binding("_to", left), binding("_via", center)])
81
81
  ),
82
82
  proof(
83
83
  goal(hanoi(0, left, center, right, [])),
84
- by(fact("hanoi.pl", clause(3))),
84
+ by(fact("hanoi.pl", clause(2))),
85
85
  bindings([binding("_from", left), binding("_to", center), binding("_via", right)])
86
86
  ),
87
87
  proof(
@@ -98,7 +98,7 @@ why(
98
98
  ),
99
99
  proof(
100
100
  goal(hanoi(2, center, right, left, [[center, left], [center, right], [left, right]])),
101
- by(rule("hanoi.pl", clause(4))),
101
+ by(rule("hanoi.pl", clause(3))),
102
102
  bindings([binding("N", 2), binding("From", center), binding("To", right), binding("Via", left), binding("Moves", [[center, left], [center, right], [left, right]]), binding("N1", 1), binding("Before", [[center, left]]), binding("After", [[left, right]])]),
103
103
  uses([
104
104
  proof(
@@ -111,7 +111,7 @@ why(
111
111
  ),
112
112
  proof(
113
113
  goal(hanoi(1, center, left, right, [[center, left]])),
114
- by(rule("hanoi.pl", clause(4))),
114
+ by(rule("hanoi.pl", clause(3))),
115
115
  bindings([binding("N", 1), binding("From", center), binding("To", left), binding("Via", right), binding("Moves", [[center, left]]), binding("N1", 0), binding("Before", []), binding("After", [])]),
116
116
  uses([
117
117
  proof(
@@ -124,12 +124,12 @@ why(
124
124
  ),
125
125
  proof(
126
126
  goal(hanoi(0, center, right, left, [])),
127
- by(fact("hanoi.pl", clause(3))),
127
+ by(fact("hanoi.pl", clause(2))),
128
128
  bindings([binding("_from", center), binding("_to", right), binding("_via", left)])
129
129
  ),
130
130
  proof(
131
131
  goal(hanoi(0, right, left, center, [])),
132
- by(fact("hanoi.pl", clause(3))),
132
+ by(fact("hanoi.pl", clause(2))),
133
133
  bindings([binding("_from", right), binding("_to", left), binding("_via", center)])
134
134
  ),
135
135
  proof(
@@ -140,7 +140,7 @@ why(
140
140
  ),
141
141
  proof(
142
142
  goal(hanoi(1, left, right, center, [[left, right]])),
143
- by(rule("hanoi.pl", clause(4))),
143
+ by(rule("hanoi.pl", clause(3))),
144
144
  bindings([binding("N", 1), binding("From", left), binding("To", right), binding("Via", center), binding("Moves", [[left, right]]), binding("N1", 0), binding("Before", []), binding("After", [])]),
145
145
  uses([
146
146
  proof(
@@ -153,12 +153,12 @@ why(
153
153
  ),
154
154
  proof(
155
155
  goal(hanoi(0, left, center, right, [])),
156
- by(fact("hanoi.pl", clause(3))),
156
+ by(fact("hanoi.pl", clause(2))),
157
157
  bindings([binding("_from", left), binding("_to", center), binding("_via", right)])
158
158
  ),
159
159
  proof(
160
160
  goal(hanoi(0, center, right, left, [])),
161
- by(fact("hanoi.pl", clause(3))),
161
+ by(fact("hanoi.pl", clause(2))),
162
162
  bindings([binding("_from", center), binding("_to", right), binding("_via", left)])
163
163
  ),
164
164
  proof(