eyelang 1.3.9 → 1.4.1

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 (215) hide show
  1. package/README.md +19 -14
  2. package/SPEC.md +4 -4
  3. package/conformance/expected/core/001_fact_query.out +0 -8
  4. package/conformance/expected/core/002_rule_recursion.out +0 -41
  5. package/conformance/expected/core/003_terms_and_readback.out +0 -104
  6. package/conformance/expected/core/004_conjunction_and_parentheses.out +0 -25
  7. package/conformance/expected/core/005_list_deconstruction.out +0 -32
  8. package/conformance/expected/core/006_comma_formula_data.out +0 -15
  9. package/conformance/expected/core/007_anonymous_variables.out +0 -19
  10. package/conformance/expected/core/008_graphic_atoms.out +0 -24
  11. package/conformance/expected/core/009_comments_and_whitespace.out +0 -30
  12. package/conformance/expected/core/010_variable_scope_and_reuse.out +0 -52
  13. package/conformance/expected/core/011_predicate_arity.out +0 -30
  14. package/conformance/expected/core/012_nested_compound_unification.out +0 -30
  15. package/conformance/expected/core/013_multiple_clauses_order.out +0 -44
  16. package/conformance/expected/core/014_failure_filters_answers.out +0 -19
  17. package/conformance/expected/core/015_improper_list_unification.out +0 -45
  18. package/conformance/expected/core/016_zero_arity_compound.out +0 -15
  19. package/conformance/expected/core/017_three_step_recursion.out +0 -99
  20. package/conformance/expected/core/018_quoted_atom_readback.out +0 -45
  21. package/conformance/expected/core/019_parenthesized_three_conjuncts.out +0 -36
  22. package/conformance/expected/core/020_nested_list_terms.out +0 -30
  23. package/conformance/expected/extension/001_default_derived_output.out +0 -56
  24. package/conformance/expected/extension/002_materialize_focus.out +0 -22
  25. package/conformance/expected/extension/003_arithmetic_and_comparison.out +0 -148
  26. package/conformance/expected/extension/004_strings_and_atoms.out +0 -58
  27. package/conformance/expected/extension/005_lists_aggregation_ordering.out +0 -135
  28. package/conformance/expected/extension/006_formula_terms.out +0 -76
  29. package/conformance/expected/extension/007_negation_once_generators.out +0 -40
  30. package/conformance/expected/extension/008_equality_and_inequality.out +0 -58
  31. package/conformance/expected/extension/009_list_relations.out +0 -73
  32. package/conformance/expected/extension/010_append_splits.out +0 -45
  33. package/conformance/expected/extension/011_matching_and_comparison.out +0 -70
  34. package/conformance/expected/extension/012_memoize_declaration.out +0 -41
  35. package/conformance/expected/extension/013_numeric_functions.out +0 -105
  36. package/conformance/expected/extension/014_between_enumeration.out +0 -45
  37. package/conformance/expected/extension/015_smallest_divisor.out +0 -15
  38. package/conformance/expected/extension/016_negation_filter.out +0 -38
  39. package/conformance/expected/extension/017_once_user_predicate.out +0 -21
  40. package/conformance/expected/extension/018_findall_user_goal.out +0 -15
  41. package/conformance/expected/extension/019_sort_deduplicates_atoms.out +0 -15
  42. package/conformance/expected/extension/020_append_bound_prefix_suffix.out +0 -30
  43. package/conformance/expected/extension/021_nth0_index_generation.out +0 -15
  44. package/conformance/expected/extension/022_set_nth0_edges.out +0 -30
  45. package/conformance/expected/extension/023_select_duplicate_occurrences.out +0 -30
  46. package/conformance/expected/extension/024_not_member_filter.out +0 -19
  47. package/conformance/expected/extension/025_is_list_filter.out +0 -19
  48. package/conformance/expected/extension/026_nested_formula_terms.out +0 -114
  49. package/conformance/expected/extension/027_materialize_excludes_source_fact.out +0 -14
  50. package/conformance/expected/extension/028_numeric_and_lexical_comparison.out +0 -42
  51. package/conformance/expected/extension/029_string_matching_filters.out +0 -38
  52. package/conformance/expected/extension/030_string_and_atom_concat.out +0 -30
  53. package/conformance/expected/extension/031_countall_empty_and_nonempty.out +0 -18
  54. package/conformance/expected/extension/032_sumall_numeric_template.out +0 -8
  55. package/conformance/expected/extension/033_aggregate_min_template.out +0 -8
  56. package/conformance/expected/extension/034_aggregate_max_compound_key.out +0 -8
  57. package/examples/output/access-control-policy.pl +0 -156
  58. package/examples/output/ackermann.pl +0 -1240
  59. package/examples/output/age.pl +0 -69
  60. package/examples/output/aliases-and-namespaces.pl +0 -73
  61. package/examples/output/alignment-demo.pl +0 -862
  62. package/examples/output/allen-interval-calculus.pl +0 -9169
  63. package/examples/output/ancestor.pl +0 -134
  64. package/examples/output/animal.pl +0 -64
  65. package/examples/output/annotation.pl +0 -76
  66. package/examples/output/backward.pl +0 -21
  67. package/examples/output/basic-monadic.pl +0 -22770
  68. package/examples/output/bayes-diagnosis.pl +0 -195
  69. package/examples/output/bayes-therapy.pl +0 -34873
  70. package/examples/output/beam-deflection.pl +0 -222
  71. package/examples/output/blocks-world-planning.pl +0 -1339
  72. package/examples/output/bmi.pl +0 -1903
  73. package/examples/output/braking-safety-worlds.pl +0 -2452
  74. package/examples/output/buck-converter-design.pl +0 -663
  75. package/examples/output/cache-performance.pl +0 -306
  76. package/examples/output/canary-release.pl +0 -167
  77. package/examples/output/cat-koko.pl +0 -83
  78. package/examples/output/clinical-trial-screening.pl +0 -380
  79. package/examples/output/collatz-1000.pl +0 -19000
  80. package/examples/output/combinatorics-findall-sort.pl +0 -56
  81. package/examples/output/competitive-enzyme-kinetics.pl +0 -563
  82. package/examples/output/complex-matrix-stability.pl +0 -250
  83. package/examples/output/complex.pl +0 -653
  84. package/examples/output/composition-of-injective-functions-is-injective.pl +0 -256
  85. package/examples/output/context-association.pl +0 -75
  86. package/examples/output/control-system.pl +0 -328
  87. package/examples/output/cryptarithmetic-send-more-money.pl +0 -168
  88. package/examples/output/cyclic-path.pl +0 -504
  89. package/examples/output/d3-group.pl +0 -56
  90. package/examples/output/dairy-energy-balance.pl +0 -1034
  91. package/examples/output/data-negotiation.pl +0 -75
  92. package/examples/output/deep-taxonomy-10.pl +0 -1235
  93. package/examples/output/deep-taxonomy-100.pl +0 -1235
  94. package/examples/output/deep-taxonomy-1000.pl +0 -1235
  95. package/examples/output/deep-taxonomy-10000.pl +0 -2915
  96. package/examples/output/deep-taxonomy-100000.pl +0 -20240
  97. package/examples/output/delfour.pl +0 -2829
  98. package/examples/output/dense-hamiltonian-cycle.pl +0 -207
  99. package/examples/output/deontic-logic.pl +0 -105
  100. package/examples/output/derived-rule.pl +0 -41
  101. package/examples/output/diamond-property.pl +0 -303
  102. package/examples/output/dijkstra-findall-sort.pl +0 -484
  103. package/examples/output/dijkstra-risk-path.pl +0 -4841
  104. package/examples/output/dijkstra.pl +0 -1336
  105. package/examples/output/dining-philosophers.pl +0 -21646
  106. package/examples/output/dog.pl +0 -30
  107. package/examples/output/drone-corridor-planner.pl +0 -2466
  108. package/examples/output/easter-computus.pl +0 -5690
  109. package/examples/output/electrical-rc-filter.pl +0 -102
  110. package/examples/output/epidemic-policy.pl +0 -760
  111. package/examples/output/equivalence-classes-overlap-implies-same-class.pl +0 -1080
  112. package/examples/output/eulerian-path.pl +0 -383
  113. package/examples/output/ev-range-worlds.pl +0 -2294
  114. package/examples/output/exact-cover-sudoku.pl +0 -396
  115. package/examples/output/existential-rule.pl +0 -38
  116. package/examples/output/exoplanet-validation-worlds.pl +0 -1904
  117. package/examples/output/expression-eval.pl +0 -104
  118. package/examples/output/family-cousins.pl +0 -3852
  119. package/examples/output/fastpow.pl +0 -1064
  120. package/examples/output/fft8-numeric.pl +0 -2556
  121. package/examples/output/fibonacci.pl +0 -2060
  122. package/examples/output/field-nitrogen-balance.pl +0 -1452
  123. package/examples/output/floating-point.pl +0 -151
  124. package/examples/output/four-color-map.pl +0 -191
  125. package/examples/output/fundamental-theorem-arithmetic.pl +0 -1610
  126. package/examples/output/gcd-bezout-identity.pl +0 -1842
  127. package/examples/output/gd-step-certified.pl +0 -32354
  128. package/examples/output/gdpr-compliance.pl +0 -193
  129. package/examples/output/goldbach-1000.pl +0 -17490
  130. package/examples/output/good-cobbler.pl +0 -15
  131. package/examples/output/gps.pl +0 -4166
  132. package/examples/output/graph-reachability.pl +0 -148
  133. package/examples/output/gray-code-counter.pl +0 -835
  134. package/examples/output/greatest-lower-bound-uniqueness.pl +0 -148
  135. package/examples/output/group-inverse-uniqueness.pl +0 -82
  136. package/examples/output/hamiltonian-cycle.pl +0 -102
  137. package/examples/output/hamiltonian-path.pl +0 -14157
  138. package/examples/output/hamming-code.pl +0 -2665
  139. package/examples/output/hanoi.pl +0 -184
  140. package/examples/output/heat-loss.pl +0 -223
  141. package/examples/output/heron-theorem.pl +0 -253
  142. package/examples/output/ideal-gas-law.pl +0 -148
  143. package/examples/output/illegitimate-reasoning.pl +0 -530
  144. package/examples/output/kaprekar.pl +0 -208
  145. package/examples/output/law-of-cosines.pl +0 -165
  146. package/examples/output/least-squares-regression.pl +0 -1447
  147. package/examples/output/list-collection.pl +0 -49
  148. package/examples/output/lldm.pl +0 -17298
  149. package/examples/output/manufacturing-quality-control.pl +0 -562
  150. package/examples/output/matrix.pl +0 -206
  151. package/examples/output/microgrid-dispatch.pl +0 -787
  152. package/examples/output/monkey-bananas.pl +0 -575
  153. package/examples/output/n-queens.pl +0 -2046
  154. package/examples/output/network-sla.pl +0 -282
  155. package/examples/output/newton-raphson.pl +0 -756
  156. package/examples/output/nixon-diamond.pl +0 -176
  157. package/examples/output/odrl-dpv-healthcare-risk-ranked.pl +0 -6148
  158. package/examples/output/odrl-dpv-risk-ranked.pl +0 -12961
  159. package/examples/output/orbital-transfer-design.pl +0 -961
  160. package/examples/output/path-discovery.pl +0 -333
  161. package/examples/output/peano-arithmetic.pl +0 -1432
  162. package/examples/output/peasant.pl +0 -190
  163. package/examples/output/pendulum-period.pl +0 -271
  164. package/examples/output/polynomial.pl +0 -7952
  165. package/examples/output/project-portfolio-optimization.pl +0 -93
  166. package/examples/output/proof-contrapositive.pl +0 -75
  167. package/examples/output/quadratic-formula.pl +0 -454
  168. package/examples/output/quine-mccluskey.pl +0 -188
  169. package/examples/output/radioactive-decay.pl +0 -299
  170. package/examples/output/sat-dpll.pl +0 -121
  171. package/examples/output/security-incident-correlation.pl +0 -267
  172. package/examples/output/service-impact.pl +0 -457
  173. package/examples/output/sieve.pl +0 -19
  174. package/examples/output/skolem-functions.pl +0 -264
  175. package/examples/output/socket-age.pl +0 -31
  176. package/examples/output/socket-family.pl +0 -56
  177. package/examples/output/socrates.pl +0 -36
  178. package/examples/output/statistics-summary.pl +0 -741
  179. package/examples/output/sudoku.pl +0 -38
  180. package/examples/output/superdense-coding.pl +0 -476
  181. package/examples/output/traveling-salesman.pl +0 -284
  182. package/examples/output/turing.pl +0 -2144
  183. package/examples/output/vector-similarity.pl +0 -421
  184. package/examples/output/witch.pl +0 -209
  185. package/examples/output/wolf-goat-cabbage.pl +0 -900
  186. package/examples/output/zebra.pl +0 -401
  187. package/examples/proof/age.pl +71 -0
  188. package/examples/proof/aliases-and-namespaces.pl +78 -0
  189. package/examples/proof/ancestor.pl +140 -0
  190. package/examples/proof/animal.pl +68 -0
  191. package/examples/proof/annotation.pl +80 -0
  192. package/examples/proof/backward.pl +22 -0
  193. package/examples/proof/cat-koko.pl +86 -0
  194. package/examples/proof/data-negotiation.pl +76 -0
  195. package/examples/proof/derived-rule.pl +43 -0
  196. package/examples/proof/dog.pl +31 -0
  197. package/examples/proof/electrical-rc-filter.pl +105 -0
  198. package/examples/proof/existential-rule.pl +40 -0
  199. package/examples/proof/floating-point.pl +160 -0
  200. package/examples/proof/good-cobbler.pl +16 -0
  201. package/examples/proof/group-inverse-uniqueness.pl +84 -0
  202. package/examples/proof/list-collection.pl +52 -0
  203. package/examples/proof/proof-contrapositive.pl +78 -0
  204. package/examples/proof/socket-age.pl +32 -0
  205. package/examples/proof/socket-family.pl +59 -0
  206. package/examples/proof/socrates.pl +38 -0
  207. package/package.json +1 -1
  208. package/playground-worker.mjs +4 -4
  209. package/playground.html +15 -15
  210. package/src/builtins/registry.js +7 -0
  211. package/src/cli.js +55 -35
  212. package/src/index.js +12 -9
  213. package/test/run-conformance.js +21 -44
  214. package/test/run-examples.js +69 -47
  215. package/test/run-regression.js +29 -37
@@ -1,144 +1,9 @@
1
1
  answer(member, a).
2
- why(
3
- answer(member, a),
4
- proof(
5
- goal(answer(member, a)),
6
- by(rule("005_lists_aggregation_ordering.pl", clause(1))),
7
- bindings([binding("X", a)]),
8
- uses([
9
- proof(
10
- goal(member(a, [a, b])),
11
- by(builtin(member, 2))
12
- )
13
- ])
14
- )
15
- ).
16
-
17
2
  answer(member, b).
18
- why(
19
- answer(member, b),
20
- proof(
21
- goal(answer(member, b)),
22
- by(rule("005_lists_aggregation_ordering.pl", clause(1))),
23
- bindings([binding("X", b)]),
24
- uses([
25
- proof(
26
- goal(member(b, [a, b])),
27
- by(builtin(member, 2))
28
- )
29
- ])
30
- )
31
- ).
32
-
33
3
  answer(append, [a, b, c]).
34
- why(
35
- answer(append, [a, b, c]),
36
- proof(
37
- goal(answer(append, [a, b, c])),
38
- by(rule("005_lists_aggregation_ordering.pl", clause(2))),
39
- bindings([binding("X", [a, b, c])]),
40
- uses([
41
- proof(
42
- goal(append([a], [b, c], [a, b, c])),
43
- by(builtin(append, 3))
44
- )
45
- ])
46
- )
47
- ).
48
-
49
4
  answer(nth0, b).
50
- why(
51
- answer(nth0, b),
52
- proof(
53
- goal(answer(nth0, b)),
54
- by(rule("005_lists_aggregation_ordering.pl", clause(3))),
55
- bindings([binding("X", b)]),
56
- uses([
57
- proof(
58
- goal(nth0(1, [a, b, c], b)),
59
- by(builtin(nth0, 3))
60
- )
61
- ])
62
- )
63
- ).
64
-
65
5
  answer(set_nth0, [a, x, c]).
66
- why(
67
- answer(set_nth0, [a, x, c]),
68
- proof(
69
- goal(answer(set_nth0, [a, x, c])),
70
- by(rule("005_lists_aggregation_ordering.pl", clause(4))),
71
- bindings([binding("X", [a, x, c])]),
72
- uses([
73
- proof(
74
- goal(set_nth0(1, [a, b, c], x, [a, x, c])),
75
- by(builtin(set_nth0, 4))
76
- )
77
- ])
78
- )
79
- ).
80
-
81
6
  answer(reverse, [c, b, a]).
82
- why(
83
- answer(reverse, [c, b, a]),
84
- proof(
85
- goal(answer(reverse, [c, b, a])),
86
- by(rule("005_lists_aggregation_ordering.pl", clause(5))),
87
- bindings([binding("X", [c, b, a])]),
88
- uses([
89
- proof(
90
- goal(reverse([a, b, c], [c, b, a])),
91
- by(builtin(reverse, 2))
92
- )
93
- ])
94
- )
95
- ).
96
-
97
7
  answer(length, 3).
98
- why(
99
- answer(length, 3),
100
- proof(
101
- goal(answer(length, 3)),
102
- by(rule("005_lists_aggregation_ordering.pl", clause(6))),
103
- bindings([binding("N", 3)]),
104
- uses([
105
- proof(
106
- goal(length([a, b, c], 3)),
107
- by(builtin(length, 2))
108
- )
109
- ])
110
- )
111
- ).
112
-
113
8
  answer(findall, [1, 2, 3]).
114
- why(
115
- answer(findall, [1, 2, 3]),
116
- proof(
117
- goal(answer(findall, [1, 2, 3])),
118
- by(rule("005_lists_aggregation_ordering.pl", clause(7))),
119
- bindings([binding("X", [1, 2, 3])]),
120
- uses([
121
- proof(
122
- goal(findall(N, between(1, 3, N), [1, 2, 3])),
123
- by(builtin(findall, 3))
124
- )
125
- ])
126
- )
127
- ).
128
-
129
9
  answer(sort, [a, b]).
130
- why(
131
- answer(sort, [a, b]),
132
- proof(
133
- goal(answer(sort, [a, b])),
134
- by(rule("005_lists_aggregation_ordering.pl", clause(8))),
135
- bindings([binding("X", [a, b])]),
136
- uses([
137
- proof(
138
- goal(sort([b, a, b], [a, b])),
139
- by(builtin(sort, 2))
140
- )
141
- ])
142
- )
143
- ).
144
-
@@ -1,80 +1,4 @@
1
1
  answer(atom, name(alice, "Alice")).
2
- why(
3
- answer(atom, name(alice, "Alice")),
4
- proof(
5
- goal(answer(atom, name(alice, "Alice"))),
6
- by(rule("006_formula_terms.pl", clause(2))),
7
- bindings([binding("A", name(alice, "Alice")), binding("F", (name(alice, "Alice"), knows(alice, bob)))]),
8
- uses([
9
- proof(
10
- goal(formula((name(alice, "Alice"), knows(alice, bob)))),
11
- by(fact("006_formula_terms.pl", clause(1)))
12
- ),
13
- proof(
14
- goal(formula_atom((name(alice, "Alice"), knows(alice, bob)), name(alice, "Alice"))),
15
- by(builtin(formula_atom, 2))
16
- )
17
- ])
18
- )
19
- ).
20
-
21
2
  answer(atom, knows(alice, bob)).
22
- why(
23
- answer(atom, knows(alice, bob)),
24
- proof(
25
- goal(answer(atom, knows(alice, bob))),
26
- by(rule("006_formula_terms.pl", clause(2))),
27
- bindings([binding("A", knows(alice, bob)), binding("F", (name(alice, "Alice"), knows(alice, bob)))]),
28
- uses([
29
- proof(
30
- goal(formula((name(alice, "Alice"), knows(alice, bob)))),
31
- by(fact("006_formula_terms.pl", clause(1)))
32
- ),
33
- proof(
34
- goal(formula_atom((name(alice, "Alice"), knows(alice, bob)), knows(alice, bob))),
35
- by(builtin(formula_atom, 2))
36
- )
37
- ])
38
- )
39
- ).
40
-
41
3
  answer(binary, exposed(alice, name, "Alice")).
42
- why(
43
- answer(binary, exposed(alice, name, "Alice")),
44
- proof(
45
- goal(answer(binary, exposed(alice, name, "Alice"))),
46
- by(rule("006_formula_terms.pl", clause(3))),
47
- bindings([binding("S", alice), binding("P", name), binding("O", "Alice"), binding("F", (name(alice, "Alice"), knows(alice, bob)))]),
48
- uses([
49
- proof(
50
- goal(formula((name(alice, "Alice"), knows(alice, bob)))),
51
- by(fact("006_formula_terms.pl", clause(1)))
52
- ),
53
- proof(
54
- goal(formula_binary((name(alice, "Alice"), knows(alice, bob)), alice, name, "Alice")),
55
- by(builtin(formula_binary, 4))
56
- )
57
- ])
58
- )
59
- ).
60
-
61
4
  answer(binary, exposed(alice, knows, bob)).
62
- why(
63
- answer(binary, exposed(alice, knows, bob)),
64
- proof(
65
- goal(answer(binary, exposed(alice, knows, bob))),
66
- by(rule("006_formula_terms.pl", clause(3))),
67
- bindings([binding("S", alice), binding("P", knows), binding("O", bob), binding("F", (name(alice, "Alice"), knows(alice, bob)))]),
68
- uses([
69
- proof(
70
- goal(formula((name(alice, "Alice"), knows(alice, bob)))),
71
- by(fact("006_formula_terms.pl", clause(1)))
72
- ),
73
- proof(
74
- goal(formula_binary((name(alice, "Alice"), knows(alice, bob)), alice, knows, bob)),
75
- by(builtin(formula_binary, 4))
76
- )
77
- ])
78
- )
79
- ).
80
-
@@ -1,42 +1,2 @@
1
1
  answer(open, a).
2
- why(
3
- answer(open, a),
4
- proof(
5
- goal(answer(open, a)),
6
- by(rule("007_negation_once_generators.pl", clause(4))),
7
- bindings([binding("X", a)]),
8
- uses([
9
- proof(
10
- goal(candidate(a)),
11
- by(fact("007_negation_once_generators.pl", clause(1)))
12
- ),
13
- proof(
14
- goal(not(closed(a))),
15
- by(builtin(not, 1))
16
- )
17
- ])
18
- )
19
- ).
20
-
21
2
  answer(first_between, 2).
22
- why(
23
- answer(first_between, 2),
24
- proof(
25
- goal(answer(first_between, 2)),
26
- by(rule("007_negation_once_generators.pl", clause(5))),
27
- bindings([binding("X", 2)]),
28
- uses([
29
- proof(
30
- goal(once(between(2, 4, 2))),
31
- by(builtin(once, 1)),
32
- uses([
33
- proof(
34
- goal(between(2, 4, 2)),
35
- by(builtin(between, 3))
36
- )
37
- ])
38
- )
39
- ])
40
- )
41
- ).
42
-
@@ -1,62 +1,4 @@
1
1
  answer(eq_variable, pair(a, [b, c])).
2
- why(
3
- answer(eq_variable, pair(a, [b, c])),
4
- proof(
5
- goal(answer(eq_variable, pair(a, [b, c]))),
6
- by(rule("008_equality_and_inequality.pl", clause(1))),
7
- bindings([binding("X", pair(a, [b, c]))]),
8
- uses([
9
- proof(
10
- goal(eq(pair(a, [b, c]), pair(a, [b, c]))),
11
- by(builtin(eq, 2))
12
- )
13
- ])
14
- )
15
- ).
16
-
17
2
  answer(eq_nested, true).
18
- why(
19
- answer(eq_nested, true),
20
- proof(
21
- goal(answer(eq_nested, true)),
22
- by(rule("008_equality_and_inequality.pl", clause(2))),
23
- bindings([binding("X", same)]),
24
- uses([
25
- proof(
26
- goal(eq(pair(same, same), pair(same, same))),
27
- by(builtin(eq, 2))
28
- )
29
- ])
30
- )
31
- ).
32
-
33
3
  answer(neq_atoms, true).
34
- why(
35
- answer(neq_atoms, true),
36
- proof(
37
- goal(answer(neq_atoms, true)),
38
- by(rule("008_equality_and_inequality.pl", clause(3))),
39
- uses([
40
- proof(
41
- goal(neq(alice, bob)),
42
- by(builtin(neq, 2))
43
- )
44
- ])
45
- )
46
- ).
47
-
48
4
  answer(neq_structures, true).
49
- why(
50
- answer(neq_structures, true),
51
- proof(
52
- goal(answer(neq_structures, true)),
53
- by(rule("008_equality_and_inequality.pl", clause(4))),
54
- uses([
55
- proof(
56
- goal(neq(pair(a), pair(a, b))),
57
- by(builtin(neq, 2))
58
- )
59
- ])
60
- )
61
- ).
62
-
@@ -1,78 +1,5 @@
1
1
  answer(rest, [b, c]).
2
- why(
3
- answer(rest, [b, c]),
4
- proof(
5
- goal(answer(rest, [b, c])),
6
- by(rule("009_list_relations.pl", clause(1))),
7
- bindings([binding("X", [b, c])]),
8
- uses([
9
- proof(
10
- goal(rest([a, b, c], [b, c])),
11
- by(builtin(rest, 2))
12
- )
13
- ])
14
- )
15
- ).
16
-
17
2
  answer(select, selected(a, [b])).
18
- why(
19
- answer(select, selected(a, [b])),
20
- proof(
21
- goal(answer(select, selected(a, [b]))),
22
- by(rule("009_list_relations.pl", clause(2))),
23
- bindings([binding("X", a), binding("R", [b])]),
24
- uses([
25
- proof(
26
- goal(select(a, [a, b], [b])),
27
- by(builtin(select, 3))
28
- )
29
- ])
30
- )
31
- ).
32
-
33
3
  answer(select, selected(b, [a])).
34
- why(
35
- answer(select, selected(b, [a])),
36
- proof(
37
- goal(answer(select, selected(b, [a]))),
38
- by(rule("009_list_relations.pl", clause(2))),
39
- bindings([binding("X", b), binding("R", [a])]),
40
- uses([
41
- proof(
42
- goal(select(b, [a, b], [a])),
43
- by(builtin(select, 3))
44
- )
45
- ])
46
- )
47
- ).
48
-
49
4
  answer(not_member, true).
50
- why(
51
- answer(not_member, true),
52
- proof(
53
- goal(answer(not_member, true)),
54
- by(rule("009_list_relations.pl", clause(3))),
55
- uses([
56
- proof(
57
- goal(not_member(c, [a, b])),
58
- by(builtin(not_member, 2))
59
- )
60
- ])
61
- )
62
- ).
63
-
64
5
  answer(is_list, true).
65
- why(
66
- answer(is_list, true),
67
- proof(
68
- goal(answer(is_list, true)),
69
- by(rule("009_list_relations.pl", clause(4))),
70
- uses([
71
- proof(
72
- goal(is_list([a, b])),
73
- by(builtin(is_list, 1))
74
- )
75
- ])
76
- )
77
- ).
78
-
@@ -1,48 +1,3 @@
1
1
  answer(split, split([], [a, b])).
2
- why(
3
- answer(split, split([], [a, b])),
4
- proof(
5
- goal(answer(split, split([], [a, b]))),
6
- by(rule("010_append_splits.pl", clause(1))),
7
- bindings([binding("A", []), binding("B", [a, b])]),
8
- uses([
9
- proof(
10
- goal(append([], [a, b], [a, b])),
11
- by(builtin(append, 3))
12
- )
13
- ])
14
- )
15
- ).
16
-
17
2
  answer(split, split([a], [b])).
18
- why(
19
- answer(split, split([a], [b])),
20
- proof(
21
- goal(answer(split, split([a], [b]))),
22
- by(rule("010_append_splits.pl", clause(1))),
23
- bindings([binding("A", [a]), binding("B", [b])]),
24
- uses([
25
- proof(
26
- goal(append([a], [b], [a, b])),
27
- by(builtin(append, 3))
28
- )
29
- ])
30
- )
31
- ).
32
-
33
3
  answer(split, split([a, b], [])).
34
- why(
35
- answer(split, split([a, b], [])),
36
- proof(
37
- goal(answer(split, split([a, b], []))),
38
- by(rule("010_append_splits.pl", clause(1))),
39
- bindings([binding("A", [a, b]), binding("B", [])]),
40
- uses([
41
- proof(
42
- goal(append([a, b], [], [a, b])),
43
- by(builtin(append, 3))
44
- )
45
- ])
46
- )
47
- ).
48
-
@@ -1,75 +1,5 @@
1
1
  answer(matches, true).
2
- why(
3
- answer(matches, true),
4
- proof(
5
- goal(answer(matches, true)),
6
- by(rule("011_matching_and_comparison.pl", clause(1))),
7
- uses([
8
- proof(
9
- goal(matches("eyelang", "eye")),
10
- by(builtin(matches, 2))
11
- )
12
- ])
13
- )
14
- ).
15
-
16
2
  answer(not_matches, true).
17
- why(
18
- answer(not_matches, true),
19
- proof(
20
- goal(answer(not_matches, true)),
21
- by(rule("011_matching_and_comparison.pl", clause(2))),
22
- uses([
23
- proof(
24
- goal(not_matches("eyelang", "cat")),
25
- by(builtin(not_matches, 2))
26
- )
27
- ])
28
- )
29
- ).
30
-
31
3
  answer(lex_lt, true).
32
- why(
33
- answer(lex_lt, true),
34
- proof(
35
- goal(answer(lex_lt, true)),
36
- by(rule("011_matching_and_comparison.pl", clause(3))),
37
- uses([
38
- proof(
39
- goal(lt(alpha, beta)),
40
- by(builtin(lt, 2))
41
- )
42
- ])
43
- )
44
- ).
45
-
46
4
  answer(lex_gt, true).
47
- why(
48
- answer(lex_gt, true),
49
- proof(
50
- goal(answer(lex_gt, true)),
51
- by(rule("011_matching_and_comparison.pl", clause(4))),
52
- uses([
53
- proof(
54
- goal(gt(beta, alpha)),
55
- by(builtin(gt, 2))
56
- )
57
- ])
58
- )
59
- ).
60
-
61
5
  answer(numeric_le, true).
62
- why(
63
- answer(numeric_le, true),
64
- proof(
65
- goal(answer(numeric_le, true)),
66
- by(rule("011_matching_and_comparison.pl", clause(5))),
67
- uses([
68
- proof(
69
- goal(le(2, 2)),
70
- by(builtin(le, 2))
71
- )
72
- ])
73
- )
74
- ).
75
-
@@ -1,43 +1,2 @@
1
1
  reach(a, b).
2
- why(
3
- reach(a, b),
4
- proof(
5
- goal(reach(a, b)),
6
- by(rule("012_memoize_declaration.pl", clause(4))),
7
- bindings([binding("X", a), binding("Y", b)]),
8
- uses([
9
- proof(
10
- goal(edge(a, b)),
11
- by(fact("012_memoize_declaration.pl", clause(2)))
12
- )
13
- ])
14
- )
15
- ).
16
-
17
2
  reach(a, c).
18
- why(
19
- reach(a, c),
20
- proof(
21
- goal(reach(a, c)),
22
- by(rule("012_memoize_declaration.pl", clause(5))),
23
- bindings([binding("X", a), binding("Z", c), binding("Y", b)]),
24
- uses([
25
- proof(
26
- goal(edge(a, b)),
27
- by(fact("012_memoize_declaration.pl", clause(2)))
28
- ),
29
- proof(
30
- goal(reach(b, c)),
31
- by(rule("012_memoize_declaration.pl", clause(4))),
32
- bindings([binding("X", b), binding("Y", c)]),
33
- uses([
34
- proof(
35
- goal(edge(b, c)),
36
- by(fact("012_memoize_declaration.pl", clause(3)))
37
- )
38
- ])
39
- )
40
- ])
41
- )
42
- ).
43
-
@@ -1,112 +1,7 @@
1
1
  answer(neg, -5).
2
- why(
3
- answer(neg, -5),
4
- proof(
5
- goal(answer(neg, -5)),
6
- by(rule("013_numeric_functions.pl", clause(1))),
7
- bindings([binding("X", -5)]),
8
- uses([
9
- proof(
10
- goal(neg(5, -5)),
11
- by(builtin(neg, 2))
12
- )
13
- ])
14
- )
15
- ).
16
-
17
2
  answer(abs, 5).
18
- why(
19
- answer(abs, 5),
20
- proof(
21
- goal(answer(abs, 5)),
22
- by(rule("013_numeric_functions.pl", clause(2))),
23
- bindings([binding("X", 5)]),
24
- uses([
25
- proof(
26
- goal(abs(-5, 5)),
27
- by(builtin(abs, 2))
28
- )
29
- ])
30
- )
31
- ).
32
-
33
3
  answer(rounded, 3).
34
- why(
35
- answer(rounded, 3),
36
- proof(
37
- goal(answer(rounded, 3)),
38
- by(rule("013_numeric_functions.pl", clause(3))),
39
- bindings([binding("X", 3)]),
40
- uses([
41
- proof(
42
- goal(rounded(2.6, 3)),
43
- by(builtin(rounded, 2))
44
- )
45
- ])
46
- )
47
- ).
48
-
49
4
  answer(sin_zero, 0.0).
50
- why(
51
- answer(sin_zero, 0.0),
52
- proof(
53
- goal(answer(sin_zero, 0.0)),
54
- by(rule("013_numeric_functions.pl", clause(4))),
55
- bindings([binding("X", 0.0)]),
56
- uses([
57
- proof(
58
- goal(sin(0, 0.0)),
59
- by(builtin(sin, 2))
60
- )
61
- ])
62
- )
63
- ).
64
-
65
5
  answer(cos_zero, 1.0).
66
- why(
67
- answer(cos_zero, 1.0),
68
- proof(
69
- goal(answer(cos_zero, 1.0)),
70
- by(rule("013_numeric_functions.pl", clause(5))),
71
- bindings([binding("X", 1.0)]),
72
- uses([
73
- proof(
74
- goal(cos(0, 1.0)),
75
- by(builtin(cos, 2))
76
- )
77
- ])
78
- )
79
- ).
80
-
81
6
  answer(log_one, 0.0).
82
- why(
83
- answer(log_one, 0.0),
84
- proof(
85
- goal(answer(log_one, 0.0)),
86
- by(rule("013_numeric_functions.pl", clause(6))),
87
- bindings([binding("X", 0.0)]),
88
- uses([
89
- proof(
90
- goal(log(1, 0.0)),
91
- by(builtin(log, 2))
92
- )
93
- ])
94
- )
95
- ).
96
-
97
7
  answer(float_division, 3.5).
98
- why(
99
- answer(float_division, 3.5),
100
- proof(
101
- goal(answer(float_division, 3.5)),
102
- by(rule("013_numeric_functions.pl", clause(7))),
103
- bindings([binding("X", 3.5)]),
104
- uses([
105
- proof(
106
- goal(div(7.0, 2.0, 3.5)),
107
- by(builtin(div, 3))
108
- )
109
- ])
110
- )
111
- ).
112
-