eyeprolog 1.6.33 → 1.6.35
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.
- package/README.md +11 -11
- package/examples/book/README.md +59 -75
- package/examples/book/chapter-02/02-measurement.pl +0 -2
- package/examples/book/chapter-03/01-eligible.pl +0 -2
- package/examples/book/chapter-03/04-ancestor.pl +2 -0
- package/examples/book/chapter-03/{07-different.pl → 05-different.pl} +1 -1
- package/examples/book/chapter-03/{08-has_parent.pl → 06-has_parent.pl} +1 -1
- package/examples/book/chapter-03/07-program.pl +2 -0
- package/examples/book/chapter-04/02-path.pl +1 -3
- package/examples/book/chapter-06/01-next.pl +0 -2
- package/examples/book/chapter-06/03-square.pl +0 -2
- package/examples/book/chapter-07/03-move.pl +4 -0
- package/examples/book/chapter-08/01-outgoing_costs.pl +0 -2
- package/examples/book/chapter-08/02-best_route.pl +0 -2
- package/examples/book/chapter-09/01-normalized.pl +0 -2
- package/examples/book/chapter-09/02-message.pl +0 -2
- package/examples/book/chapter-12/01-invalid_probability.pl +5 -0
- package/examples/book/chapter-13/01-reach.pl +3 -0
- package/examples/book/chapter-17/01-path.pl +0 -2
- package/examples/book/chapter-17/02-adult.pl +1 -3
- package/examples/book/chapter-17/03-bad_member.pl +0 -2
- package/examples/book/chapter-18/01-routeable.pl +1 -3
- package/examples/book/chapter-18/02-routeable-2.pl +0 -2
- package/examples/book/chapter-18/03-prefix.pl +1 -1
- package/examples/book/chapter-18/04-candidate_pair.pl +1 -3
- package/examples/book/chapter-19/01-factorial.pl +1 -1
- package/examples/book/chapter-19/02-invalid_limits.pl +1 -1
- package/examples/book/chapter-20/01-connected.pl +1 -1
- package/examples/book/chapter-20/02-within_thermal_limits.pl +1 -1
- package/examples/book/chapter-20/03-search.pl +1 -1
- package/examples/book/chapter-21/02-grandparent.pl +1 -1
- package/examples/book/chapter-21/03-loop_edge.pl +0 -2
- package/examples/book/chapter-21/04-eligible.pl +0 -2
- package/examples/book/chapter-21/05-grows.pl +1 -1
- package/examples/book/chapter-22/02-tree_member.pl +0 -2
- package/examples/book/chapter-22/03-mirror.pl +1 -1
- package/examples/book/chapter-22/04-sentence.pl +1 -1
- package/examples/book/chapter-22/05-evaluate.pl +1 -1
- package/examples/book/chapter-22/06-lookup.pl +0 -2
- package/examples/book/chapter-22/07-simplify.pl +1 -1
- package/examples/book/chapter-23/01-adult.pl +0 -2
- package/examples/book/chapter-23/02-adult-2.pl +0 -2
- package/examples/book/chapter-23/03-can_board.pl +0 -2
- package/examples/book/chapter-23/04-traveler_in_good_standing.pl +0 -2
- package/examples/book/chapter-23/{06-rail_connection.pl → 05-rail_connection.pl} +1 -1
- package/examples/book/chapter-23/{07-sum_numbers.pl → 06-sum_numbers.pl} +1 -1
- package/examples/book/chapter-24/01-worker.pl +1 -1
- package/examples/book/chapter-24/03-best_plan.pl +0 -1
- package/examples/book/chapter-25/01-person.pl +1 -3
- package/examples/book/chapter-25/02-active_badge.pl +0 -2
- package/examples/book/chapter-25/03-in_good_standing.pl +1 -1
- package/examples/book/chapter-25/04-permit.pl +1 -3
- package/examples/book/chapter-26/01-triple.pl +8 -0
- package/examples/book/chapter-26/02-edge.pl +6 -0
- package/examples/book/chapter-27/02-list_length.pl +1 -3
- package/examples/book/chapter-27/03-reverse_acc.pl +1 -1
- package/examples/book/chapter-28/01-triangle.pl +1 -3
- package/examples/book/chapter-28/{03-integer_rectangle.pl → 02-integer_rectangle.pl} +2 -3
- package/examples/book/chapter-28/03-preserves_combine.pl +7 -0
- package/examples/book/chapter-29/01-counterexample_to_odd_square.pl +3 -6
- package/examples/book/chapter-31/01-edge.pl +3 -2
- package/examples/book/chapter-31/{03-double.pl → 02-double_is_even.pl} +5 -9
- package/examples/book/chapter-32/01-age.pl +6 -0
- package/examples/book/chapter-32/{04-reference_square.pl → 02-reference_square.pl} +1 -2
- package/examples/book/chapter-33/{02-source_role.pl → 01-source_role.pl} +1 -2
- package/examples/book/chapter-33/{03-chosen_pair.pl → 02-chosen_pair.pl} +1 -2
- package/examples/book/chapter-33/03-unregistered.pl +4 -0
- package/examples/book/chapter-33/04-step.pl +2 -0
- package/examples/book/chapter-33/{07-depends.pl → 05-depends.pl} +3 -1
- package/examples/book/chapter-33/{08-within_limit.pl → 06-within_limit.pl} +1 -1
- package/examples/book/chapter-33/{09-invalid_badge_assignment.pl → 07-invalid_badge_assignment.pl} +1 -3
- package/examples/book/chapter-33/{10-theory_version.pl → 08-theory_version.pl} +1 -1
- package/examples/book/chapter-34/02-require_route.pl +1 -1
- package/examples/book/chapter-34/03-regional_total.pl +1 -3
- package/examples/book/chapter-36/03-program-3.pl +1 -1
- package/examples/book/chapter-38/01-city.pl +1 -3
- package/examples/book/chapter-39/03-answer.pl +0 -2
- package/examples/book/chapter-39/05-answer-3.pl +0 -2
- package/examples/book/chapter-39/06-cost.pl +0 -1
- package/examples/book/chapter-39/07-message.pl +0 -2
- package/package.json +1 -1
- package/playground.html +3 -1
- package/test/regression/cases-documentation-sync.mjs +2 -2
- package/test/regression/support.mjs +1 -1
- package/the-art-of-eyeprolog.md +3320 -6192
- package/book-assets/proof-as-computation.svg +0 -30
- package/book-assets/reference-navigation.svg +0 -68
- package/book-assets/review-lenses.svg +0 -49
- package/examples/book/chapter-02/03-label.pl +0 -3
- package/examples/book/chapter-03/02-adult.pl +0 -6
- package/examples/book/chapter-03/05-parent.pl +0 -2
- package/examples/book/chapter-03/06-ancestor.pl +0 -2
- package/examples/book/chapter-03/09-program.pl +0 -2
- package/examples/book/chapter-07/02-move.pl +0 -4
- package/examples/book/chapter-11/01-type.pl +0 -8
- package/examples/book/chapter-12/02-invalid_assignment.pl +0 -5
- package/examples/book/chapter-18/05-compatible_pair.pl +0 -6
- package/examples/book/chapter-23/05-connection.pl +0 -2
- package/examples/book/chapter-26/01-mortal.pl +0 -2
- package/examples/book/chapter-26/02-triple.pl +0 -12
- package/examples/book/chapter-26/03-triple-2.pl +0 -4
- package/examples/book/chapter-26/04-edge.pl +0 -8
- package/examples/book/chapter-28/02-rectangle.pl +0 -4
- package/examples/book/chapter-28/04-preserves_combine.pl +0 -10
- package/examples/book/chapter-29/02-noncommuting_pair.pl +0 -7
- package/examples/book/chapter-31/02-program.pl +0 -6
- package/examples/book/chapter-32/01-eligible.pl +0 -6
- package/examples/book/chapter-32/02-eligible-2.pl +0 -6
- package/examples/book/chapter-32/03-candidate_debug.pl +0 -9
- package/examples/book/chapter-33/01-assigned_badge.pl +0 -4
- package/examples/book/chapter-33/04-path.pl +0 -7
- package/examples/book/chapter-33/05-unregistered.pl +0 -4
- package/examples/book/chapter-33/06-step.pl +0 -2
- package/examples/book/chapter-39/09-program.pl +0 -4
- /package/examples/book/chapter-03/{03-can_enter.pl → 02-can_enter.pl} +0 -0
- /package/examples/book/chapter-03/{04-high_score.pl → 03-high_score.pl} +0 -0
- /package/examples/book/chapter-03/{10-closed.pl → 08-closed.pl} +0 -0
- /package/examples/book/chapter-03/{11-p.pl → 09-p.pl} +0 -0
- /package/examples/book/chapter-07/{03-all_tests_pass.pl → 02-all_tests_pass.pl} +0 -0
- /package/examples/book/chapter-23/{08-sum_numbers_acc.pl → 07-sum_numbers_acc.pl} +0 -0
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ EyeProlog turns portable ISO Prolog programs into answers and inspectable proofs
|
|
|
12
12
|
<strong>Click the cover to read <em>The Art of EyeProlog</em>.</strong>
|
|
13
13
|
</p>
|
|
14
14
|
|
|
15
|
-
The single implementation reference is [*The Art of EyeProlog*](the-art-of-eyeprolog
|
|
15
|
+
The single implementation reference is [*The Art of EyeProlog*](https://eyereasoner.github.io/eyeprolog/the-art-of-eyeprolog).
|
|
16
16
|
It documents the language, built-ins, libraries, command line, JavaScript API,
|
|
17
17
|
examples, proofs, conformance profile, and implementation.
|
|
18
18
|
|
|
@@ -65,18 +65,18 @@ printf 'human(socrates).\nmortal(X) :- human(X).\n' |
|
|
|
65
65
|
- [The Art of EyeProlog](https://eyereasoner.github.io/eyeprolog/the-art-of-eyeprolog) — complete reference
|
|
66
66
|
- [Why EyeProlog?](https://eyereasoner.github.io/eyeprolog/why-eyeprolog) — project scope and design
|
|
67
67
|
- [ARC in EyeProlog](https://eyereasoner.github.io/eyeprolog/arc-in-eyeprolog) — answer, reason, check
|
|
68
|
-
- [SPEC.md](SPEC
|
|
68
|
+
- [SPEC.md](https://eyereasoner.github.io/eyeprolog/SPEC) — the answer, proof and check format, and the seven conditions C1–C7 a proof check establishes
|
|
69
69
|
- [Playground](https://eyereasoner.github.io/eyeprolog/playground) — run EyeProlog in a browser
|
|
70
70
|
- [Examples](examples) — runnable programs and checked output
|
|
71
|
-
- [Example decks](examples/deck/
|
|
71
|
+
- [Example decks](https://eyereasoner.github.io/eyeprolog/examples/deck/) — explainable RDF/Prolog scenarios with reproducible roundtrips
|
|
72
72
|
- [Introduction to EyeProlog](https://eyereasoner.github.io/eyeprolog/examples/deck/introduction-to-eyeprolog) — short presentation deck for first-time audiences
|
|
73
73
|
- [Symbiotic Knowledge Graphs](https://eyereasoner.github.io/eyeprolog/examples/deck/symbiotic-knowledge-graphs) — RDF ↔ Prolog heatwave-response demo for human/AI/KG co-evolution
|
|
74
74
|
- [rdf-prolog-interchange](https://github.com/eyereasoner/rdf-prolog-interchange) — standalone RDF 1.2 ↔ ISO Prolog bridge used by the RDF examples
|
|
75
|
-
- [RDF and Prolog: Two Standards-Based Legs](https://github.
|
|
76
|
-
- [ISO conformance review](test/conformance/ISO-COMPLIANCE
|
|
77
|
-
- [Latest Neumerkel conformity](test/conformance/NEUMERKEL-LATEST
|
|
78
|
-
- [Conformance report](conformance-report
|
|
79
|
-
- [OpenRuleBench](openrulebench/
|
|
75
|
+
- [RDF and Prolog: Two Standards-Based Legs](https://eyereasoner.github.io/rdf-prolog-interchange/why-rdf-prolog) — why W3C RDF and ISO Prolog form the foundation
|
|
76
|
+
- [ISO conformance review](https://eyereasoner.github.io/eyeprolog/test/conformance/ISO-COMPLIANCE) — supported Part 1 profile
|
|
77
|
+
- [Latest Neumerkel conformity](https://eyereasoner.github.io/eyeprolog/test/conformance/NEUMERKEL-LATEST) — tracked result from the current live upstream inventory
|
|
78
|
+
- [Conformance report](https://eyereasoner.github.io/eyeprolog/conformance-report) — generated executable conformance status, local corpus summary, and known deviations
|
|
79
|
+
- [OpenRuleBench](https://eyereasoner.github.io/eyeprolog/openrulebench/) — portable benchmark profile
|
|
80
80
|
## RDF, Prolog, and symbiotic knowledge graphs
|
|
81
81
|
|
|
82
82
|
EyeProlog can sit behind an RDF knowledge graph without inventing a private graph representation. [`rdf-prolog-interchange`](https://github.com/eyereasoner/rdf-prolog-interchange) converts RDF 1.2 datasets to ordinary `rdf(Subject, Predicate, Object, Graph)` facts, EyeProlog applies portable rules, and ground `rdf/4` results can be converted back to RDF.
|
|
@@ -86,8 +86,8 @@ The checked [Symbiotic Knowledge Graphs example](examples/symbiotic-knowledge-gr
|
|
|
86
86
|
The same RDF → Prolog → RDF boundary is exercised by five additional checked scenarios: [cross-organization data sharing](https://eyereasoner.github.io/eyeprolog/examples/deck/cross-organization-data-sharing), [explainable EV-depot configuration](https://eyereasoner.github.io/eyeprolog/examples/deck/explainable-ev-depot-configuration), [operational incident response](https://eyereasoner.github.io/eyeprolog/examples/deck/operational-incident-response), [software supply-chain vulnerability response](https://eyereasoner.github.io/eyeprolog/examples/deck/sbom-vulnerability-response), and a [scientific evidence graph](https://eyereasoner.github.io/eyeprolog/examples/deck/scientific-evidence-graph). Together they cover policy decisions, reversible configuration reasoning, dependency-graph diagnosis, transitive SBOM exposure, and evidence aggregation with explicit disagreement.
|
|
87
87
|
|
|
88
88
|
## Performance
|
|
89
|
-
EyeProlog does not carry a separate wall-clock benchmark harness. `npm test`'s own elapsed time, run across thousands of conformance, regression, and example programs, is the coarse performance indicator instead — a real slowdown shows up there. [OpenRuleBench](openrulebench/
|
|
90
|
-
For the project policy on post-ISO-standard and WG17 compatibility features such as digit separators, see [ISO/WG17 compatibility extensions](test/conformance/ISO-WG17-EXTENSIONS
|
|
89
|
+
EyeProlog does not carry a separate wall-clock benchmark harness. `npm test`'s own elapsed time, run across thousands of conformance, regression, and example programs, is the coarse performance indicator instead — a real slowdown shows up there. [OpenRuleBench](https://eyereasoner.github.io/eyeprolog/openrulebench/) remains a dedicated, checked correctness-and-scale benchmark for the Datalog rule-engine profile specifically.
|
|
90
|
+
For the project policy on post-ISO-standard and WG17 compatibility features such as digit separators, see [ISO/WG17 compatibility extensions](https://eyereasoner.github.io/eyeprolog/test/conformance/ISO-WG17-EXTENSIONS).
|
|
91
91
|
## Development
|
|
92
92
|
```sh
|
|
93
93
|
git clone https://github.com/eyereasoner/eyeprolog.git
|
|
@@ -100,6 +100,6 @@ The npm command list is deliberately small:
|
|
|
100
100
|
- `npm test` (or `npm run test`): run the release gate, including live upstream conformity checks (WG17 syntax among them).
|
|
101
101
|
- `npm run neumerkel`: re-fetch the upstream Neumerkel conformity sources and fail if the tracked report no longer matches them. The release gate reports that drift as a warning; this command makes it an error, so it answers "are we still current?" on its own.
|
|
102
102
|
|
|
103
|
-
Use `npm test -- --offline` for a network-free local pass (this also skips the live-discovered WG17 syntax check, since it has no offline snapshot). Focused checks remain available directly, for example `node test/run-regression.mjs docs`; see [test runners](test/
|
|
103
|
+
Use `npm test -- --offline` for a network-free local pass (this also skips the live-discovered WG17 syntax check, since it has no offline snapshot). Focused checks remain available directly, for example `node test/run-regression.mjs docs`; see [test runners](https://eyereasoner.github.io/eyeprolog/test/). The automatic version hooks rebuild generated library and book files, run the release gate, refresh and stage conformance reports, and push the release. Detailed upstream report maintenance is documented in the [conformance guide](https://eyereasoner.github.io/eyeprolog/test/conformance/).
|
|
104
104
|
|
|
105
105
|
EyeProlog is released under the [MIT License](LICENSE.md).
|
package/examples/book/README.md
CHANGED
|
@@ -22,26 +22,23 @@ node tools/extract-book-examples.mjs
|
|
|
22
22
|
|
|
23
23
|
- [01-same_shape.pl](chapter-02/01-same_shape.pl) — Unification
|
|
24
24
|
- [02-measurement.pl](chapter-02/02-measurement.pl)
|
|
25
|
-
- [03-label.pl](chapter-02/03-label.pl)
|
|
26
25
|
|
|
27
26
|
## Chapter 3: Rules and their two readings
|
|
28
27
|
|
|
29
28
|
- [01-eligible.pl](chapter-03/01-eligible.pl)
|
|
30
|
-
- [02-
|
|
31
|
-
- [03-
|
|
32
|
-
- [04-
|
|
33
|
-
- [05-
|
|
34
|
-
- [06-
|
|
35
|
-
- [07-
|
|
36
|
-
- [08-
|
|
37
|
-
- [09-
|
|
38
|
-
- [10-closed.pl](chapter-03/10-closed.pl) — Meaning is not the search strategy
|
|
39
|
-
- [11-p.pl](chapter-03/11-p.pl)
|
|
29
|
+
- [02-can_enter.pl](chapter-03/02-can_enter.pl)
|
|
30
|
+
- [03-high_score.pl](chapter-03/03-high_score.pl)
|
|
31
|
+
- [04-ancestor.pl](chapter-03/04-ancestor.pl) — Deeper foundations: the Herbrand world
|
|
32
|
+
- [05-different.pl](chapter-03/05-different.pl) — Terms denote themselves
|
|
33
|
+
- [06-has_parent.pl](chapter-03/06-has_parent.pl) — Witnesses instead of hidden objects
|
|
34
|
+
- [07-program.pl](chapter-03/07-program.pl) — The occurs check
|
|
35
|
+
- [08-closed.pl](chapter-03/08-closed.pl) — Meaning is not the search strategy
|
|
36
|
+
- [09-p.pl](chapter-03/09-p.pl)
|
|
40
37
|
|
|
41
38
|
## Chapter 4: Recursion: describing reachability
|
|
42
39
|
|
|
43
40
|
- [01-ancestor.pl](chapter-04/01-ancestor.pl)
|
|
44
|
-
- [02-path.pl](chapter-04/02-path.pl) —
|
|
41
|
+
- [02-path.pl](chapter-04/02-path.pl) — Cycles and tabling
|
|
45
42
|
|
|
46
43
|
## Chapter 5: Lists as relations
|
|
47
44
|
|
|
@@ -58,8 +55,8 @@ node tools/extract-book-examples.mjs
|
|
|
58
55
|
## Chapter 7: Failure, negation, and quantification
|
|
59
56
|
|
|
60
57
|
- [01-allowed.pl](chapter-07/01-allowed.pl)
|
|
61
|
-
- [02-
|
|
62
|
-
- [03-
|
|
58
|
+
- [02-all_tests_pass.pl](chapter-07/02-all_tests_pass.pl)
|
|
59
|
+
- [03-move.pl](chapter-07/03-move.pl) — Negation through recursion
|
|
63
60
|
|
|
64
61
|
## Chapter 8: Collecting and choosing answers
|
|
65
62
|
|
|
@@ -76,14 +73,13 @@ node tools/extract-book-examples.mjs
|
|
|
76
73
|
- [01-color.pl](chapter-10/01-color.pl)
|
|
77
74
|
- [02-plan.pl](chapter-10/02-plan.pl)
|
|
78
75
|
|
|
79
|
-
## Chapter 11: Queries, answers, and proofs
|
|
80
|
-
|
|
81
|
-
- [01-type.pl](chapter-11/01-type.pl)
|
|
82
|
-
|
|
83
76
|
## Chapter 12: Integrity checks as ordinary predicates
|
|
84
77
|
|
|
85
78
|
- [01-invalid_probability.pl](chapter-12/01-invalid_probability.pl)
|
|
86
|
-
|
|
79
|
+
|
|
80
|
+
## Chapter 13: Termination, tabling, and performance
|
|
81
|
+
|
|
82
|
+
- [01-reach.pl](chapter-13/01-reach.pl)
|
|
87
83
|
|
|
88
84
|
## Chapter 14: Knowledge engineering
|
|
89
85
|
|
|
@@ -92,46 +88,45 @@ node tools/extract-book-examples.mjs
|
|
|
92
88
|
## Chapter 17: Logic and control
|
|
93
89
|
|
|
94
90
|
- [01-path.pl](chapter-17/01-path.pl)
|
|
95
|
-
- [02-adult.pl](chapter-17/02-adult.pl) —
|
|
91
|
+
- [02-adult.pl](chapter-17/02-adult.pl) — Same meaning, different computation
|
|
96
92
|
- [03-bad_member.pl](chapter-17/03-bad_member.pl)
|
|
97
93
|
- [04-item.pl](chapter-17/04-item.pl)
|
|
98
94
|
|
|
99
95
|
## Chapter 18: Constructing a program
|
|
100
96
|
|
|
101
|
-
- [01-routeable.pl](chapter-18/01-routeable.pl) — Begin with ground
|
|
97
|
+
- [01-routeable.pl](chapter-18/01-routeable.pl) — Begin with a ground sentence
|
|
102
98
|
- [02-routeable-2.pl](chapter-18/02-routeable-2.pl)
|
|
103
|
-
- [03-prefix.pl](chapter-18/03-prefix.pl) —
|
|
104
|
-
- [04-candidate_pair.pl](chapter-18/04-candidate_pair.pl) —
|
|
105
|
-
- [05-compatible_pair.pl](chapter-18/05-compatible_pair.pl)
|
|
99
|
+
- [03-prefix.pl](chapter-18/03-prefix.pl) — Examples before recursion
|
|
100
|
+
- [04-candidate_pair.pl](chapter-18/04-candidate_pair.pl) — Generate, then test
|
|
106
101
|
|
|
107
102
|
## Chapter 19: Correctness and termination
|
|
108
103
|
|
|
109
|
-
- [01-factorial.pl](chapter-19/01-factorial.pl) — Termination needs its own
|
|
110
|
-
- [02-invalid_limits.pl](chapter-19/02-invalid_limits.pl) — Integrity is not
|
|
104
|
+
- [01-factorial.pl](chapter-19/01-factorial.pl) — Termination needs its own measure
|
|
105
|
+
- [02-invalid_limits.pl](chapter-19/02-invalid_limits.pl) — Integrity is not failure
|
|
111
106
|
|
|
112
107
|
## Chapter 20: Improving a program
|
|
113
108
|
|
|
114
|
-
- [01-connected.pl](chapter-20/01-connected.pl) —
|
|
115
|
-
- [02-within_thermal_limits.pl](chapter-20/02-within_thermal_limits.pl) —
|
|
116
|
-
- [03-search.pl](chapter-20/03-search.pl) —
|
|
109
|
+
- [01-connected.pl](chapter-20/01-connected.pl) — Ask a better question first
|
|
110
|
+
- [02-within_thermal_limits.pl](chapter-20/02-within_thermal_limits.pl) — Name invariants with helpers
|
|
111
|
+
- [03-search.pl](chapter-20/03-search.pl) — Hoist invariant work
|
|
117
112
|
|
|
118
113
|
## Chapter 21: Reading the computation
|
|
119
114
|
|
|
120
115
|
- [01-parent.pl](chapter-21/01-parent.pl)
|
|
121
|
-
- [02-grandparent.pl](chapter-21/02-grandparent.pl) —
|
|
116
|
+
- [02-grandparent.pl](chapter-21/02-grandparent.pl) — Bindings flow forward
|
|
122
117
|
- [03-loop_edge.pl](chapter-21/03-loop_edge.pl)
|
|
123
118
|
- [04-eligible.pl](chapter-21/04-eligible.pl) — Failure rewinds choices, not facts
|
|
124
|
-
- [05-grows.pl](chapter-21/05-grows.pl) — Variants
|
|
119
|
+
- [05-grows.pl](chapter-21/05-grows.pl) — Variants and tables
|
|
125
120
|
|
|
126
121
|
## Chapter 22: Trees, languages, and symbolic evaluation
|
|
127
122
|
|
|
128
123
|
- [01-tree.pl](chapter-22/01-tree.pl)
|
|
129
124
|
- [02-tree_member.pl](chapter-22/02-tree_member.pl)
|
|
130
|
-
- [03-mirror.pl](chapter-22/03-mirror.pl) —
|
|
131
|
-
- [04-sentence.pl](chapter-22/04-sentence.pl) — A
|
|
132
|
-
- [05-evaluate.pl](chapter-22/05-evaluate.pl) —
|
|
125
|
+
- [03-mirror.pl](chapter-22/03-mirror.pl) — Relating two trees
|
|
126
|
+
- [04-sentence.pl](chapter-22/04-sentence.pl) — A definite clause grammar
|
|
127
|
+
- [05-evaluate.pl](chapter-22/05-evaluate.pl) — An evaluator
|
|
133
128
|
- [06-lookup.pl](chapter-22/06-lookup.pl)
|
|
134
|
-
- [07-simplify.pl](chapter-22/07-simplify.pl) — Rewriting
|
|
129
|
+
- [07-simplify.pl](chapter-22/07-simplify.pl) — Rewriting
|
|
135
130
|
|
|
136
131
|
## Chapter 23: Transforming programs
|
|
137
132
|
|
|
@@ -139,81 +134,71 @@ node tools/extract-book-examples.mjs
|
|
|
139
134
|
- [02-adult-2.pl](chapter-23/02-adult-2.pl)
|
|
140
135
|
- [03-can_board.pl](chapter-23/03-can_board.pl)
|
|
141
136
|
- [04-traveler_in_good_standing.pl](chapter-23/04-traveler_in_good_standing.pl)
|
|
142
|
-
- [05-
|
|
143
|
-
- [06-
|
|
144
|
-
- [07-
|
|
145
|
-
- [08-sum_numbers_acc.pl](chapter-23/08-sum_numbers_acc.pl)
|
|
137
|
+
- [05-rail_connection.pl](chapter-23/05-rail_connection.pl) — Specialization
|
|
138
|
+
- [06-sum_numbers.pl](chapter-23/06-sum_numbers.pl) — Accumulators change modes
|
|
139
|
+
- [07-sum_numbers_acc.pl](chapter-23/07-sum_numbers_acc.pl)
|
|
146
140
|
|
|
147
141
|
## Chapter 24: Designing finite search
|
|
148
142
|
|
|
149
|
-
- [01-worker.pl](chapter-24/01-worker.pl) — Generate
|
|
143
|
+
- [01-worker.pl](chapter-24/01-worker.pl) — Generate and constrain
|
|
150
144
|
- [02-simple_path.pl](chapter-24/02-simple_path.pl) — Search over states
|
|
151
145
|
- [03-best_plan.pl](chapter-24/03-best_plan.pl) — Optimization is search plus an order
|
|
152
146
|
|
|
153
147
|
## Chapter 25: Case study: an auditable decision service
|
|
154
148
|
|
|
155
|
-
- [01-person.pl](chapter-25/01-person.pl) —
|
|
149
|
+
- [01-person.pl](chapter-25/01-person.pl) — Sources and concepts
|
|
156
150
|
- [02-active_badge.pl](chapter-25/02-active_badge.pl)
|
|
157
|
-
- [03-in_good_standing.pl](chapter-25/03-in_good_standing.pl) —
|
|
158
|
-
- [04-permit.pl](chapter-25/04-permit.pl) — Decision
|
|
151
|
+
- [03-in_good_standing.pl](chapter-25/03-in_good_standing.pl) — The closed-world choice
|
|
152
|
+
- [04-permit.pl](chapter-25/04-permit.pl) — Decision and reason
|
|
159
153
|
- [05-incompatible_status.pl](chapter-25/05-incompatible_status.pl) — Integrity before decisions
|
|
160
154
|
|
|
161
155
|
## Chapter 26: A proof can be a computation
|
|
162
156
|
|
|
163
|
-
- [01-
|
|
164
|
-
- [02-
|
|
165
|
-
- [03-triple-2.pl](chapter-26/03-triple-2.pl) — Proof objects and proof checking
|
|
166
|
-
- [04-edge.pl](chapter-26/04-edge.pl) — The least model as mathematical closure
|
|
157
|
+
- [01-triple.pl](chapter-26/01-triple.pl)
|
|
158
|
+
- [02-edge.pl](chapter-26/02-edge.pl) — The least model as closure
|
|
167
159
|
|
|
168
160
|
## Chapter 27: Recursion is induction in motion
|
|
169
161
|
|
|
170
162
|
- [01-natural.pl](chapter-27/01-natural.pl)
|
|
171
|
-
- [02-list_length.pl](chapter-27/02-list_length.pl) —
|
|
172
|
-
- [03-reverse_acc.pl](chapter-27/03-reverse_acc.pl) — Accumulators
|
|
163
|
+
- [02-list_length.pl](chapter-27/02-list_length.pl) — Data shapes give you the induction
|
|
164
|
+
- [03-reverse_acc.pl](chapter-27/03-reverse_acc.pl) — Accumulators need stronger invariants
|
|
173
165
|
|
|
174
166
|
## Chapter 28: Algebra, symmetry, and representation
|
|
175
167
|
|
|
176
168
|
- [01-triangle.pl](chapter-28/01-triangle.pl) — Symmetry reduces search
|
|
177
|
-
- [02-
|
|
178
|
-
- [03-
|
|
179
|
-
- [04-preserves_combine.pl](chapter-28/04-preserves_combine.pl) — Composition, homomorphism, and reusable laws
|
|
169
|
+
- [02-integer_rectangle.pl](chapter-28/02-integer_rectangle.pl) — Relations expose inverse problems
|
|
170
|
+
- [03-preserves_combine.pl](chapter-28/03-preserves_combine.pl) — Laws as testable relations
|
|
180
171
|
|
|
181
172
|
## Chapter 29: Search as experimental mathematics
|
|
182
173
|
|
|
183
|
-
- [01-counterexample_to_odd_square.pl](chapter-29/01-counterexample_to_odd_square.pl)
|
|
184
|
-
- [02-noncommuting_pair.pl](chapter-29/02-noncommuting_pair.pl) — One counterexample has asymmetric power
|
|
174
|
+
- [01-counterexample_to_odd_square.pl](chapter-29/01-counterexample_to_odd_square.pl)
|
|
185
175
|
|
|
186
176
|
## Chapter 31: Testing a theory
|
|
187
177
|
|
|
188
178
|
- [01-edge.pl](chapter-31/01-edge.pl) — Positive and negative observers
|
|
189
|
-
- [02-
|
|
190
|
-
- [03-double.pl](chapter-31/03-double.pl) — Properties over finite domains
|
|
179
|
+
- [02-double_is_even.pl](chapter-31/02-double_is_even.pl) — Properties over finite domains
|
|
191
180
|
|
|
192
181
|
## Chapter 32: Debugging by meaning, search, and proof
|
|
193
182
|
|
|
194
|
-
- [01-
|
|
195
|
-
- [02-
|
|
196
|
-
- [03-candidate_debug.pl](chapter-32/03-candidate_debug.pl) — Create diagnostic relations
|
|
197
|
-
- [04-reference_square.pl](chapter-32/04-reference_square.pl) — Compare specification and implementation
|
|
183
|
+
- [01-age.pl](chapter-32/01-age.pl) — Follow bindings left to right
|
|
184
|
+
- [02-reference_square.pl](chapter-32/02-reference_square.pl) — Compare with a reference
|
|
198
185
|
|
|
199
186
|
## Chapter 33: A pattern catalog for reasoning
|
|
200
187
|
|
|
201
|
-
- [01-
|
|
202
|
-
- [02-
|
|
203
|
-
- [03-
|
|
204
|
-
- [04-
|
|
205
|
-
- [05-
|
|
206
|
-
- [06-
|
|
207
|
-
- [07-
|
|
208
|
-
- [08-
|
|
209
|
-
- [09-invalid_badge_assignment.pl](chapter-33/09-invalid_badge_assignment.pl) — Pattern 9: Integrity before inference
|
|
210
|
-
- [10-theory_version.pl](chapter-33/10-theory_version.pl) — Pattern 10: Version the evidence boundary
|
|
188
|
+
- [01-source_role.pl](chapter-33/01-source_role.pl)
|
|
189
|
+
- [02-chosen_pair.pl](chapter-33/02-chosen_pair.pl)
|
|
190
|
+
- [03-unregistered.pl](chapter-33/03-unregistered.pl)
|
|
191
|
+
- [04-step.pl](chapter-33/04-step.pl)
|
|
192
|
+
- [05-depends.pl](chapter-33/05-depends.pl)
|
|
193
|
+
- [06-within_limit.pl](chapter-33/06-within_limit.pl)
|
|
194
|
+
- [07-invalid_badge_assignment.pl](chapter-33/07-invalid_badge_assignment.pl)
|
|
195
|
+
- [08-theory_version.pl](chapter-33/08-theory_version.pl)
|
|
211
196
|
|
|
212
197
|
## Chapter 34: Control, exceptions, and grouped solutions
|
|
213
198
|
|
|
214
199
|
- [01-travel_status.pl](chapter-34/01-travel_status.pl)
|
|
215
|
-
- [02-require_route.pl](chapter-34/02-require_route.pl)
|
|
216
|
-
- [03-regional_total.pl](chapter-34/03-regional_total.pl)
|
|
200
|
+
- [02-require_route.pl](chapter-34/02-require_route.pl) — Exceptions
|
|
201
|
+
- [03-regional_total.pl](chapter-34/03-regional_total.pl) — Grouped solutions
|
|
217
202
|
|
|
218
203
|
## Chapter 35: Reflective terms and atomic conversion
|
|
219
204
|
|
|
@@ -223,7 +208,7 @@ node tools/extract-book-examples.mjs
|
|
|
223
208
|
|
|
224
209
|
- [01-program.pl](chapter-36/01-program.pl)
|
|
225
210
|
- [02-program-2.pl](chapter-36/02-program-2.pl)
|
|
226
|
-
- [03-program-3.pl](chapter-36/03-program-3.pl)
|
|
211
|
+
- [03-program-3.pl](chapter-36/03-program-3.pl) — Operators
|
|
227
212
|
|
|
228
213
|
## Chapter 37: Streams and term I/O
|
|
229
214
|
|
|
@@ -231,7 +216,7 @@ node tools/extract-book-examples.mjs
|
|
|
231
216
|
|
|
232
217
|
## Chapter 38: Language and ISO profile
|
|
233
218
|
|
|
234
|
-
- [01-city.pl](chapter-38/01-city.pl)
|
|
219
|
+
- [01-city.pl](chapter-38/01-city.pl) — Source text
|
|
235
220
|
- [02-look_ahead.pl](chapter-38/02-look_ahead.pl) — Part 3-oriented definite clause grammars
|
|
236
221
|
|
|
237
222
|
## Chapter 39: Predicate reference
|
|
@@ -244,7 +229,6 @@ node tools/extract-book-examples.mjs
|
|
|
244
229
|
- [06-cost.pl](chapter-39/06-cost.pl)
|
|
245
230
|
- [07-message.pl](chapter-39/07-message.pl)
|
|
246
231
|
- [08-task.pl](chapter-39/08-task.pl)
|
|
247
|
-
- [09-program.pl](chapter-39/09-program.pl) — Specialized library implementation notes
|
|
248
232
|
|
|
249
233
|
## Chapter 40: Running EyeProlog: command line and corpus
|
|
250
234
|
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
% From The Art of EyeProlog, Chapter 17 —
|
|
2
|
-
:- use_module(library(lists)).
|
|
3
|
-
|
|
1
|
+
% From The Art of EyeProlog, Chapter 17 — Same meaning, different computation.
|
|
4
2
|
adult(Person) :- person(Person), age(Person, Age), (Age >= 18).
|
|
5
3
|
|
|
6
4
|
adult(Person) :- (Age >= 18), age(Person, Age), person(Person).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
% From The Art of EyeProlog, Chapter 18 —
|
|
1
|
+
% From The Art of EyeProlog, Chapter 18 — Generate, then test.
|
|
2
2
|
candidate_pair(A, B) :-
|
|
3
3
|
person(A),
|
|
4
4
|
person(B).
|
|
@@ -7,5 +7,3 @@ compatible_pair(A, B) :-
|
|
|
7
7
|
candidate_pair(A, B),
|
|
8
8
|
(A \= B),
|
|
9
9
|
\+ conflict(A, B).
|
|
10
|
-
|
|
11
|
-
answer(pair(A, B)) :- compatible_pair(A, B).
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
% From The Art of EyeProlog, Chapter 20 —
|
|
1
|
+
% From The Art of EyeProlog, Chapter 20 — Ask a better question first.
|
|
2
2
|
connected(X, Y) :- path_with_nodes(X, Y, _).
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
% From The Art of EyeProlog, Chapter 21 — Variants
|
|
1
|
+
% From The Art of EyeProlog, Chapter 21 — Variants and tables.
|
|
2
2
|
grows(X) :- grows(wrapper(X)).
|