eyeprolog 1.1.4 → 1.1.5

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.
@@ -0,0 +1 @@
1
+ hates(alice, nobody).
@@ -0,0 +1,20 @@
1
+ hates(alice, nobody).
2
+ why(
3
+ hates(alice, nobody),
4
+ proof(
5
+ goal(hates(alice, nobody)),
6
+ by(rule("snaf.pl", clause(3))),
7
+ bindings([binding("X", bob)]),
8
+ uses([
9
+ proof(
10
+ goal(person(bob)),
11
+ by(fact("snaf.pl", clause(2)))
12
+ ),
13
+ proof(
14
+ goal('\\+'(hates(alice, bob))),
15
+ by(builtin('\\+', 1))
16
+ )
17
+ ])
18
+ )
19
+ ).
20
+
@@ -0,0 +1,12 @@
1
+ % Alice loves Bob; Bob is a person. If Alice does not hate a person, conclude she hates Nobody.
2
+
3
+ %% goal: hates(alice, nobody)
4
+
5
+ % Facts
6
+ loves(alice, bob).
7
+ person(bob).
8
+
9
+ % Rule
10
+ hates(alice, nobody) :-
11
+ person(X),
12
+ \+ hates(alice, X).
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.1.4",
6
+ "version": "1.1.5",
7
7
  "description": "EyeProlog turns facts and rules into answers and proofs.",
8
8
  "type": "module",
9
9
  "main": "./index.js",
package/playground.html CHANGED
@@ -601,6 +601,7 @@
601
601
  "shoelace-polygon-area",
602
602
  "sieve",
603
603
  "skolem-functions",
604
+ "snaf",
604
605
  "socrates",
605
606
  "spacecraft-battery-diagnosis",
606
607
  "stable-marriage",
@@ -42,6 +42,7 @@ export const proofExamples = [
42
42
  'list-collection.pl',
43
43
  'proof-contrapositive.pl',
44
44
  'reusable-builtins.pl',
45
+ 'snaf.pl',
45
46
  'socrates.pl',
46
47
  'spacecraft-battery-diagnosis.pl',
47
48
  'term-tools.pl',
@@ -6212,9 +6212,9 @@ Review questions:
6212
6212
  </figure>
6213
6213
 
6214
6214
  The [examples directory](https://github.com/eyereasoner/eyeprolog/tree/main/examples/) is the book's executable companion. The
6215
- top-level directory contains **189 self-contained runnable programs**. Every
6215
+ top-level directory contains **190 self-contained runnable programs**. Every
6216
6216
  source program has an exact answer file under
6217
- [examples/output](https://github.com/eyereasoner/eyeprolog/tree/main/examples/output/), and **60 selected programs** have a checked
6217
+ [examples/output](https://github.com/eyereasoner/eyeprolog/tree/main/examples/output/), and **61 selected programs** have a checked
6218
6218
  explanation under [examples/proof](https://github.com/eyereasoner/eyeprolog/tree/main/examples/proof/). The thematic tables below link every top-level program and open the program
6219
6219
  itself rather than merely naming it.
6220
6220
 
@@ -6297,6 +6297,7 @@ studies.
6297
6297
  | [Herbrand witnesses](https://github.com/eyereasoner/eyeprolog/blob/main/examples/herbrand-witnesses.pl) | Functional witness terms make existential structure and syntactic identity visible in both answers and derivations. | [answers](https://github.com/eyereasoner/eyeprolog/blob/main/examples/output/herbrand-witnesses.pl) · [proof](https://github.com/eyereasoner/eyeprolog/blob/main/examples/proof/herbrand-witnesses.pl) |
6298
6298
  | [Reusable built-ins](https://github.com/eyereasoner/eyeprolog/blob/main/examples/reusable-builtins.pl) | Arithmetic, strings, lists, and term inspection compose through ordinary variables. | [answers](https://github.com/eyereasoner/eyeprolog/blob/main/examples/output/reusable-builtins.pl) · [proof](https://github.com/eyereasoner/eyeprolog/blob/main/examples/proof/reusable-builtins.pl) |
6299
6299
  | [Skolem Functions](https://github.com/eyereasoner/eyeprolog/blob/main/examples/skolem-functions.pl) | Skolem functional terms in rule heads. | [answers](https://github.com/eyereasoner/eyeprolog/blob/main/examples/output/skolem-functions.pl) |
6300
+ | [SNAF](https://github.com/eyereasoner/eyeprolog/blob/main/examples/snaf.pl) | Negation as failure establishes that Alice does not hate Bob before deriving that she hates Nobody. | [answers](https://github.com/eyereasoner/eyeprolog/blob/main/examples/output/snaf.pl) · [proof](https://github.com/eyereasoner/eyeprolog/blob/main/examples/proof/snaf.pl) |
6300
6301
  | [Socrates](https://github.com/eyereasoner/eyeprolog/blob/main/examples/socrates.pl) | A fact and one rule turn the classical syllogism into a ground derivation. | [answers](https://github.com/eyereasoner/eyeprolog/blob/main/examples/output/socrates.pl) · [proof](https://github.com/eyereasoner/eyeprolog/blob/main/examples/proof/socrates.pl) |
6301
6302
  | [UUID](https://github.com/eyereasoner/eyeprolog/blob/main/examples/uuid.pl) | `uuid/3` reproducibly creates one version 4 UUID atom from explicit random state; the example validates its canonical shape. | [answers](https://github.com/eyereasoner/eyeprolog/blob/main/examples/output/uuid.pl) |
6302
6303
  | [Witch](https://github.com/eyereasoner/eyeprolog/blob/main/examples/witch.pl) | Burn the witch, adapted from Eyeling's examples/witch.n3. | [answers](https://github.com/eyereasoner/eyeprolog/blob/main/examples/output/witch.pl) · [proof](https://github.com/eyereasoner/eyeprolog/blob/main/examples/proof/witch.pl) |