eyeprolog 0.5.13 → 0.5.15

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 (124) hide show
  1. package/README.md +2 -0
  2. package/conformance-report.md +2 -2
  3. package/examples/auroracare.pl +26 -0
  4. package/examples/bmi.pl +20 -1
  5. package/examples/cdcl-sat-solver.pl +6 -6
  6. package/examples/composition-of-injective-functions-is-injective.pl +4 -1
  7. package/examples/deep-taxonomy-10.pl +2 -0
  8. package/examples/deep-taxonomy-100.pl +2 -0
  9. package/examples/deep-taxonomy-1000.pl +2 -0
  10. package/examples/deep-taxonomy-10000.pl +2 -0
  11. package/examples/exoplanet-validation-worlds.pl +3 -0
  12. package/examples/family-cousins.pl +2 -0
  13. package/examples/fastpow.pl +6 -6
  14. package/examples/flandor.pl +14 -0
  15. package/examples/gd-step-certified.pl +3 -0
  16. package/examples/group-inverse-uniqueness.pl +9 -9
  17. package/examples/illegitimate-reasoning.pl +6 -0
  18. package/examples/input/odrl-dpv-fpv-trust-flow-rules.pl +3 -9
  19. package/examples/list-collection.pl +6 -6
  20. package/examples/lldm.pl +2 -0
  21. package/examples/odrl-dpv-fpv-trust-flow.pl +3 -9
  22. package/examples/output/aliases-and-namespaces.pl +1 -1
  23. package/examples/output/bmi.pl +9 -0
  24. package/examples/output/dijkstra-findall-sort.pl +1 -1
  25. package/examples/output/dijkstra.pl +16 -16
  26. package/examples/output/drone-corridor-planner.pl +17 -17
  27. package/examples/output/iso-atomic-conversion.pl +1 -1
  28. package/examples/output/list-collection.pl +6 -6
  29. package/examples/pointer-analysis.pl +3 -0
  30. package/examples/proof/aliases-and-namespaces.pl +5 -5
  31. package/examples/proof/composition-of-injective-functions-is-injective.pl +80 -97
  32. package/examples/proof/graph-reachability.pl +22 -22
  33. package/examples/proof/group-inverse-uniqueness.pl +4 -4
  34. package/examples/proof/list-collection.pl +73 -29
  35. package/examples/proof/spacecraft-battery-diagnosis.pl +8 -8
  36. package/examples/proof/term-tools.pl +1 -1
  37. package/examples/relational-cube-lookup.pl +2002 -2000
  38. package/examples/riemann-hypothesis.pl +5 -0
  39. package/examples/spacecraft-battery-diagnosis.pl +8 -8
  40. package/examples/vulnerability-impact.pl +4 -0
  41. package/index.d.ts +5 -2
  42. package/package.json +1 -1
  43. package/src/cli.js +17 -9
  44. package/src/index.js +15 -5
  45. package/src/iso.js +1 -0
  46. package/src/parser.js +57 -12
  47. package/src/program.js +8 -5
  48. package/src/solver.js +11 -3
  49. package/src/term.js +41 -10
  50. package/src/write.js +6 -0
  51. package/test/conformance/README.md +1 -1
  52. package/test/conformance/cases/arithmetic/082_comparison_semantics.pl +2 -2
  53. package/test/conformance/cases/arithmetic/extra_le_equal_string.pl +1 -1
  54. package/test/conformance/cases/context/extra_context_ignores_string_parts.pl +1 -1
  55. package/test/conformance/cases/iso/double_quoted_lists.pl +27 -0
  56. package/test/conformance/cases/strings/023_quoted_escapes_readback.pl +2 -3
  57. package/test/conformance/cases/terms/003_terms_and_readback.pl +1 -1
  58. package/test/conformance/cases/terms/073_term_introspection_edges.pl +1 -1
  59. package/test/conformance/cases/terms/096_functor_scalar_edges.pl +2 -2
  60. package/test/conformance/cases/terms/extra_functor_string_scalar.pl +1 -1
  61. package/test/conformance/cases/terms/functor_number_and_string.pl +1 -1
  62. package/test/conformance/cases/unification/extra_eq_scalar_string_number.pl +1 -1
  63. package/test/conformance/cases/unification/scalar_cross_type_same_lexical_value.pl +2 -2
  64. package/test/conformance/expected/aggregation/044_findall_user_goal.pl +1 -1
  65. package/test/conformance/expected/arithmetic/082_comparison_semantics.pl +1 -1
  66. package/test/conformance/expected/arithmetic/extra_le_equal_string.pl +1 -1
  67. package/test/conformance/expected/context/extra_context_atom_parts.pl +1 -1
  68. package/test/conformance/expected/context/extra_context_ignores_string_parts.pl +1 -0
  69. package/test/conformance/expected/context/extra_context_list_parts.pl +1 -1
  70. package/test/conformance/expected/iso/atomic_term_processing.pl +1 -1
  71. package/test/conformance/expected/iso/double_quoted_lists.pl +8 -0
  72. package/test/conformance/expected/iso/exceptions_and_flags.pl +1 -1
  73. package/test/conformance/expected/iso/grouped_solutions_and_clauses.pl +1 -1
  74. package/test/conformance/expected/iso/logtalk_atom_chars.pl +1 -1
  75. package/test/conformance/expected/iso/logtalk_number_chars.pl +1 -1
  76. package/test/conformance/expected/iso/logtalk_prolog_flags.pl +1 -1
  77. package/test/conformance/expected/iso/logtalk_univ.pl +1 -1
  78. package/test/conformance/expected/iso/scryer_lexical_terms.pl +1 -1
  79. package/test/conformance/expected/lists/005_list_deconstruction.pl +1 -1
  80. package/test/conformance/expected/lists/031_lists_aggregation_ordering.pl +4 -4
  81. package/test/conformance/expected/lists/035_list_relations.pl +3 -3
  82. package/test/conformance/expected/lists/036_append_splits.pl +3 -3
  83. package/test/conformance/expected/lists/045_sort_deduplicates_atoms.pl +1 -1
  84. package/test/conformance/expected/lists/046_append_bound_prefix_suffix.pl +2 -2
  85. package/test/conformance/expected/lists/048_set_nth0_edges.pl +2 -2
  86. package/test/conformance/expected/lists/049_select_duplicate_occurrences.pl +2 -2
  87. package/test/conformance/expected/lists/067_list_edges.pl +1 -1
  88. package/test/conformance/expected/lists/068_list_generation_order.pl +6 -6
  89. package/test/conformance/expected/lists/084_append_and_select_composition.pl +9 -9
  90. package/test/conformance/expected/lists/085_nth_and_update_edges.pl +1 -1
  91. package/test/conformance/expected/lists/087_sort_reverse_length.pl +2 -2
  92. package/test/conformance/expected/lists/extra_append_all_splits_three.pl +4 -4
  93. package/test/conformance/expected/lists/extra_list_to_set_stable_order.pl +1 -1
  94. package/test/conformance/expected/lists/extra_reverse_nested_terms.pl +1 -1
  95. package/test/conformance/expected/lists/extra_slice_end.pl +1 -1
  96. package/test/conformance/expected/lists/extra_take_all.pl +1 -1
  97. package/test/conformance/expected/lists/list_pattern_last.pl +1 -1
  98. package/test/conformance/expected/lists/select_all_occurrences.pl +3 -3
  99. package/test/conformance/expected/lists/set_nth0_middle.pl +1 -1
  100. package/test/conformance/expected/rules/077_recursive_path_with_lists.pl +3 -3
  101. package/test/conformance/expected/strings/023_quoted_escapes_readback.pl +1 -1
  102. package/test/conformance/expected/strings/071_string_edges.pl +1 -1
  103. package/test/conformance/expected/strings/extra_split_empty_separator.pl +1 -1
  104. package/test/conformance/expected/terms/003_terms_and_readback.pl +3 -3
  105. package/test/conformance/expected/terms/065_reusable_term_control_builtins.pl +1 -1
  106. package/test/conformance/expected/terms/073_term_introspection_edges.pl +2 -2
  107. package/test/conformance/expected/terms/095_term_introspection_roundtrip.pl +1 -1
  108. package/test/conformance/expected/terms/096_functor_scalar_edges.pl +1 -1
  109. package/test/conformance/expected/terms/extra_compound_name_arguments_decompose_list.pl +1 -1
  110. package/test/conformance/expected/terms/extra_functor_string_scalar.pl +1 -1
  111. package/test/conformance/expected/terms/functor_number_and_string.pl +1 -1
  112. package/test/conformance/expected/unification/012_nested_compound_unification.pl +1 -1
  113. package/test/conformance/expected/unification/034_equality_and_inequality.pl +1 -1
  114. package/test/conformance/expected/unification/extra_eq_list_tail_binding.pl +1 -1
  115. package/test/conformance/expected/unification/list_tail_binding.pl +1 -1
  116. package/test/conformance/expected-proofs/proofs/bindings_nested_term.pl +5 -5
  117. package/test/conformance/expected-proofs/proofs/extra_compound_name_arguments.pl +4 -4
  118. package/test/conformance/expected-proofs/proofs/extra_findall_builtin.pl +5 -5
  119. package/test/conformance/expected-proofs/proofs/extra_nested_list_binding.pl +5 -5
  120. package/test/conformance/expected-proofs/proofs/extra_once_member.pl +2 -2
  121. package/test/conformance/expected-proofs/proofs/list_builtin.pl +1 -1
  122. package/test/run-playground.mjs +2 -2
  123. package/test/run-regression.mjs +69 -11
  124. package/the-art-of-eyeprolog.md +297 -38
@@ -3,113 +3,110 @@ why(
3
3
  sameInputByCompositeInjectivity(h, a, b),
4
4
  proof(
5
5
  goal(sameInputByCompositeInjectivity(h, a, b)),
6
- by(rule("composition-of-injective-functions-is-injective.pl", clause(19))),
6
+ by(rule("composition-of-injective-functions-is-injective.pl", clause(21))),
7
7
  bindings([binding("H", h), binding("X", a), binding("Y", b), binding("G", g), binding("F", f), binding("Z", e)]),
8
8
  uses([
9
9
  proof(
10
10
  goal(compositeOf(h, g, f)),
11
- by(fact("composition-of-injective-functions-is-injective.pl", clause(16)))
11
+ by(fact("composition-of-injective-functions-is-injective.pl", clause(18)))
12
12
  ),
13
13
  proof(
14
14
  goal(injective(g)),
15
- by(fact("composition-of-injective-functions-is-injective.pl", clause(15)))
15
+ by(fact("composition-of-injective-functions-is-injective.pl", clause(17)))
16
16
  ),
17
17
  proof(
18
18
  goal(injective(f)),
19
- by(fact("composition-of-injective-functions-is-injective.pl", clause(14)))
19
+ by(fact("composition-of-injective-functions-is-injective.pl", clause(16)))
20
20
  ),
21
21
  proof(
22
22
  goal(app(h, a, e)),
23
- by(rule("composition-of-injective-functions-is-injective.pl", clause(17))),
23
+ by(rule("composition-of-injective-functions-is-injective.pl", clause(19))),
24
24
  bindings([binding("H", h), binding("X", a), binding("Z", e), binding("G", g), binding("F", f), binding("Y", c)]),
25
25
  uses([
26
26
  proof(
27
27
  goal(compositeOf(h, g, f)),
28
- by(fact("composition-of-injective-functions-is-injective.pl", clause(16)))
28
+ by(fact("composition-of-injective-functions-is-injective.pl", clause(18)))
29
29
  ),
30
30
  proof(
31
31
  goal(app(f, a, c)),
32
- by(fact("composition-of-injective-functions-is-injective.pl", clause(10)))
32
+ by(fact("composition-of-injective-functions-is-injective.pl", clause(12)))
33
33
  ),
34
34
  proof(
35
35
  goal(app(g, c, e)),
36
- by(fact("composition-of-injective-functions-is-injective.pl", clause(12)))
36
+ by(fact("composition-of-injective-functions-is-injective.pl", clause(14)))
37
37
  )
38
38
  ])
39
39
  ),
40
40
  proof(
41
41
  goal(app(h, b, e)),
42
- by(rule("composition-of-injective-functions-is-injective.pl", clause(17))),
42
+ by(rule("composition-of-injective-functions-is-injective.pl", clause(19))),
43
43
  bindings([binding("H", h), binding("X", b), binding("Z", e), binding("G", g), binding("F", f), binding("Y", d)]),
44
44
  uses([
45
45
  proof(
46
46
  goal(compositeOf(h, g, f)),
47
- by(fact("composition-of-injective-functions-is-injective.pl", clause(16)))
47
+ by(fact("composition-of-injective-functions-is-injective.pl", clause(18)))
48
48
  ),
49
49
  proof(
50
50
  goal(app(f, b, d)),
51
- by(fact("composition-of-injective-functions-is-injective.pl", clause(11)))
51
+ by(fact("composition-of-injective-functions-is-injective.pl", clause(13)))
52
52
  ),
53
53
  proof(
54
54
  goal(app(g, d, e)),
55
- by(fact("composition-of-injective-functions-is-injective.pl", clause(13)))
55
+ by(fact("composition-of-injective-functions-is-injective.pl", clause(15)))
56
56
  )
57
57
  ])
58
58
  ),
59
59
  proof(
60
60
  goal(sameTerm(a, b)),
61
- by(rule("composition-of-injective-functions-is-injective.pl", clause(9))),
61
+ by(rule("composition-of-injective-functions-is-injective.pl", clause(11))),
62
62
  bindings([binding("Y", a), binding("X", b)]),
63
63
  uses([
64
+ proof(
65
+ goal(@<(a, b)),
66
+ by(builtin(@<, 2))
67
+ ),
64
68
  proof(
65
69
  goal(sameTerm(b, a)),
66
- by(rule("composition-of-injective-functions-is-injective.pl", clause(18))),
70
+ by(rule("composition-of-injective-functions-is-injective.pl", clause(20))),
67
71
  bindings([binding("X", b), binding("Y", a), binding("F", f), binding("U", d), binding("V", c)]),
68
72
  uses([
69
73
  proof(
70
74
  goal(injective(f)),
71
- by(fact("composition-of-injective-functions-is-injective.pl", clause(14)))
75
+ by(fact("composition-of-injective-functions-is-injective.pl", clause(16)))
72
76
  ),
73
77
  proof(
74
78
  goal(app(f, b, d)),
75
- by(fact("composition-of-injective-functions-is-injective.pl", clause(11)))
79
+ by(fact("composition-of-injective-functions-is-injective.pl", clause(13)))
76
80
  ),
77
81
  proof(
78
82
  goal(app(f, a, c)),
79
- by(fact("composition-of-injective-functions-is-injective.pl", clause(10)))
83
+ by(fact("composition-of-injective-functions-is-injective.pl", clause(12)))
80
84
  ),
81
85
  proof(
82
86
  goal(sameTerm(d, c)),
83
- by(rule("composition-of-injective-functions-is-injective.pl", clause(9))),
84
- bindings([binding("Y", d), binding("X", c)]),
87
+ by(rule("composition-of-injective-functions-is-injective.pl", clause(20))),
88
+ bindings([binding("X", d), binding("Y", c), binding("F", g), binding("U", e), binding("V", e)]),
85
89
  uses([
86
90
  proof(
87
- goal(sameTerm(c, d)),
88
- by(rule("composition-of-injective-functions-is-injective.pl", clause(18))),
89
- bindings([binding("X", c), binding("Y", d), binding("F", g), binding("U", e), binding("V", e)]),
91
+ goal(injective(g)),
92
+ by(fact("composition-of-injective-functions-is-injective.pl", clause(17)))
93
+ ),
94
+ proof(
95
+ goal(app(g, d, e)),
96
+ by(fact("composition-of-injective-functions-is-injective.pl", clause(15)))
97
+ ),
98
+ proof(
99
+ goal(app(g, c, e)),
100
+ by(fact("composition-of-injective-functions-is-injective.pl", clause(14)))
101
+ ),
102
+ proof(
103
+ goal(sameTerm(e, e)),
104
+ by(rule("composition-of-injective-functions-is-injective.pl", clause(10))),
105
+ bindings([binding("X", e)]),
90
106
  uses([
91
107
  proof(
92
- goal(injective(g)),
93
- by(fact("composition-of-injective-functions-is-injective.pl", clause(15)))
94
- ),
95
- proof(
96
- goal(app(g, c, e)),
97
- by(fact("composition-of-injective-functions-is-injective.pl", clause(12)))
98
- ),
99
- proof(
100
- goal(app(g, d, e)),
101
- by(fact("composition-of-injective-functions-is-injective.pl", clause(13)))
102
- ),
103
- proof(
104
- goal(sameTerm(e, e)),
105
- by(rule("composition-of-injective-functions-is-injective.pl", clause(8))),
106
- bindings([binding("X", e)]),
107
- uses([
108
- proof(
109
- goal(inZ(e)),
110
- by(fact("composition-of-injective-functions-is-injective.pl", clause(5)))
111
- )
112
- ])
108
+ goal(inZ(e)),
109
+ by(fact("composition-of-injective-functions-is-injective.pl", clause(7)))
113
110
  )
114
111
  ])
115
112
  )
@@ -132,115 +129,101 @@ why(
132
129
  sameInputByCompositeInjectivity(h, b, a),
133
130
  proof(
134
131
  goal(sameInputByCompositeInjectivity(h, b, a)),
135
- by(rule("composition-of-injective-functions-is-injective.pl", clause(19))),
132
+ by(rule("composition-of-injective-functions-is-injective.pl", clause(21))),
136
133
  bindings([binding("H", h), binding("X", b), binding("Y", a), binding("G", g), binding("F", f), binding("Z", e)]),
137
134
  uses([
138
135
  proof(
139
136
  goal(compositeOf(h, g, f)),
140
- by(fact("composition-of-injective-functions-is-injective.pl", clause(16)))
137
+ by(fact("composition-of-injective-functions-is-injective.pl", clause(18)))
141
138
  ),
142
139
  proof(
143
140
  goal(injective(g)),
144
- by(fact("composition-of-injective-functions-is-injective.pl", clause(15)))
141
+ by(fact("composition-of-injective-functions-is-injective.pl", clause(17)))
145
142
  ),
146
143
  proof(
147
144
  goal(injective(f)),
148
- by(fact("composition-of-injective-functions-is-injective.pl", clause(14)))
145
+ by(fact("composition-of-injective-functions-is-injective.pl", clause(16)))
149
146
  ),
150
147
  proof(
151
148
  goal(app(h, b, e)),
152
- by(rule("composition-of-injective-functions-is-injective.pl", clause(17))),
149
+ by(rule("composition-of-injective-functions-is-injective.pl", clause(19))),
153
150
  bindings([binding("H", h), binding("X", b), binding("Z", e), binding("G", g), binding("F", f), binding("Y", d)]),
154
151
  uses([
155
152
  proof(
156
153
  goal(compositeOf(h, g, f)),
157
- by(fact("composition-of-injective-functions-is-injective.pl", clause(16)))
154
+ by(fact("composition-of-injective-functions-is-injective.pl", clause(18)))
158
155
  ),
159
156
  proof(
160
157
  goal(app(f, b, d)),
161
- by(fact("composition-of-injective-functions-is-injective.pl", clause(11)))
158
+ by(fact("composition-of-injective-functions-is-injective.pl", clause(13)))
162
159
  ),
163
160
  proof(
164
161
  goal(app(g, d, e)),
165
- by(fact("composition-of-injective-functions-is-injective.pl", clause(13)))
162
+ by(fact("composition-of-injective-functions-is-injective.pl", clause(15)))
166
163
  )
167
164
  ])
168
165
  ),
169
166
  proof(
170
167
  goal(app(h, a, e)),
171
- by(rule("composition-of-injective-functions-is-injective.pl", clause(17))),
168
+ by(rule("composition-of-injective-functions-is-injective.pl", clause(19))),
172
169
  bindings([binding("H", h), binding("X", a), binding("Z", e), binding("G", g), binding("F", f), binding("Y", c)]),
173
170
  uses([
174
171
  proof(
175
172
  goal(compositeOf(h, g, f)),
176
- by(fact("composition-of-injective-functions-is-injective.pl", clause(16)))
173
+ by(fact("composition-of-injective-functions-is-injective.pl", clause(18)))
177
174
  ),
178
175
  proof(
179
176
  goal(app(f, a, c)),
180
- by(fact("composition-of-injective-functions-is-injective.pl", clause(10)))
177
+ by(fact("composition-of-injective-functions-is-injective.pl", clause(12)))
181
178
  ),
182
179
  proof(
183
180
  goal(app(g, c, e)),
184
- by(fact("composition-of-injective-functions-is-injective.pl", clause(12)))
181
+ by(fact("composition-of-injective-functions-is-injective.pl", clause(14)))
185
182
  )
186
183
  ])
187
184
  ),
188
185
  proof(
189
186
  goal(sameTerm(b, a)),
190
- by(rule("composition-of-injective-functions-is-injective.pl", clause(9))),
191
- bindings([binding("Y", b), binding("X", a)]),
187
+ by(rule("composition-of-injective-functions-is-injective.pl", clause(20))),
188
+ bindings([binding("X", b), binding("Y", a), binding("F", f), binding("U", d), binding("V", c)]),
192
189
  uses([
193
190
  proof(
194
- goal(sameTerm(a, b)),
195
- by(rule("composition-of-injective-functions-is-injective.pl", clause(18))),
196
- bindings([binding("X", a), binding("Y", b), binding("F", f), binding("U", c), binding("V", d)]),
191
+ goal(injective(f)),
192
+ by(fact("composition-of-injective-functions-is-injective.pl", clause(16)))
193
+ ),
194
+ proof(
195
+ goal(app(f, b, d)),
196
+ by(fact("composition-of-injective-functions-is-injective.pl", clause(13)))
197
+ ),
198
+ proof(
199
+ goal(app(f, a, c)),
200
+ by(fact("composition-of-injective-functions-is-injective.pl", clause(12)))
201
+ ),
202
+ proof(
203
+ goal(sameTerm(d, c)),
204
+ by(rule("composition-of-injective-functions-is-injective.pl", clause(20))),
205
+ bindings([binding("X", d), binding("Y", c), binding("F", g), binding("U", e), binding("V", e)]),
197
206
  uses([
198
207
  proof(
199
- goal(injective(f)),
200
- by(fact("composition-of-injective-functions-is-injective.pl", clause(14)))
208
+ goal(injective(g)),
209
+ by(fact("composition-of-injective-functions-is-injective.pl", clause(17)))
201
210
  ),
202
211
  proof(
203
- goal(app(f, a, c)),
204
- by(fact("composition-of-injective-functions-is-injective.pl", clause(10)))
212
+ goal(app(g, d, e)),
213
+ by(fact("composition-of-injective-functions-is-injective.pl", clause(15)))
205
214
  ),
206
215
  proof(
207
- goal(app(f, b, d)),
208
- by(fact("composition-of-injective-functions-is-injective.pl", clause(11)))
216
+ goal(app(g, c, e)),
217
+ by(fact("composition-of-injective-functions-is-injective.pl", clause(14)))
209
218
  ),
210
219
  proof(
211
- goal(sameTerm(c, d)),
212
- by(rule("composition-of-injective-functions-is-injective.pl", clause(9))),
213
- bindings([binding("Y", c), binding("X", d)]),
220
+ goal(sameTerm(e, e)),
221
+ by(rule("composition-of-injective-functions-is-injective.pl", clause(10))),
222
+ bindings([binding("X", e)]),
214
223
  uses([
215
224
  proof(
216
- goal(sameTerm(d, c)),
217
- by(rule("composition-of-injective-functions-is-injective.pl", clause(18))),
218
- bindings([binding("X", d), binding("Y", c), binding("F", g), binding("U", e), binding("V", e)]),
219
- uses([
220
- proof(
221
- goal(injective(g)),
222
- by(fact("composition-of-injective-functions-is-injective.pl", clause(15)))
223
- ),
224
- proof(
225
- goal(app(g, d, e)),
226
- by(fact("composition-of-injective-functions-is-injective.pl", clause(13)))
227
- ),
228
- proof(
229
- goal(app(g, c, e)),
230
- by(fact("composition-of-injective-functions-is-injective.pl", clause(12)))
231
- ),
232
- proof(
233
- goal(sameTerm(e, e)),
234
- by(rule("composition-of-injective-functions-is-injective.pl", clause(8))),
235
- bindings([binding("X", e)]),
236
- uses([
237
- proof(
238
- goal(inZ(e)),
239
- by(fact("composition-of-injective-functions-is-injective.pl", clause(5)))
240
- )
241
- ])
242
- )
243
- ])
225
+ goal(inZ(e)),
226
+ by(fact("composition-of-injective-functions-is-injective.pl", clause(7)))
244
227
  )
245
228
  ])
246
229
  )
@@ -11,48 +11,48 @@ why(
11
11
  bindings([binding("Start", a), binding("Goal", f)]),
12
12
  uses([
13
13
  proof(
14
- goal(reachable(a, f, [a])),
14
+ goal(reachable(a, f, "a")),
15
15
  by(rule("graph-reachability.pl", clause(9))),
16
- bindings([binding("Start", a), binding("Goal", f), binding("Visited", [a]), binding("Next", b)]),
16
+ bindings([binding("Start", a), binding("Goal", f), binding("Visited", "a"), binding("Next", b)]),
17
17
  uses([
18
18
  proof(
19
19
  goal(edge(a, b)),
20
20
  by(fact("graph-reachability.pl", clause(1)))
21
21
  ),
22
22
  proof(
23
- goal('\\+'(member(b, [a]))),
23
+ goal('\\+'(member(b, "a"))),
24
24
  by(builtin('\\+', 1))
25
25
  ),
26
26
  proof(
27
- goal(reachable(b, f, [b, a])),
27
+ goal(reachable(b, f, "ba")),
28
28
  by(rule("graph-reachability.pl", clause(9))),
29
- bindings([binding("Start", b), binding("Goal", f), binding("Visited", [b, a]), binding("Next", d)]),
29
+ bindings([binding("Start", b), binding("Goal", f), binding("Visited", "ba"), binding("Next", d)]),
30
30
  uses([
31
31
  proof(
32
32
  goal(edge(b, d)),
33
33
  by(fact("graph-reachability.pl", clause(3)))
34
34
  ),
35
35
  proof(
36
- goal('\\+'(member(d, [b, a]))),
36
+ goal('\\+'(member(d, "ba"))),
37
37
  by(builtin('\\+', 1))
38
38
  ),
39
39
  proof(
40
- goal(reachable(d, f, [d, b, a])),
40
+ goal(reachable(d, f, "dba")),
41
41
  by(rule("graph-reachability.pl", clause(9))),
42
- bindings([binding("Start", d), binding("Goal", f), binding("Visited", [d, b, a]), binding("Next", f)]),
42
+ bindings([binding("Start", d), binding("Goal", f), binding("Visited", "dba"), binding("Next", f)]),
43
43
  uses([
44
44
  proof(
45
45
  goal(edge(d, f)),
46
46
  by(fact("graph-reachability.pl", clause(5)))
47
47
  ),
48
48
  proof(
49
- goal('\\+'(member(f, [d, b, a]))),
49
+ goal('\\+'(member(f, "dba"))),
50
50
  by(builtin('\\+', 1))
51
51
  ),
52
52
  proof(
53
- goal(reachable(f, f, [f, d, b, a])),
53
+ goal(reachable(f, f, "fdba")),
54
54
  by(fact("graph-reachability.pl", clause(8))),
55
- bindings([binding("Node", f), binding("_visited", [f, d, b, a])])
55
+ bindings([binding("Node", f), binding("_visited", "fdba")])
56
56
  )
57
57
  ])
58
58
  )
@@ -79,48 +79,48 @@ why(
79
79
  bindings([binding("Start", c), binding("Goal", g)]),
80
80
  uses([
81
81
  proof(
82
- goal(reachable(c, g, [c])),
82
+ goal(reachable(c, g, "c")),
83
83
  by(rule("graph-reachability.pl", clause(9))),
84
- bindings([binding("Start", c), binding("Goal", g), binding("Visited", [c]), binding("Next", e)]),
84
+ bindings([binding("Start", c), binding("Goal", g), binding("Visited", "c"), binding("Next", e)]),
85
85
  uses([
86
86
  proof(
87
87
  goal(edge(c, e)),
88
88
  by(fact("graph-reachability.pl", clause(4)))
89
89
  ),
90
90
  proof(
91
- goal('\\+'(member(e, [c]))),
91
+ goal('\\+'(member(e, "c"))),
92
92
  by(builtin('\\+', 1))
93
93
  ),
94
94
  proof(
95
- goal(reachable(e, g, [e, c])),
95
+ goal(reachable(e, g, "ec")),
96
96
  by(rule("graph-reachability.pl", clause(9))),
97
- bindings([binding("Start", e), binding("Goal", g), binding("Visited", [e, c]), binding("Next", f)]),
97
+ bindings([binding("Start", e), binding("Goal", g), binding("Visited", "ec"), binding("Next", f)]),
98
98
  uses([
99
99
  proof(
100
100
  goal(edge(e, f)),
101
101
  by(fact("graph-reachability.pl", clause(6)))
102
102
  ),
103
103
  proof(
104
- goal('\\+'(member(f, [e, c]))),
104
+ goal('\\+'(member(f, "ec"))),
105
105
  by(builtin('\\+', 1))
106
106
  ),
107
107
  proof(
108
- goal(reachable(f, g, [f, e, c])),
108
+ goal(reachable(f, g, "fec")),
109
109
  by(rule("graph-reachability.pl", clause(9))),
110
- bindings([binding("Start", f), binding("Goal", g), binding("Visited", [f, e, c]), binding("Next", g)]),
110
+ bindings([binding("Start", f), binding("Goal", g), binding("Visited", "fec"), binding("Next", g)]),
111
111
  uses([
112
112
  proof(
113
113
  goal(edge(f, g)),
114
114
  by(fact("graph-reachability.pl", clause(7)))
115
115
  ),
116
116
  proof(
117
- goal('\\+'(member(g, [f, e, c]))),
117
+ goal('\\+'(member(g, "fec"))),
118
118
  by(builtin('\\+', 1))
119
119
  ),
120
120
  proof(
121
- goal(reachable(g, g, [g, f, e, c])),
121
+ goal(reachable(g, g, "gfec")),
122
122
  by(fact("graph-reachability.pl", clause(8))),
123
- bindings([binding("Node", g), binding("_visited", [g, f, e, c])])
123
+ bindings([binding("Node", g), binding("_visited", "gfec")])
124
124
  )
125
125
  ])
126
126
  )
@@ -12,7 +12,7 @@ why(
12
12
  bindings([binding("A", x), binding("B", i)]),
13
13
  uses([
14
14
  proof(
15
- goal(op(i, x, e)),
15
+ goal(group_op(i, x, e)),
16
16
  by(fact("group-inverse-uniqueness.pl", clause(7)))
17
17
  )
18
18
  ])
@@ -23,7 +23,7 @@ why(
23
23
  bindings([binding("A", x), binding("B", j)]),
24
24
  uses([
25
25
  proof(
26
- goal(op(x, j, e)),
26
+ goal(group_op(x, j, e)),
27
27
  by(fact("group-inverse-uniqueness.pl", clause(8)))
28
28
  )
29
29
  ])
@@ -54,7 +54,7 @@ why(
54
54
  bindings([binding("A", x), binding("B", j)]),
55
55
  uses([
56
56
  proof(
57
- goal(op(j, x, e)),
57
+ goal(group_op(j, x, e)),
58
58
  by(fact("group-inverse-uniqueness.pl", clause(9)))
59
59
  )
60
60
  ])
@@ -65,7 +65,7 @@ why(
65
65
  bindings([binding("A", x), binding("B", i)]),
66
66
  uses([
67
67
  proof(
68
- goal(op(x, i, e)),
68
+ goal(group_op(x, i, e)),
69
69
  by(fact("group-inverse-uniqueness.pl", clause(10)))
70
70
  )
71
71
  ])
@@ -1,53 +1,97 @@
1
- length(numbers, 3).
1
+ collectionLength(numbers, 3).
2
2
  why(
3
- length(numbers, 3),
3
+ collectionLength(numbers, 3),
4
4
  proof(
5
- goal(length(numbers, 3)),
6
- by(library(length, 2))
5
+ goal(collectionLength(numbers, 3)),
6
+ by(rule("list-collection.pl", clause(3))),
7
+ bindings([binding("N", 3), binding("List", [1, 2, 3])]),
8
+ uses([
9
+ proof(
10
+ goal(collection(numbers, [1, 2, 3])),
11
+ by(fact("list-collection.pl", clause(1)))
12
+ ),
13
+ proof(
14
+ goal(length([1, 2, 3], 3)),
15
+ by(library(length, 2))
16
+ )
17
+ ])
7
18
  )
8
19
  ).
9
20
 
10
- member(numbers, 1).
21
+ collectionMember(numbers, 1).
11
22
  why(
12
- member(numbers, 1),
23
+ collectionMember(numbers, 1),
13
24
  proof(
14
- goal(member(numbers, 1)),
15
- by(library(member, 2))
25
+ goal(collectionMember(numbers, 1)),
26
+ by(rule("list-collection.pl", clause(4))),
27
+ bindings([binding("X", 1), binding("List", [1, 2, 3])]),
28
+ uses([
29
+ proof(
30
+ goal(collection(numbers, [1, 2, 3])),
31
+ by(fact("list-collection.pl", clause(1)))
32
+ ),
33
+ proof(
34
+ goal(member(1, [1, 2, 3])),
35
+ by(library(member, 2))
36
+ )
37
+ ])
16
38
  )
17
39
  ).
18
40
 
19
- member(numbers, 2).
41
+ collectionMember(numbers, 2).
20
42
  why(
21
- member(numbers, 2),
43
+ collectionMember(numbers, 2),
22
44
  proof(
23
- goal(member(numbers, 2)),
24
- by(library(member, 2))
45
+ goal(collectionMember(numbers, 2)),
46
+ by(rule("list-collection.pl", clause(4))),
47
+ bindings([binding("X", 2), binding("List", [1, 2, 3])]),
48
+ uses([
49
+ proof(
50
+ goal(collection(numbers, [1, 2, 3])),
51
+ by(fact("list-collection.pl", clause(1)))
52
+ ),
53
+ proof(
54
+ goal(member(2, [1, 2, 3])),
55
+ by(library(member, 2))
56
+ )
57
+ ])
25
58
  )
26
59
  ).
27
60
 
28
- member(numbers, 3).
61
+ collectionMember(numbers, 3).
29
62
  why(
30
- member(numbers, 3),
63
+ collectionMember(numbers, 3),
31
64
  proof(
32
- goal(member(numbers, 3)),
33
- by(library(member, 2))
65
+ goal(collectionMember(numbers, 3)),
66
+ by(rule("list-collection.pl", clause(4))),
67
+ bindings([binding("X", 3), binding("List", [1, 2, 3])]),
68
+ uses([
69
+ proof(
70
+ goal(collection(numbers, [1, 2, 3])),
71
+ by(fact("list-collection.pl", clause(1)))
72
+ ),
73
+ proof(
74
+ goal(member(3, [1, 2, 3])),
75
+ by(library(member, 2))
76
+ )
77
+ ])
34
78
  )
35
79
  ).
36
80
 
37
- append(letters, [a, b, c]).
81
+ collectionAppend(letters, "abc").
38
82
  why(
39
- append(letters, [a, b, c]),
83
+ collectionAppend(letters, "abc"),
40
84
  proof(
41
- goal(append(letters, [a, b, c])),
85
+ goal(collectionAppend(letters, "abc")),
42
86
  by(rule("list-collection.pl", clause(5))),
43
- bindings([binding("Extended", [a, b, c]), binding("List", [a, b])]),
87
+ bindings([binding("Extended", "abc"), binding("List", "ab")]),
44
88
  uses([
45
89
  proof(
46
- goal(collection(letters, [a, b])),
90
+ goal(collection(letters, "ab")),
47
91
  by(fact("list-collection.pl", clause(2)))
48
92
  ),
49
93
  proof(
50
- goal(append([a, b], [c], [a, b, c])),
94
+ goal(append("ab", "c", "abc")),
51
95
  by(library(append, 3))
52
96
  )
53
97
  ])
@@ -60,26 +104,26 @@ why(
60
104
  proof(
61
105
  goal(head(letters, a)),
62
106
  by(rule("list-collection.pl", clause(6))),
63
- bindings([binding("Head", a), binding("_tail", [b])]),
107
+ bindings([binding("Head", a), binding("_tail", "b")]),
64
108
  uses([
65
109
  proof(
66
- goal(collection(letters, [a, b])),
110
+ goal(collection(letters, "ab")),
67
111
  by(fact("list-collection.pl", clause(2)))
68
112
  )
69
113
  ])
70
114
  )
71
115
  ).
72
116
 
73
- tail(letters, [b]).
117
+ tail(letters, "b").
74
118
  why(
75
- tail(letters, [b]),
119
+ tail(letters, "b"),
76
120
  proof(
77
- goal(tail(letters, [b])),
121
+ goal(tail(letters, "b")),
78
122
  by(rule("list-collection.pl", clause(7))),
79
- bindings([binding("Tail", [b]), binding("_head", a)]),
123
+ bindings([binding("Tail", "b"), binding("_head", a)]),
80
124
  uses([
81
125
  proof(
82
- goal(collection(letters, [a, b])),
126
+ goal(collection(letters, "ab")),
83
127
  by(fact("list-collection.pl", clause(2)))
84
128
  )
85
129
  ])