eyeprolog 1.3.95 → 1.3.96

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.
@@ -238,12 +238,13 @@ npm run generate
238
238
 
239
239
  ## Chapter 39: Built-in predicates by programming role
240
240
 
241
- - [01-answer.pl](chapter-39/01-answer.pl) — The EyeProlog library
242
- - [02-answer-2.pl](chapter-39/02-answer-2.pl)
243
- - [03-answer-3.pl](chapter-39/03-answer-3.pl)
244
- - [04-cost.pl](chapter-39/04-cost.pl)
245
- - [05-message.pl](chapter-39/05-message.pl)
246
- - [06-task.pl](chapter-39/06-task.pl)
241
+ - [01-program.pl](chapter-39/01-program.pl) — The EyeProlog library
242
+ - [02-answer.pl](chapter-39/02-answer.pl)
243
+ - [03-answer-2.pl](chapter-39/03-answer-2.pl)
244
+ - [04-answer-3.pl](chapter-39/04-answer-3.pl)
245
+ - [05-cost.pl](chapter-39/05-cost.pl)
246
+ - [06-message.pl](chapter-39/06-message.pl)
247
+ - [07-task.pl](chapter-39/07-task.pl)
247
248
 
248
249
  ## Chapter 40: Running EyeProlog: command line and corpus
249
250
 
@@ -0,0 +1,4 @@
1
+ % From The Art of EyeProlog, Chapter 39 — The EyeProlog library.
2
+ ?- dif(f(X,A),f(Y,B)), ( true ; A = B ).
3
+ dif(f(X, A), f(Y, B))
4
+ ; A = B, dif(X, Y).
@@ -1,4 +1,4 @@
1
- % From The Art of EyeProlog, Chapter 39 — The EyeProlog library.
1
+ % From The Art of EyeProlog, Chapter 39.
2
2
  :- use_module(library(dates)).
3
3
  :- use_module(library(between), [between/3]).
4
4
  :- use_module(library(random)).
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.3.95",
6
+ "version": "1.3.96",
7
7
  "description": "EyeProlog turns facts and rules into answers and proofs.",
8
8
  "type": "module",
9
9
  "main": "./index.js",
@@ -400,6 +400,20 @@ function regressionCases() {
400
400
  'dif/2 residuals are minimal without auxiliary terms');
401
401
  assertEqual(residuals.stderr, '', 'dif/2 normalization display stderr');
402
402
 
403
+ const perfection = runCli([], {
404
+ input:
405
+ 'dif(f(X,A),f(Y,B)), ( true ; A = B ).\n' +
406
+ ';\n' +
407
+ 'halt.\n',
408
+ });
409
+ assertEqual(perfection.status, 0, 'dif/2 branch-local projection status');
410
+ assertEqual(perfection.stdout,
411
+ '?- dif(f(X, A), f(Y, B))\n' +
412
+ '; A = B, dif(X, Y).\n' +
413
+ '?- ',
414
+ 'dif/2 residual projection is re-evaluated after branch-local bindings');
415
+ assertEqual(perfection.stderr, '', 'dif/2 branch-local projection stderr');
416
+
403
417
  const pendingDifCount = (text) => {
404
418
  const solver = new Solver(Program.parse(''), { registry: getEyePrologRegistry() });
405
419
  const solutions = solver.solve([parseGoalText(text)], new Env(), 0);
@@ -6293,7 +6293,15 @@ answers `Y=1`, `Y=2`, and `Y=3`.
6293
6293
  can still unify. Its residual store is normalized by logical implication:
6294
6294
  symmetric or equivalent constraints share one residual, and a stronger
6295
6295
  constraint removes weaker ones regardless of insertion order. Independent
6296
- disequalities remain separate.
6296
+ disequalities remain separate. Residual projection is re-evaluated in each
6297
+ solution environment, so a compound disequality is kept intact until later
6298
+ bindings make one aligned subterm pair sufficient. For example:
6299
+
6300
+ ```eyeprolog
6301
+ ?- dif(f(X,A),f(Y,B)), ( true ; A = B ).
6302
+ dif(f(X, A), f(Y, B))
6303
+ ; A = B, dif(X, Y).
6304
+ ```
6297
6305
 
6298
6306
  <!-- eyeprolog-library-catalog:start -->
6299
6307